のねのBlog

パソコンの問題や、ソフトウェアの開発で起きた問題など書いていきます。よろしくお願いします^^。

vagrant Script: import_vm_vmcx.ps1 Error:

C:\HashiCorp\Vagrant>vagrant up --provider hyperv
Bringing machine 'default' up with 'hyperv' provider...
==> default: Verifying Hyper-V is enabled...
==> default: Importing a Hyper-V instance
    default: Please choose a switch to attach to your Hyper-V instance.
    default: If none of these are appropriate, please open the Hyper-V manager
    default: to create a new virtual switch.
    default:
    default: 1) 仮想スイッチ 外部
    default: 2) 仮想スイッチ プライベート
    default: 3) DockerNAT
    default: 4) nat
    default:
    default: What switch would you like to use? 1
    default: Cloning virtual hard drive...
    default: Creating and registering the VM...
An error occurred while executing a PowerShell script. This error
is shown below. Please read the error message and see if this is
a configuration error with your system. If it is not, then please
report a bug.

Script: import_vm_vmcx.ps1
Error:

発生場所 C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.9.4\plugins\providers\hyperv\scripts\impo
rt_vm_vmcx.ps1:18 文字:37
+     [string]$differencing_disk=$null
+                                     ~
関数パラメーター一覧に ')' が存在しません。
発生場所 C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.9.4\plugins\providers\hyperv\scripts\impo
rt_vm_vmcx.ps1:20 文字:1
+ )
+ ~
式またはステートメントのトークン ')' を使用できません。
    + CategoryInfo          : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : MissingEndParenthesisInFunctionParameterList
C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.9.4\plugins\providers\hyperv\scripts
import_vm_vmcx.ps1


18行目にカンマが抜けてるようだ。

Param(
    [Parameter(Mandatory=$true)]
    [string]$vm_config_file,
    [Parameter(Mandatory=$true)]
    [string]$source_path,
    [Parameter(Mandatory=$true)]
    [string]$dest_path,
    [Parameter(Mandatory=$true)]
    [string]$data_path,

    [string]$switchname=$null,
    [string]$memory=$null,
    [string]$maxmemory=$null,   
    [string]$cpus=$null,
    [string]$vmname=$null,
    [string]$auto_start_action=$null,
    [string]$auto_stop_action=$null,
    [string]$differencing_disk=$null      <==カンマ
    [string]$enable_virtualization_extensions=$False
)