Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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("myarlett@company.com");
Awesome huh!?
Comments
- Anonymous
September 17, 2014
Formatted code is easier to read. The colorization also helps, and makes it look more professional. - Anonymous
September 18, 2014
Awesome!
Thanks Matthew for sharing! :-) - Anonymous
September 19, 2014
The comment has been removed - Anonymous
September 23, 2014
Helpful, thanks - Anonymous
September 25, 2014
Thanks for share. - Anonymous
September 25, 2014
This is a fantastic contribution to the community!
The first link in the article seems to be broken: http://code.msdn.microsoft.com/PowerShellPack/Release/ProjectReleases.aspx?ReleaseId=3341
Thoughts?