Doesn't work on 64 bit

Jun 8, 2008 at 9:15 PM

Even if I try to register it with 

C:\Windows\Microsoft.NET\Framework64\v2.0.50727\InstallUtil.exe "<PathToDll>"
Any pointers ?
Jun 8, 2008 at 10:40 PM
Hey James,

When you say it "doesn't work" - what exactly happens or doesn't happen? do you have a mobile drive available?

Jun 9, 2008 at 1:01 PM
on 64 bit I get
PS C:\Users\jamesone\Documents\windowsPowershell> Add-PSSnapin psmobile
Add-PSSnapin : Windows PowerShell snap-in psmobile is not installed on the machine.
At line:1 char:13
+ Add-PSSnapin  <<<< psmobile

On 32 bit 
PS C:\Users\jamesone\Documents\windowsPowershell> add-pssnapin psmobile
PS C:\Users\jamesone\Documents\windowsPowershell>
It works silently.

I had the same issue with community extensions and this fixed it.
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\InstallUtil.exe "<PathToDll>"

Jun 9, 2008 at 4:52 PM
I can't give you any answers on the 64bit problem you're having, but it looks like the 32bit version is fine: when you add a snapin, it doesn't switch to the mobile drive automatically. This is how powershell works normally. Try switching to the mobile drive like this:
ps c:\> add-pssnapin psmobile
ps c:\> cd mobile:
ps mobile:\>

Hope this helps,

- Oisin
Jun 15, 2008 at 10:31 PM

OK - have it working now
Here is the generic guide to making snapins work on 64 bit.

Install it.
Start Powershell AS ADMINISTRATOR and use the command

 Get-PSSnapin -Registered

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>"
(this will fail if not admin !) Now for a second time run run 
  Get-PSSnapin -Registered
Again.  I found that this PS Snapin is called "PSMobile" in 32 bit and "Nivot.PowerShell.WindowsMobile" in 64 bit

Load the Snapin with
   Add-PsSnapin "<SnapInName>"
I got an error that the WindowsMobile.formats.ps1xml could not be found in the folder C:\Program Files (x86)\PowerShell Windows Mobile Snap-In\FormatData , so I made the folder and copied the file into it.
Now  I can see the commands and the provider.

I don't know for sure but I suspect the Package install registers under the alias PSMobile, and the why I ran InstallUtil picks up a deault name from the DLL.


Jul 15, 2008 at 7:43 PM
Thanks James for that. There are some quirks in the WiX toolkit's handling of PowerShell snapins. Strange.