Pages

Friday, January 30, 2015

Re-usable PowerShell Scripts

I've always tried to make my PowerShell scripts re-usable by making them do VERY specific (singular) things.

For example, let's say that we are given a task to report on the up time of all Domain Controllers.  One could make a single script that would use ADSI or Get-ADComputer (or even the Get-QADComputer) to get all the Domain Controllers and then get and report on each of their up times via looping through all the Domain Controllers.

Saturday, January 24, 2015

Exchange Management Shell kills puppies

If you've been working with PowerShell for any amount of time, I'm sure you've come across a blog or two where Don Jones (PowerShell MVP and overall Guru) writes that every time you use Write-Host, God kills a puppy.

I've always taken that quote to heart and it just kills me that Microsoft uses Write-Host to display the banner every time you start Exchange Management Shell (EMS).  While it's not really that big of a deal with EMS, it can be a problem when you are trying to run Exchange Cmdlets outside of EMS, especially if you are running them in a separate runspace (more on that in a bit).

Friday, January 23, 2015

Free eBooks

PowerShell.org has some pretty good eBooks at http://powershell.org/wp/ebooks.

I really like The Community Book of PowerShell Practices that is stored on their Public OneDrive.

It covers a range of topics including:
  • Writing Help and Comments
  • Performance
  • Output
  • Trapping and Capturing errors
  • and more

I would highly recommend checking it (as well as some of the others) out.

Wednesday, January 21, 2015

Adding code in Blogger

Since I plan on posting a lot of PowerShell snippets, I figured it would be a good idea to figure out a good way to post the code. Plain text can be boring and difficult to format (let alone read). After a little Google-Fu, I decided to use SyntaxHighlighter by Alex Gorbatchev.

SyntaxHighlighter is a fully functional self-contained code syntax highlighter developed in JavaScript.

Wednesday, January 14, 2015

New Year, New Job, New Blog

As we are in the second week of the new year, I'm settling into my new job at CPS Energy as a Systems Administrator.  It's quite a change from the public sector that I'd been in for the previous 17 years.  I've thought about starting a blog for a long while now, but never really had the time.  Not sure that I still have the time, but I figured that now is as good of time as any.

Below are some of the things I hope to cover with this blog:
  • PowerShell
  • Windows Administration
  • Exchange Administration
  • Virtualization Administration
  • Random Geeky things I tend to do
  • ...and I'm sure the list will grow as time goes on

I look forward to hearing your comments.