Here's my command...
Get-VM -Name yomama | New-HardDisk -CapacityGB 10
It will add the disk but I get the message below...
WARNING: Parameter 'VM' is obsolete. Passing multiple values to this parameter is obsolete.
What is the non obsoleting method to add a new disk to a VM?
Here's my PowerCLI version....
Name Value
---- -----
PSVersion 5.1.14393.1944
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.1944
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Thanks
This might be a bit confusing, but the VM parameter in itself is not deprecated, the option to pass more than 1 VM (an array) is deprecated.
Get-VM -Name VM1 | New-Harddisk -CapacityGB 10
will continue to work.
But the option to pass an array
$vms = Get-VM -Name VM1,VM2
New-Harddisk -VM $vms -CapacityGB 10
will disappear in one of the future PowerCLI releases.
Btw, that is your PowerShell version (from $PSVerstionTable).
To get your PowerCLI version do
Get-Module -Name VMware* -ListAvailable
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
This might be a bit confusing, but the VM parameter in itself is not deprecated, the option to pass more than 1 VM (an array) is deprecated.
Get-VM -Name VM1 | New-Harddisk -CapacityGB 10
will continue to work.
But the option to pass an array
$vms = Get-VM -Name VM1,VM2
New-Harddisk -VM $vms -CapacityGB 10
will disappear in one of the future PowerCLI releases.
Btw, that is your PowerShell version (from $PSVerstionTable).
To get your PowerCLI version do
Get-Module -Name VMware* -ListAvailable
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
OK, cool, thanks!
There will be no array used for this purpose.
My example of passing an array was not correct.
I updated the example above.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference