Wiki Life: PowerShell PowerPack!

Today's post is a quick one, but it's something close to my heart! 

I'm constantly writing Wiki articles and blog posts about PowerShell. PowerShell is awesome, and so many tasks can be simplified using it. Sharing examples is something I like to do, and I always turn to one tool to format my code examples... The PowerShell PowerPack!

The PowerShell PowerPack is documented on the Technet Wiki here, Wiki: How to Insert Formatted Windows PowerShell Code on TechNet Wiki

It's a module that, once imported into PowerShell, allows you to copy and paste colorised PowerShell code as HTML. Great for pasting code examples into Wiki articles!!

Here's an example from one of my articles, SharePoint 2013: Get Set and Copy User Profile Properties using PowerShell

$site=new-object Microsoft.SharePoint.SPSite("https://c05470sp10:7443");                        
$serviceContext = Get-SPServiceContext $site;                        
$upm = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($serviceContext);                        
$userProfile = $upm.GetUserProfile("");

Awesome huh!?

Comments (6)

  1. Formatted code is easier to read. The colorization also helps, and makes it look more professional.

  2. Saeid Hasani says:

    Thanks Matthew for sharing! 🙂

  3. pituach says:

    Thanks Matthew
    * I agree with Richard "Formatted code is easier to read" and it give to all the articles same basic format, which is good. We don’t want that each page in the WIKI will look like, part of a different website 🙂

  4. This is a fantastic contribution to the community!

    The first link in the article seems to be broken:


Skip to main content