Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- param([string]$Server = "", [string]$User = "", [string]$Password = "")
- add-pssnapin VMware.VimAutomation.Core
- Connect-VIServer -Server $Server -User $User -Password $Password -Force | Out-Null
- Get-VM |
- Add-Member -Name "GuestOS" -Value {$this.ExtensionData.Guest.GuestFullName} -MemberType ScriptProperty -Passthru -Force |
- Add-Member -Name "SelectedOS" -Value {($this | Get-View).summary.config.guestFullName} -MemberType ScriptProperty -Passthru -Force |
- Add-Member -Name "Cluster" -Value {Get-Cluster -VM $this} -MemberType ScriptProperty -Passthru -Force |
- Select Name,Cluster,VMHost,GuestOS,SelectedOS,PowerState,NumCPU,@{N="CPU Count";E={$_.ExtensionData.Config.hardware.numCPU/$_.ExtensionData.Config.hardware.numCoresPerSocket}},@{N="Cores per CPU";E={$_.ExtensionData.Config.hardware.numCoresPerSocket}},MemoryMB,@{N="IP Address";E={@($_.guest.IPAddress)}} | Export-Csv exports\$Server.$Cluster.csv -NoTypeInformation
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement