Hello,
$myvmid
=(get
-vm
'myvm'
).id
(get
-view
-id
$myvmid
).UpgradeVM_Task(
'vmx-08'
This 2 lines will upgrade virtual hardware in vm to version 8. it works, i tested it. But when i was writing it first, i wrote it like this:
$myvmid
=(get
-vm
'myvm'
).id
(get
-view
-id
$myvmid
).UpgradeVM_Task(
)
Task was created , no error in powercli console. But error was displayed in VC, saying that this is impossible.
I read the guide about thie upgradeVM_task and it says:
Parameters
Name | Type | Description |
---|
_this | ManagedObjectReference | A reference to the VirtualMachine used to make the method call. |
version* | xsd:string | If specified, upgrade to that specified version. If not specified, upgrade to the most current virtual hardware supported on the host. |
So the parameter version is not needed becase of the " * " next to property version. It should assume vmx-08 by defalut as this is the newest version(esxi 5). This parameter version from what it says does not require $null , i can ommit it right ? OR this is another example that i should use get_type,get_method,invoke and somehow push $null to it ?