Installing new PowerShell Snapin

You need to install new PS snapins as admin user using PoweShell.exe:

PS C:> powershell “C:DownloadsSoftwarePowerShellWASPWASPInstall.ps1” -Force
You’re running PowerShell 2.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 2.0.50727.4927
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 C:DownloadsSoftwarePowerShellWASPWASPWASP.dll assembly’s progress.
The file is located at C:DownloadsSoftwarePowerShellWASPWASPWASP.InstallLog.
Installing assembly ‘C:DownloadsSoftwarePowerShellWASPWASPWASP.dll’.
Affected parameters are:
logtoconsole =
assemblypath = C:DownloadsSoftwarePowerShellWASPWASPWASP.dll
logfile = C:DownloadsSoftwarePowerShellWASPWASPWASP.InstallLog

The Install phase completed successfully, and the Commit phase is beginning.
See the contents of the log file for the C:DownloadsSoftwarePowerShellWASPW
ASPWASP.dll assembly’s progress.
The file is located at C:DownloadsSoftwarePowerShellWASPWASPWASP.InstallLo
g.
Committing assembly ‘C:DownloadsSoftwarePowerShellWASPWASPWASP.dll’.
Affected parameters are:
logtoconsole =
assemblypath = C:DownloadsSoftwarePowerShellWASPWASPWASP.dll
logfile = C:DownloadsSoftwarePowerShellWASPWASPWASP.InstallLog

The Commit phase completed successfully.

The transacted install has completed.

CommandType     Name                            Definition
———–     —-                            ———-
Cmdlet          Get-WindowPosition              Get-WindowPosition [-Window]…
Cmdlet          Remove-Window                   Remove-Window [-Window] <Win…
Cmdlet          Select-ChildWindow              Select-ChildWindow [-Window]…
Cmdlet          Select-Control                  Select-Control [[-Index] <In…
Cmdlet          Select-Window                   Select-Window [[-ProcessName…
Cmdlet          Send-Click                      Send-Click [[-Left] <Int32>]…
Cmdlet          Send-Keys                       Send-Keys [-Keys] <String> […
Cmdlet          Set-WindowActive                Set-WindowActive [-Window] <…
Cmdlet          Set-WindowPosition              Set-WindowPosition [[-Left] …
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.

PS C:>

Run the add-snapin command:

PS C:> Add-PSSnapin WASP
PS C:>

Snapin install fails even for admin user even if ran directly in PS shell itself:

PS C:> “C:DownloadsSoftwarePowerShellWASPWASPInstall.ps1” -Force
You must provide a value expression on the right-hand side of the ‘-f’ operator
.
At line:1 char:60
+ “C:DownloadsSoftwarePowerShellWASPWASPInstall.ps1” -F <<<< orce
+ CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordEx
ception
+ FullyQualifiedErrorId : ExpectedValueExpression

PS C:>

Snapin install fails as below when ran as normal/non-admin user:

C:Temp>powershell “C:DownloadsSoftwarePowerShellWASPWASPInstall.ps1” -Force
You’re running PowerShell 2.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 2.0.50727.4927
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 C:DownloadsSoftwarePowerShellWASPWASPWASP.dll assembly’s progress.
The file is located at C:DownloadsSoftwarePowerShellWASPWASPWASP.InstallLog.
Installing assembly ‘C:DownloadsSoftwarePowerShellWASPWASPWASP.dll’.
Affected parameters are:
logtoconsole =
assemblypath = C:DownloadsSoftwarePowerShellWASPWASPWASP.dll
logfile = C:DownloadsSoftwarePowerShellWASPWASPWASP.InstallLog

An exception occurred during the Install phase.
System.UnauthorizedAccessException: Access to the registry key ‘HKEY_LOCAL_MACHINESoftwareMicrosoftPowerShell1Power
ShellSnapInsWASP’ is denied.

The Rollback phase of the installation is beginning.
See the contents of the log file for the C:DownloadsSoftwarePowerShellWASPWASPWASP.dll assembly’s progress.
The file is located at C:DownloadsSoftwarePowerShellWASPWASPWASP.InstallLog.
Rolling back assembly ‘C:DownloadsSoftwarePowerShellWASPWASPWASP.dll’.
Affected parameters are:
logtoconsole =
assemblypath = C:DownloadsSoftwarePowerShellWASPWASPWASP.dll
logfile = C:DownloadsSoftwarePowerShellWASPWASPWASP.InstallLog
An exception occurred during the Rollback phase of the Huddled.Wasp.WindowsAutomationSnapIn installer.
System.UnauthorizedAccessException: Access to the registry key ‘HKEY_LOCAL_MACHINESoftwareMicrosoftPowerShell1Power
ShellSnapIns’ is denied.
An exception occurred during the Rollback phase of the installation. This exception will be ignored and the rollback wil
l continue. However, the machine might not fully revert to its initial state after the rollback is complete.

The Rollback phase completed successfully.

The transacted install has completed.
The installation failed, and the rollback has been performed.
WARNING:
Installation Failed. You’re probably just not running as administrator.

If you see a System.UnauthorizedAccessException in the log output above, with an HKEY_LOCAL_MACHINE path, that’s
deffinitely what happened, just start an administrative console and try again.

C:Temp>

Leave a Reply

Your email address will not be published. Required fields are marked *