Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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