Powershell 9.4.8.0

avatar

Hi,
I have problems loading the Module from a "Normal" (not RDM-Initiated) Powershell prompt:
When i try to manually load the DLL i get:
PS C:\Windows\system32> Import-Module -Global D:\SW\Temp\Devolutions.RemoteDesktopManager.Bin.9.4.8.0\RemoteDesktopManager.PowerShell.dll

WARNING: Some imported command names contain one or more of the following restricted characters: # , ( ) {{ }} [ ] & - / \ $ ^ ; : " ' < > | ? @ ` * % + = ~
PS C:\Windows\system32> $RDMSnapin = Get-PSSnapin -Name Remote.Desktop* -Registered
Get-PSSnapin : No Windows PowerShell snap-ins matching the pattern 'Remote.Desktop*' were found. Check the pattern and then
try the command again.
At line:1 char:14
+ $RDMSnapin = Get-PSSnapin -Name Remote.Desktop* -Registered
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Remote.Desktop*:String) [Get-PSSnapin], PSArgumentException
+ FullyQualifiedErrorId : NoPSSnapInsFound,Microsoft.PowerShell.Commands.GetPSSnapinCommand

So i cannot execute my script outside of RDM - but i would like to ;-)

All Comments (7)

avatar

For help on loading the RDM CmdLet without first running it through RDM have a look at:
http://help.remotedesktopmanager.com/index.html?powershell_cmdlets.htm

The RDM-CmdLet only load in x86. Are you running PowerShell x86?
You can check with:
[environment]::Is64BitProcess

As for the warning "...imported command names contain one..." you can ignore it.
Or you can use Add-PsSnapin instead of Import-Module it won't give you the warning.

Regards,

Stéfane Lavergne

avatar

A different Error this time bringing a dependency error:
PS D:\> [environment]::Is64BitProcess
True

PS D:\SW\Temp\Devolutions.RemoteDesktopManager.Bin.9.4.8.0> C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe .\RemoteDesktopManager.PowerShell.dll
Microsoft (R) .NET Framework Installation utility Version 2.0.50727.5420
Copyright (c) Microsoft Corporation. All rights reserved.

Exception occurred while initializing the installation:
System.BadImageFormatException: Could not load file or assembly 'file:///D:\SW\Temp\Devolutions.RemoteDesktopManager.Bin.9.4.8.0\RemoteDesktopManager.PowerShell.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded..

avatar

RDM CmdLet will not load in 64-bit, use the x86 version of PowerShell and all should be good.

Regards,

Stéfane Lavergne

avatar

Hi,

I'm having a similar issue with RDM 10.0.4.0. I manually register in the x86 PS window (this is 64-bit Win 7), and it looks like the transacted install completes, but the Remote.Desktop.Manager.10.0.4 part fails. Here's what I'm seeing:

====================================================================

PS C:\windows\system32> set-alias installutil $env:windir\Microsoft.NET\Framework\v4.0.30319\installutil; installutil 'C
:\Program Files (x86)\Devolutions\Remote Desktop Manager\RemoteDesktopManager.PowerShell.dll';Get-PSSnapin -Name *Remote.Desktop* -Registered | % { Write-Host "$_..." -NoNewline; if ( (Get-PSSnapin -Name $_ -ErrorAction SilentlyContinue) -eq $null ) { Write-Host "installing" -ForegroundColor Yellow; Add-PsSnapin $_ } else { Write-Host "already installed" -ForegroundColor Green; } }
Microsoft (R) .NET Framework Installation utility Version 4.0.30319.18408
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:\Program Files (x86)\Devolutions\Remote Desktop Manager\RemoteDesktopManager.PowerShell.dll assembly's progress.
The file is located at C:\Program Files (x86)\Devolutions\Remote Desktop Manager\RemoteDesktopManager.PowerShell.InstallLog.
Installing assembly 'C:\Program Files (x86)\Devolutions\Remote Desktop Manager\RemoteDesktopManager.PowerShell.dll'.
Affected parameters are:
logtoconsole =
logfile = C:\Program Files (x86)\Devolutions\Remote Desktop Manager\RemoteDesktopManager.PowerShell.InstallLog
assemblypath = C:\Program Files (x86)\Devolutions\Remote Desktop Manager\RemoteDesktopManager.PowerShell.dll

The Install phase completed successfully, and the Commit phase is beginning.
See the contents of the log file for the C:\Program Files (x86)\Devolutions\Remote Desktop Manager\RemoteDesktopManager.PowerShell.dll assembly's progress.
The file is located at C:\Program Files (x86)\Devolutions\Remote Desktop Manager\RemoteDesktopManager.PowerShell.InstallLog.
Committing assembly 'C:\Program Files (x86)\Devolutions\Remote Desktop Manager\RemoteDesktopManager.PowerShell.dll'.
Affected parameters are:
logtoconsole =
logfile = C:\Program Files (x86)\Devolutions\Remote Desktop Manager\RemoteDesktopManager.PowerShell.InstallLog
assemblypath = C:\Program Files (x86)\Devolutions\Remote Desktop Manager\RemoteDesktopManager.PowerShell.dll

The Commit phase completed successfully.

The transacted install has completed.
Remote.Desktop.Manager.10.0.4...installing
Add-PSSnapin : Cannot load Windows PowerShell snap-in Remote.Desktop.Manager.10.0.4 because of the following error: Could not load file or assembly 'file:///C:\Program Files (x86)\Devolutions\Remote Desktop Manager\RemoteDesktopManager.PowerShell.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
At line:1 char:410
+ set-alias installutil $env:windir\Microsoft.NET\Framework\v4.0.30319\installutil; installutil 'C:\Program Files (x86)
\Devolutions\Remote Desktop Manager\RemoteDesktopManager.PowerShell.dll';Get-PSSnapin -Name *Remote.Desktop* -Registered | % { Write-Host "$_..." -NoNewline; if ( (Get-PSSnapin -Name $_ -ErrorAction SilentlyContinue) -eq $null ) { Write-Host "installing" -ForegroundColor Yellow; Add-PsSnapin <<<< $_ } else { Write-Host "already installed" -ForegroundColor Green; } }
+ CategoryInfo : InvalidArgument: (Remote.Desktop.Manager.10.0.4:String) [Add-PSSnapin], PSSnapInExceptio
n
+ FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

PS C:\windows\system32>

====================================================================

Any ideas on where I can look?

Thanks,

Mike

avatar

Oh yeah... I tried using the $env variable from your PS help page ($env:windir\Microsoft.NET\Framework\v2.0.50727\installutil;installutil), but that failed right away for the same reason:


Exception occurred while initializing the installation:
System.BadImageFormatException: Could not load file or assembly 'file:///C:\Program Files (x86)\Devolutions\Remote Desktop Manager\RemoteDesktopManager.PowerShell.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded..

avatar

Try installing PS v4.0 (part of Windows Management Framework 4.0)

PS v4.0 runs in .Net 4.0 therefore should have no trouble loading the RDM CmdLet (FYI RDM v10 is in .Net 4.0)
Name Value
---- -----
PSVersion 4.0
WSManStackVersion 3.0
SerializationVersion 1.1.0.1
CLRVersion 4.0.30319.34014
BuildVersion 6.3.9600.17090
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion 2.2

Stéfane Lavergne

avatar

That did the trick! Thanks again for your awesome and very quick help!

Take care,

Mike