Copy-VMFile
Copy-VMFile
Copies a file to a virtual machine.
構文
Parameter Set: Name
Copy-VMFile [-Name] <String[]> [-SourcePath] <String> [-DestinationPath] <String> -FileSource <CopyFileSourceType> [-AsJob] [-ComputerName <String[]> ] [-CreateFullPath] [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: VMObject
Copy-VMFile [-VM] <VirtualMachine[]> [-SourcePath] <String> [-DestinationPath] <String> -FileSource <CopyFileSourceType> [-AsJob] [-CreateFullPath] [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]
詳細説明
The Copy-VMFile cmdlet copies a file to a virtual machine.
パラメーター
-AsJob
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-ComputerName<String[]>
Specifies an array of Hyper-V hosts. The cmdlet copies the file to the hosts you specify.
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
. |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-CreateFullPath
Indicates that when the cmdlet copies a file, it creates folders if the folder does not already exist.
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-DestinationPath<String>
Specifies a path. The cmdlet copies the file to the destination path.
エイリアス |
なし |
必須? |
true |
位置は? |
3 |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-FileSource<CopyFileSourceType>
Specifies the type of a file source.
エイリアス |
なし |
必須? |
true |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-Force
ユーザーの確認を求めずにコマンドを強制的に実行します。
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-Name<String[]>
Specifies an array of virtual machine objects by name. The cmdlet copies files to the virtual machines you specify.
エイリアス |
VMName |
必須? |
true |
位置は? |
1 |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-SourcePath<String>
Specifies a path. The cmdlet copies the file from the source path.
エイリアス |
なし |
必須? |
true |
位置は? |
2 |
既定値 |
なし |
パイプライン入力を許可する |
True (ByValue) |
ワイルドカード文字を許可する |
false |
-VM<VirtualMachine[]>
Specifies an array of virtual machine objects. The cmdlet copies files to the virtual machines you specify. To obtain a virtual machine object, use the Get-VM cmdlet.
エイリアス |
なし |
必須? |
true |
位置は? |
1 |
既定値 |
なし |
パイプライン入力を許可する |
True (ByValue) |
ワイルドカード文字を許可する |
false |
-Confirm
コマンドレットを実行する前に、ユーザーに確認を求めます。
必須? |
false |
位置は? |
named |
既定値 |
false |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-WhatIf
コマンドレットを実行するとどのような結果になるかを表示します。コマンドレットは実行されません。
必須? |
false |
位置は? |
named |
既定値 |
false |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
<CommonParameters>
このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。
入力
入力型は、コマンドレットにパイプできるオブジェクトの型です。
出力
出力型は、コマンドレットによって生成されるオブジェクトの型です。
例
Example 1
This example copies the file “test.txt” from the host operating system into the guest operating system of the virtual machine “Test VM”. It will create the directory “C:\Temp” inside the guest operating system if it does not exist already.
PS C:\> Copy-VMFile "Test VM" -SourcePath "D:\Test.txt" -DestinationPath "C:\Temp\Test.txt" -CreateFullPath -FileSource Host