hi
any idea why I am not getting vcenter info here for this?
Not without you showing us what is in the Uid property :smileygrin:
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Seems to work perfectly for me
Get-VM | Get-Snapshot |
Select VM, Name,
@{N="Size";E={"{0:N2} GB" -f ($_.SizeGB)}},
Created, Description,
@{N="vCenter";E={$_.Uid.Split(":")[0].Split("@")[1]}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
luc
when I do
Get-VM | Get-Snapshot |
Select VM, Name,
@{N="Size";E={"{0:N2} GB" -f ($_.SizeGB)}},
Created, Description,
@{N="vCenter";E={$_.Uid.Split(":")[0].Split("@")[1]}} | sort Created | ft -auto | out-file c:\scripts\snapshot.txt
its not showing the vcenter column
ok I guess some of my Description columns were too long?
When I removed description, it does show the vcenter column.
any idea ?
Normal notepad editor wouldn't show full summary of output. You can try Export-Csv and check output in CSV file.
So can you show us an example of how the Uid property in a Snapshot object looks like at your site.
You can block out the sensitive information that might be in there, I just need to see how the structure of the value is.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try like this
Get-VM | Get-Snapshot |
Select VM, Name,
@{N="Size";E={"{0:N2} GB" -f ($_.SizeGB)}},
Created, Description,
@{N="vCenter";E={$_.Uid.Split(":")[0].Split("@")[1]}} | sort Created |
export-csv report.csv -NoTypeInformation -UseCulture
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Give full file path something like this :
export-csv c:\reports\report.csv
Yes, from what I can see that looks ok.
Is there a hostname or an IP address between the @ and the : ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
