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
[void][reflection.assembly]::Loadwithpartialname("Microsoft.Office.Server"); $site=new-object Microsoft.SharePoint.SPSite("https://c05470sp10:7443"); $serviceContext = Get-SPServiceContext $site; $site.Dispose(); $upm = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($serviceContext); $userProfile = $upm.GetUserProfile("email@example.com");