database-tools

How Large Are My Folders?

To find out the total size of all subfolders in a directory, try this function: function Get-FolderSize($Path=$home) { $code = { ('{0:0.0}...

read more

HTML-Scraping with RegEx

To scrape valuable information from websites with PowerShell you can download the HTML code and then use regular expressions to extract what you are...

read more

Creating Pipeline Filters

In a previous tip, we illustrated how a function can run inside a PowerShell pipeline. That's an excellent way to create filters. Here is a...

read more

Forget the "Finally"-Block

When you handle errors using try/catch/finally, you may wonder what the finally block is for. Here is a demo: try { dir nonexisting:\ -ErrorAction...

read more

Use "E" in Numbers

To quickly define large integers, use the keyword "E" inside your number: PS> 64E6 64000000 ReTweet this Tip! http://bit.ly/pGRrMP

read more

Text-to-Speech

Here is a fun function that converts text to speech. It even has a switch parameter called -Drunk to change the voice accordingly: function Out-Text...

read more

Latest Process Activity

To find out whether a computer is idling for a long time or actually doing something, here is a function that returns the last process that was...

read more

Listing Windows Updates

There is a not widely known COM object that you can use to list all the installed Windows Updates on a machine. Here is the code: $Session =...

read more

Saving History to Script

PowerShell is all about trial and error, and when you want to save your interactive input to a script file, this is how it could be done:...

read more

Clean your TEMP folder!

When disk space gets low, you may want to clean up your temporary folder. The code deletes all files that are older than 30 days to make sure...

read more