Last active
April 3, 2019 02:26
-
-
Save wcarroll/30a07b5a141d0a8f4743c352e9c34f58 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
foreach ($volume in $VolumeList){ | |
$volumeUri = "$VMSettingsUrl/volumes/$($volume.volumeIdentifier)" | |
$currentVolume = Invoke-RestMethod -Uri $volumeUri -Method GET -TimeoutSec 100 -Headers $ZertosessionHeader -ContentType $TypeJSON | |
$currentVolume.Datastore.DatastoreIdentifier = $newVMDS.DatastoreIdentifier | |
$body = $currentVolume | Convertto-Json -depth 10 | |
$ChangeVolumeLocationRequest = Invoke-RestMethod -Uri $volumeUri -Method PUT -TimeoutSec 100 -Headers $ZertosessionHeader -ContentType $TypeJSON -Body $body | |
} #Close Volume Loop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment