Difference between revisions of "Useful One-Liners (PowerCLI)"

Jump to navigation Jump to search
→‎Virtual Machine: Added "Get VM's VMX Path"
(→‎Virtual Machine: Added "Get VM's VMX Path")
Line 26: Line 26:


=== Get VM's UUID ===
=== Get VM's UUID ===
Get VM's UUID
Get list of VM's and their UUID's
<source lang="powershell"> Get-VM MyVM | %{(Get-View $_.Id).config.uuid} </source>   
<source lang="powershell"> Get-VM MyVM | %{(Get-View $_.Id).config.uuid} </source>   
=== Get VM's VMX Path ===
Get list of virtual machine config file paths in a particular vApp (for VM's in a folder use <code>Get-Folder</code> instead of <code>Get-vApp</code>)
<source lang="powershell"> Get-VM -Location (Get-vApp "vApp Name") | Get-View | %{$_.Config.Files.VmPathName} | Sort </source>


=== Storage vMotion ===
=== Storage vMotion ===

Navigation menu