Archive for February 2009

Simple tip for PowerShell

February 25, 2009

Been doing more in PowerShell every week and while I’m far from being an expert I definitely enjoy what it offers. I’m always looking for tips and tricks to get the most out of PoSh and one came in my inbox today.

A short article by Jeffery Hicks pointed out something simple that makes perfect sense. Color coding the output to distinguish between your function info and the actual output.

Function Do-Something {
#run some code here
Write-host "Starting update process" -foregroundcolor Green
$procs=Get-wmiobject win32_process
Write $procs
}

When his above sample is run, the function message shows in green and the sorted and filtered output is sent to the pipeline.

Have to remember this for re-doing some of the early scripts I setup to see if I can clean them up.

Advertisements

Just Fix It

February 5, 2009

A new addition to the Microsoft support documents, the Fix It button.

Fix it

Rather than having to go down and do a list of 15 steps, the Fix It button will run a script to do the steps for you. It’s not on everything yet but it’s starting to show up on more pages.