database-tools

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

Office365 Cmdlets

Office365 comes with a complete set of PowerShell cmdlets. To review the cmdlets and what you can do with them, visit this URL:...

read more

Forwarding Parameters

To forward function parameters to a cmdlet, use $psboundparameters automatic variable and splatting. Here is a sample: function...

read more