Share This Post

PowerShell PowerGadgets In Action

If you want to add more power or to have more fun with PowerShell, you could try adding PowerGadgets to your toolbox.

PowerGadgets is a PowerShell snap-in that add charts, gauges and maps to your scripts.

Try save the following script as FolderSize.ps1:

$items = get-childitem $args

foreach($item in $items)

{if($item -is [System.IO.DirectoryInfo])

{add-member -inputobject $item -membertype ScriptProperty -Name FolderSize

-Value{$a = get-childitem $this.fullname -include *.* -recurse |

measure-object -sum Length;if($a-eq $null) {return 0;}else {return $a.sum}}

write-output $item



Then type FolderSize | out-chart

Now you can see PowerGadgets in Action!

Of course, you need to have PowerGadgets installed first! You can get a free trial copy of PowerGadgets at

Share This Post

Ying Li obtained a Master degree of Medicine in China and worked in the medical field before he came to the states in 1996. He made the career switch from troubleshooting people to troubleshooting computers after he came to the states. Not entirely a surprise there, if you know that his second preference for college is Mathematics. Ying is two times Admin Framework MVP awardee (2007-2008).His previous employment experience in the US includes UUNET, MCI WorldCom. MMC (Marsh & McLennan Companies), Merrill Lynch. He is currently employed by Related Companies as a Senior Infrastructure Engineer. He is proficient in virtually all Microsoft products (Office/Back office). His craving for efficiency naturally leads him to scripting, automation and before you know it, PowerShell! He is currently a MCSE (NT4, 2000, 2003) and MCITP Server Administrator. Ying enjoys wines and love to travel. His non work related passion is to advocate Health Living!

Leave a Reply