How to get PowerShell snapins to work on 64 bit

I mentioned a problem with 64bit Powershell in my previous post: 3 snap-ins I've wanted to use have been packed for 32 bit and didn't work "out of the box" on 64 bit, so  I thought I'd give a generic guide to making snapins work on 64bit.

  • Install the the Snapin using what
  • ever tools the writer gave you, Under the hood this will invoke
    C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe "<PathToDll>"
  • Start Powershell AS ADMINISTRATOR and use the command
    Get-PSSnapin -Registered | fl name, modulename
  • If you don't see your new snap in on 64 bit run the command
    C:\Windows\Microsoft.NET\Framework64\v2.0.50727\InstallUtil.exe "<PathToDll>"
    Things to note. First. This will fail if you don't have admin powers, Second if you don't know the path to the DLL use the same get-psSnapin command in the 32 bit version.
    After you have got success messages from installUtil , for a second time run
    Get-PSSnapin -Registered
  • Be aware that the name you get when you run the command in 32 bit may not be same in 64 bit. I found this trying the Windows Mobile Provider from Codeplex It's called "PSMobile" in 32 bit and "Nivot.PowerShell.WindowsMobile" in 64 bit . The PowerShell Community Extensions use the same name - PSCX - on both.
  • Load the Snapin with 
    Add-PsSnapin "<SnapInName>"

I got an error that the WindowsMobile provider could not find  WindowsMobile.formats.ps1xml in the FormatData folder , so I made the folder and copied the file into it. I think the set-up configures one folder and the command line assumes another.

Comments (2)

  1. Oisin Grehan says:

    Thanks James for the notes on the 64bit problems. I have no access to a 64bit platform to test here, but I’ve doing a bit of research and it looks like the only way to do it with WiX (what I’m using) is to create a separate 64bit installer. The WiX stuff is pretty closed, especially the powershell extension that I’m using.

    – Oisin

    PSMobile coordinator

Skip to main content