Announcing My SharePoint 2013 Custom Cmdlets

Posted on Posted in PowerShell Cmdlets, SharePoint 2010, SharePoint 2010, SharePoint 2013, SharePoint 2013

I’ve been putting this off for quite a while but I’ve finally pushed out a SharePoint 2013 build of my custom cmdlets. The reason it took so long was because I had to make a fair bit of changes to my existing stuff so that it would be easier to maintain both builds going forward. Specifically I needed to change the namespace of all the classes (which had 2010 in them) and I wanted to use a different name for the WSPs so the version wasn’t included in it either. So now I have just one WSP name for the SharePoint 2010 and SharePoint 2013 cmdlets for both Server and Foundation: Lapointe.SharePoint.PowerShell.wsp. If you previously had my old 2010 cmdlets deployed you’ll need to fully retract them before installing this new build (technically you can rename the new WSP file to the old name but I’d rather you embrace the change and just suck it up and do the dang retraction – it only takes a minute, so don’t be lazy!)

I’ve updated my downloads page to point to the correct WSP for each environment and I’ve deleted the old WSPs so if you were foolishly linking directly to my WSPs (please don’t do that) then your links are now broken. I’ve also posted the source code which has been upgraded for Visual Studio 2012 and contains a separate project for SharePoint 2010 and SharePoint 2013 (in addition to my custom MAML generator).

Another change I’ve made to help me manage these custom cmdlets better was that I got rid of my old command index page and created a new app for displaying the cmdlet details (the old page is still there, it just redirects to the new page). This new page is actually built dynamically using the PowerShell help file that I generate dynamically from the actual cmdlet classes – so for me this is pretty cool because now all the PowerShell help documentation and online documentation of each cmdlet is generated automatically so I don’t have to do anything other than provide the actual help details in the cmdlet classes themselves and I don’t do anything special to keep them in sync (just copy the help files up to my site).

At present both the SharePoint 2010 and SharePoint 2013 cmdlets are exactly the same (except for a few in code changes to make it work with 2013). I have, however, added a few new cmdlets from what was previously available and I’ll be added some more in the coming weeks (I’m hoping to start converting some of my more frequently used utility scripts and functions to cmdlets so I don’t have to keep hunting around for them). There is however, one breaking change (well, two to be exact) – the first is that I had to rename my Repair-SPSite cmdlet to Repair-SPMigratedSite because SharePoint 2013 introduces a cmdlet of the same name; the second was that I removed the gl-applytheme STSADM command as the functionality that it provided was specific to SharePoint 2007 and is no longer available (but I’m not really supporting the STSADM stuff anyways and contemplated removing them entirely but decided to leave them in, for now).

I haven’t had time to do a ton of testing of all the cmdlets on SharePoint 2013 – there’s just too many of them and I don’t make any money on these things so it’s not a high priority – so, as always, your feedback is appreciated and I’ll do my best to fix any bugs that are discovered but I can’t promise when I’ll get to them.

Happy PowerShelling!


5 thoughts on “Announcing My SharePoint 2013 Custom Cmdlets

  1. Hi,

    Great stuff! new-group keeps returning “Value cannot be null. Parameter name: owner AT line:1 char:1”

    I’ve tried entering the full command with all parameters as well with just the command and enter in the parameters as prompted.

    Am I missing something?


  2. Hello,

    I am trying to use the Import-spnavigation cmdlet. It is not working. ( the export worked fine and created the required XML. )
    I keep getting the following errors no matter how I try and call the cmdlet
    “Parameter set cannot be resolved using the specified named parameters”
    “Cannot find an SPWeb object with Id or Url”
    “Cannot find an SPSite object with Id or Url:”

    Sites and Webs both exist and I can get to them and pull a |GL on them.

    And the write up in your Command Index for Import-spnavigation is not correct.
    it is referencing security.

    Thank you.

  3. How can I change the location that ConvertTo-SPSite uses for storing the exported site? It is going to my C:\Users\\AppData\Local\Temp\ directory.
    Our server builds have limited space on the C drive, so I would rather the temp files go to the D Drive.

  4. How can i use this new powershell commandlet i followed the step and manage to install it
    Add-SPSolution Lapointe.SharePoint.PowerShell.wsp
    Install-SPSolution -Identity Lapointe.SharePoint.PowerShell.wsp -GACDeployment

    But when i tried the new command let it does not work, Get-Module also does not display the Lapointe.SharePoint.PowerShell any idea?


Comments are closed.