Quantcast
Channel: Oneliners – PEETERSONLINE.NL
Viewing all articles
Browse latest Browse all 12

Posting Pause (plus bonus oneliner)

$
0
0

I’m sorry to announce that I won’t be able to post anything until the beginning of October. But I will be back, so please keep me in your RSS feed or check back here in a month. I’ll be back full-force, with more awesome one-liners, helpful scripts and fantastic functions!

Here’s a one-liner to show off to your colleagues. What do you do when somebody asks you for a printed overview of the top-twenty volumes on your virtual servers with the least free disk space?

You fire up your trusty Powershell of course! You type a single line of code, press enter and tell them to check the printer. How cool is that?

Get-VM | Where { $_.PowerState -eq “PoweredOn” } | Get-VMGuest | Select VmName -ExpandProperty Disks | Select VmName, Path, @{N=”MBFree”;E={[math]::Round((($_.FreeSpace)/1MB),2)}} | Sort MBFree | Select -First 20 | Format-Table -AutoSize | Out-Printer

Very cool indeed!

See you next month!

Hugo


Viewing all articles
Browse latest Browse all 12

Trending Articles