SyntaxUnlock-VM [-VM] <VirtualMachine> [-Confirm] [-RunAsync] [-Server <VIServer>] [-WhatIf] [<CommonParameters>]
Detailed DescriptionThis cmdlet unlocks the specified virtual machine. The virtual machine should be encrypted, otherwise, this cmdlet would fail. If the virtual machine is in CryptoLocked state, this cmdlet will make the virtual machine become connected state.
|Name||Type||Description||Required?||Pipeline Input||Default Value|
|VM||VirtualMachine||Specifies the virtual machine that you want to unlock.||true||True (ByValue)|
|Confirm||SwitchParameter||If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation.||false||False|
|RunAsync||SwitchParameter||Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter, run "help About_RunAsync" in the VMware PowerCLI console.||false||False|
|Server||VIServer||Specifies the connected viserver on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default viservers. For more information about default viservers, see the description of the Connect-VIServer cmdlet.||false||False|
|WhatIf||SwitchParameter||Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.||false||False|
NotesThis cmdlet only works with a encrypted virtual machine. If the virtual machine is encrypted and in connected state, it will make vCenter Server system sync keys to ESX; If the virtual machine is encrypted and locked, it will bring the virtual machine back to connected state. This cmdlet only works with vCenter Server and ESX of versions 6.7 or later.
-------------------------- Example 1 --------------------------
Get-VM 'MyVM' | Unlock-VM
Unlocks the virtual machine named 'MyVM'.