< Back

Remove-VsphereVm

Sat Jan 18, 2020 9:38 am

NAME Remove-VsphereVm



SYNOPSIS

Removes a VM from inventory, or permanently from disk.





SYNTAX

Remove-VsphereVm -InputObject <PSObject[]> [-DeleteFromDisk <SwitchParameter>] -Connection <Hashtable>

[<CommonParameters>]



Remove-VsphereVm -VmId <String[]> [-DeleteFromDisk <SwitchParameter>] -Connection <Hashtable> [<CommonParameters>]





DESCRIPTION

Removes a VM from inventory, or permanently from disk.





PARAMETERS

-InputObject <PSObject[]>

Object representing the VM that is to be removed. Use Get-VsphereObject to retrieve input object.



Required? true

Position? named

Default value

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-DeleteFromDisk [<SwitchParameter>]

Specifies that the VM will be permanently deleted from disk. If not specified, the VM will be un-registered

from inventory. Un-registered VMs can be later be re-registered and become part of inventory again. A

re-registered VM will have a different ID (managed object reference) than before it was un-registered.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Connection <Hashtable>

Specifies connection information to the vCenter server. For example:

@{ServerUrl='<vCenter Server URL>';User='<user>';Password='<password>';LicenseKey=<license

key>;SkipCertificateValidation=$false}



Required? true

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-VmId <String[]>

ID (managed object reference) of the VM that is to be removed. After the VM is removed, this ID is no longer

valid.



Required? true

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.Management.Automation.PSObject[]







OUTPUTS

System.String

ID (managed object reference) of the removed VM. Note that this ID is no longer valid after the VM removal.







RELATED LINKS