Month: October 2010

Run Programs Elevated

If you have User Account Control (UAC) enabled, you may want to run a program elevated. That's easy using Start-Process and the -verb parameter....

read more

Changing Console Colors

Like any other console window, PowerShell has 16 pre-defined colors that you can choose from to set background and foreground color. You can use two...

read more

Do You Use "Break"?

"Break" is a special keyword that you can use to exit loops and conditions prematurely. Have a look: Do { $pwd = Read-Host 'Enter your...

read more

Using ‘Continue’

You will find that "Continue" is a special instruction that you can use in loops to skip the remainder of a loop. This next loop returns...

read more

Write-Output is Picky

Assigning (multiple) return values with Write-Output works well, but you should keep in mind that Write-Output is picky and returns the exact thing...

read more