Windows 8 problem

Jan 23, 2013 at 8:25 PM

I'm trying to use WASP on Windows 8.

From an elevated PS prompt (of course) I run 'install.ps1 -force'.

I get:

--------8<-----------

You're running PowerShell 3.0, so you don't need to Install this as a PSSnapin, you can use Import-Module (or Add-Module
 in CTP2) to load it.  If you still want to install it as a PSSnapin, re-run this script with -Force
Microsoft (R) .NET Framework Installation utility Version 4.0.30319.17929
Copyright (C) Microsoft Corporation.  All rights reserved.


Running a transacted installation.

Beginning the Install phase of the installation.
See the contents of the log file for the D:\tmp\wasp\WASP.dll assembly's progress.
The file is located at D:\tmp\wasp\WASP.InstallLog.
Installing assembly 'D:\tmp\wasp\WASP.dll'.
Affected parameters are:
    =
   logfile = D:\tmp\wasp\WASP.InstallLog
   assemblypath = D:\tmp\wasp\WASP.dll
   logtoconsole =

The Install phase completed successfully, and the Commit phase is beginning.
See the contents of the log file for the D:\tmp\wasp\WASP.dll assembly's progress.
The file is located at D:\tmp\wasp\WASP.InstallLog.
Committing assembly 'D:\tmp\wasp\WASP.dll'.
Affected parameters are:
    =
   logfile = D:\tmp\wasp\WASP.InstallLog
   assemblypath = D:\tmp\wasp\WASP.dll
   logtoconsole =

The Commit phase completed successfully.

The transacted install has completed.
Add-PSSnapin : An item with the same key has already been added.
At D:\tmp\wasp\Install.ps1:16 char:1
+ Add-PSSnapin WASP
+ ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Add-PSSnapin], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.AddPSSnapinCommand

To load the Windows Automation Snapin in the future, you need to run:
Add-PSSnapin WASP

You can also add that line to your Profile script to load it automatically.

--------8<----------

After that the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\WASP does exist, but no commands are available:

PS D:\tmp\wasp> select-window
select-window : The term 'select-window' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ select-window
+ ~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (select-window:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

--------8<----------

Any clue?

 

Coordinator
Jan 24, 2013 at 3:00 AM

Well, it really wasn't kidding when it said you should use Import-Module instead on PowerShell 3 -- it's much more flexible: you can specify the dll by path, or put it in a "Wasp" folder in your Documents\WindowsPowerShell\Modules\  folder, or any other folder that's in your $ENV:PSModulePath

I don't quite understand what's going on with the Add-PSSnapin failure saying "An item with the same key has already been added"  ... can you run "Get-PSSnapin" and see if it shows up? I mean, in a new PowerShell instance, you should be able to run:

Add-PSSnapin WASP

Get-PSSnapin # You should see WASP listed

You might also check Get-Command -Module WASP which should show all the commands if the snapin has been added (or if you have it set up as a module).

Jan 24, 2013 at 6:13 AM

Neither Get-PSSnapin nor Get-Command -Module WASP reports it.

In a PS2 host (powershell -version 2.0) Import-Module does work and makes the commands available.

In a PS3 host Import-Module seems to work (no message) but the commands are not available.

 

Coordinator
Jan 24, 2013 at 6:36 AM
Edited Jan 24, 2013 at 6:38 AM

Well, wasp.dll is working for me as a module in PS3 with this wasp.psd1 file next to it:

 

@{
PowerShellVersion="2.0"
Author="Joel Bennett"
CmdletsToExport="*"
CompanyName="http://HuddledMasses.org"
Copyright="© 2008-2010, Joel Bennett, released under the Ms-PL"
Description="A Windows Automation Snapin for Powershell"
CLRVersion="2.0"
FileList="Wasp.dll","Wasp.psd1"
RequiredModules="Reflection"
ModuleToProcess="Wasp.dll"
GUID="4f6fd93e-42b7-4548-b522-3ad6759aa62a"
ModuleVersion="1.3.0.2"
}

I doubt you need that psd1, it should just work. I actually put mine in a folder C:\Users\Joel\Documents\WindowsPowershell\Modules\WASP1 and rename the file to WASP1.dll and WASP1.psd1 (and edit the FileList and ModuleToProcess in the psd1 file) because I'm working on WASP 2 which I want to load as "WASP"

But in any case, it's definitely working to just Import-Module WASP1; Get-Command -Module WASP1