Hi All,
I'm trying to do something and need some help. I have a .txt file and or a .csv with a list of VM's.. I'm trying
to import those list of VM's and export the following data from that listing.
Number of vCPU's per server
Configured/allocated memory per server
VMDK storage total (allocated) per server
Looking for some help.
Thanks..
Try like this
Get-VM -Name (Get-Content -Path .\vmnames.txt) |
Select Name,NumCpu,MemoeryGB,ProvisionedSpaceGB,UsedSpaceGB |
Export-Csv -Path .\report.csv -NoTypeInformation -UseCulture
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks.. It's weird, it finds some of the VM's but not others..
Get-VM : 9/20/2017 10:56:57 AM Get-VM | VM with name 'vmxxx' was not found using the specified filter(s). |
At C:\Scripts\pslinfo.ps1:3 char:1
+ Get-VM -Name (Get-Content -Path c:\Scripts\test.txt) |
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo | : ObjectNotFound: (:) [Get-VM], VimException | |
+ FullyQualifiedErrorId : Core_OutputHelper_WriteNotFoundError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetVM |
Looks like you might an entry 'vmxxx' in the test.txt file.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yes, I took out the real name, the real name is in the text file, in the vcenter but I still get the error. It's the same case, etc. It's odd
as it exported 1284 entries but i'm still missing about 1000 vm's.
Can you take one of those missing ones, and do a Get-VM -Name vmxxx.
Does that return anything?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference