-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNew-FileToVM.ps1
35 lines (25 loc) · 896 Bytes
/
New-FileToVM.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<#
.Synopsis
Copies file to a VM.
.Description
Copies file to a VM.
Requires running and up to date guest integration services on target VM. I always keep messing this up, so i created this ;)
.Parameter VMName
Pick a VM where to copy file
.Parameter SourcePath
Pick a file you want to copy to a VM
.Parameter DestinationPath
Where do we put this file on a VM
#>
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True,HelpMessage="To what VM should we copy file")]
[String]$VMName,
[Parameter(Mandatory=$True,HelpMessage="Pick a file you want to copy to a VM")]
[String]$SourcePath,
[Parameter(Mandatory=$True,HelpMessage="Where do we put this file on a VM?")]
[String]$DestinationPath,
[String]$FileSource = "Host"
)
# Copy File to VM
Copy-VMFile $VMName -SourcePath $SourcePath -DestinationPath $DestinationPath -CreateFullPath -Force -FileSource $FileSource