Hi There,
I've got this nice oneliner to show some snapshot info:
"Get-VM | Get-Snapshot | Select VM,Name,Description,SizeMB"
I'd like to fetch this output and output it to an html file.
Is there any way to achive this?
Thanks,
Erik
Since you have access to the .Net functions from PowerShell, you can do
Get-VM | Get-Snapshot |
Select VM,Name,Description,@{N="SizeGB";E={[math]::Round($_.SizeGB,0}} |
ConvertTo-HTML | Out-File C:\Scripts\Test.htm
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Sure is, the smiplest way to create HTML output is
Get-VM | Get-Snapshot | Select VM,Name,Description,SizeMB |
ConvertTo-HTML | Out-File C:\Scripts\Test.htm
You can go very far with this when you start using style sheets.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Not trying to be nosey, but I like his initial request to LucD. I do some what the same, but my output for MB is always a large honkin' number. Any way to round up/down request whole intergers only? 3423.786587587587658 would like 3424
preferably in GB not MB, whole intergers of course...
again sorry for being nosey...
Since you have access to the .Net functions from PowerShell, you can do
Get-VM | Get-Snapshot |
Select VM,Name,Description,@{N="SizeGB";E={[math]::Round($_.SizeGB,0}} |
ConvertTo-HTML | Out-File C:\Scripts\Test.htm
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Also very nice, thanks!
best regards,
Erik