-
-
Save DWSR/c95e366a8061fb6107b7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#$view = import-csv H:\test.csv | |
#$vcenter = get-view -ViewType virtualmachine | |
$report = @() | |
foreach ($vm in $view) | |
{ | |
if ($vm.Name -in $vcenter.Name) | |
{ | |
$entry = [PsCustomObject]@{ | |
Name = $vm.Name | |
CPU = $vcenter."$($vm.Name)".summary.config.NumCpu | |
Memory = $vcenter."$($vm.Name)".summary.config.MemorySizeMB | |
} | |
$report += $entry | |
} | |
} | |
$report | Export-Csv 'H:\results.csv' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Name | user_displayname | |
---|---|---|
computer1 | user1 | |
computer2 | user2 | |
computer3 | user3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i am interested in $_.summary.config.NumCPU and $_.summary.config.MemorySizeMB | |
---------- | |
Capability : VMware.Vim.VirtualMachineCapability | |
Config : VMware.Vim.VirtualMachineConfigInfo | |
Layout : VMware.Vim.VirtualMachineFileLayout | |
LayoutEx : VMware.Vim.VirtualMachineFileLayoutEx | |
Storage : VMware.Vim.VirtualMachineStorageInfo | |
EnvironmentBrowser : EnvironmentBrowser-envbrowser-1905 | |
ResourcePool : ResourcePool-resgroup-28 | |
ParentVApp : | |
ResourceConfig : VMware.Vim.ResourceConfigSpec | |
Runtime : VMware.Vim.VirtualMachineRuntimeInfo | |
Guest : VMware.Vim.GuestInfo | |
Summary : VMware.Vim.VirtualMachineSummary | |
Datastore : {Datastore-datastore-2030} | |
Network : {DistributedVirtualPortgroup-dvportgroup-3101} | |
Snapshot : | |
RootSnapshot : {} | |
GuestHeartbeatStatus : green | |
LinkedView : | |
Parent : Folder-group-v1402 | |
CustomValue : {} | |
OverallStatus : green | |
ConfigStatus : green | |
ConfigIssue : {} | |
EffectiveRole : {117441114} | |
Permission : {} | |
Name : bscw7ac30058 | |
DisabledMethod : {Destroy_Task, UnregisterVM, RevertToCurrentSnapshot_Task, RemoveAllSnapshots_Task...} | |
RecentTask : {} | |
DeclaredAlarmState : {alarm-10.vm-1905, alarm-102.vm-1905, alarm-103.vm-1905, alarm-11.vm-1905...} | |
TriggeredAlarmState : {} | |
AlarmActionsEnabled : True | |
Tag : {} | |
Value : {} | |
AvailableField : {FA.GosAgent} | |
MoRef : VirtualMachine-vm-1905 | |
Client : VMware.Vim.VimClientImpl | |
Capability : VMware.Vim.VirtualMachineCapability | |
Config : VMware.Vim.VirtualMachineConfigInfo | |
Layout : VMware.Vim.VirtualMachineFileLayout | |
LayoutEx : VMware.Vim.VirtualMachineFileLayoutEx | |
Storage : VMware.Vim.VirtualMachineStorageInfo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment