Hi All,
This script below works fine
$vmtest = Get-vm "vmname" | get-view
$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
$vmConfigSpec.changeTrackingEnabled = $true
$vmtest.reconfigVM($vmConfigSpec)
how can i pass a list of virtual machines in a text file c:\vms.txt to this script?
Thanks
Alex
I assume your TXT file has a vmname on each line, then you could do something like this
$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
$vmConfigSpec.changeTrackingEnabled = $true
Get-Content c:\vms.txt | %{
$vmtest = Get-vm -Name $_
$vmtest.ExtensionData.ReconfigVM($vmConfigSpec)
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I assume your TXT file has a vmname on each line, then you could do something like this
$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
$vmConfigSpec.changeTrackingEnabled = $true
Get-Content c:\vms.txt | %{
$vmtest = Get-vm -Name $_
$vmtest.ExtensionData.ReconfigVM($vmConfigSpec)
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks again