I am running some VEEAM PowerShell, after first filling an array with Key / Host / Virtual Machine data.
The array is used to feed parameters into the 'Reset-HvVmChangeTracking' cmdlet; here is some pseudo code to demonstrate!
Code: Select all
for($i=0; $i -lt $VMEnumerate; $i++)
{
Reset-HvVmChangeTracking -Server $EduHosts_VMs[$i][1] -VMName $EduHosts_VMs[$i][2] -WhatIf
}
Here are the two techniques that I have utilised, the first uses a script block -
Code: Select all
for($i=0; $i -lt $VMEnumerate; $i++)
{
Reset-HvVmChangeTracking -Server {Get-VBRServer -Name $EduHosts_VMs[$i][1]} -VMName $EduHosts_VMs[$i][2] -WhatIf
}
"System.Management.Automation.ScriptBlock" to type "Veeam.Backup.Core.Common.CHost".
The second code technique that I have attempted utilises brackets () -
Code: Select all
for($i=0; $i -lt $VMEnumerate; $i++)
{
Reset-HvVmChangeTracking -Server (Get-VBRServer -Name $EduHosts_VMs[$i][1]) -VMName $EduHosts_VMs[$i][2] -WhatIf
}
Both of the issues that I have encountered essentially relate to the returned data type being incorrect.
How can I go about getting back data in the correct format for the 'Reset-HvVmChangeTracking' cmdlet?
Any help will be greatly appreciated.
Kind Regards,
Davo