-
-
Save anonymous/660264b2139b150f7e53 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Same Storage location | |
$StoragePath = "C:\yourstoragelocation\here\" | |
#VMs which will be migrated Get-VM will migrate all VMs | |
$VMs = Get-VM | |
Move-VM -Name $VMs -DestinationHost SECRETSERVERNAME | |
Foreach ($VM in $VMs) { | |
$VMStorage = $StoragePath + $VM.Name | |
Write-Host "Moving VM:" $VM "to" $VMStorage | |
Move-VM - Name $VMs -DestinationStoragePath $VMStorage | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment