Grab our RSS feeds Follow us on Twitter Join our Facebook Group Connect with us on LinkedIn
myITforum.com, Powered by You.
you are not logged in

Articles

Newslinks

Links

Downloads

Site Services

Community Forums

Discussion Lists

Article Search

Newsletter

Web Blogs

FAQs

Live Support

myITforum TV

Take a Poll

Monthly Drawing

myITforum Network

User Group Directory

Our Partners

About Us

Register

Login

BRONZE PARTNER:

BRONZE PARTNER:



Industry News:




  Home : Articles : Windows PowerShell print | email | | Forums |   print | email | | Blogs |   print | email | | Wiki |   print | email | | FAQs |   print | email | Article Search  
PowerGadgets In Action


Bookmark and Share

By: Ying Li
Posted On: 7/19/2007

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 www.powergadgets.com

  myITforum.com ©2010 | Legal | Privacy