How would I add Power status on this, and specify I only want powered on VM's in the report?
Get-VM | Sort | Get-View -Property @("Name", "Config.GuestFullName", "Guest.GuestFullName") | Select -Property Name, @{N="Configured OS";E={$_.Config.GuestFullName}}, @{N="Running OS";E={$_.Guest.GuestFullName}} | Export-CSV
Try something like this
ViewType = 'VirtualMachine'
Property = 'Name','Config.GuestFullName','Guest.GuestFullName','Runtime.PowerState'
Filter = @{'Runtime.PowerState'='poweredOn'}
}
Get-View @sView |
Select -Property Name,
@{N='PowerState';E={$_.Runtime.PowerState}},
@{N="Configured OS";E={$_.Config.GuestFullName}},
@{N="Running OS";E={$_.Guest.GuestFullName}} |
Export-CSV -Path .\report.csv -NoTypeInformation -UseCulture
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try something like this
ViewType = 'VirtualMachine'
Property = 'Name','Config.GuestFullName','Guest.GuestFullName','Runtime.PowerState'
Filter = @{'Runtime.PowerState'='poweredOn'}
}
Get-View @sView |
Select -Property Name,
@{N='PowerState';E={$_.Runtime.PowerState}},
@{N="Configured OS";E={$_.Config.GuestFullName}},
@{N="Running OS";E={$_.Guest.GuestFullName}} |
Export-CSV -Path .\report.csv -NoTypeInformation -UseCulture
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks LucD.. Much appreciated!