Topics Speaker
Published on November 15, 2016 by Microsoft

This is part 2 of a series on using PowerShell. In this video, we cover how to work with Objects in PowerShell. We do that by breaking down this script.

Get-PSDrive | ?{$_.Free -gt 1} | %{$Count = 0; Write-Host "";} { $_.Name + ": Used: " + "{0:N2}" -f ($_.Used/1gb) + " Free: " + "{0:N2}" -f ($_.free/1gb) + " Total: " + "{0:N2}" -f (($_.Used/1gb)+($_.Free/1gb)); $Count = $Count + $_.Free;}{Write-Host"";Write-Host "Total Free Space " ("{0:N2}" -f ($Count/1gb)) -backgroundcolor magenta}

So if you have ever wanted to understand what all of that is and how to write your own crazy script this is the video for you.

Here is a link to better understanding the .NET formatting method. {0:N2}

For support or more information about PowerShell check out Bold Zebras.

Leave a Reply

1 Comment on "Manipulating Objects with PowerShell"

Notify of
avatar

kreativmaschine
Guest
kreativmaschine
22 days 20 hours ago

(y) keep on going. I enjoyed this video. it was very informative and entertaining. As a absolute ps beginner I’m now a step further…

wpDiscuz