0

I have PowerShell v3 installed and launch the ISE from my local workstation. When I open a remote tab to a server(win2K8R2 WMF 3 installed) I seem to get a powerShell V1 session. I checked this by inspecting the $host variable.

> Name             : ServerRemoteHost Version          : 1.0.0.0
> InstanceId       : f0b4913e-95a8-4d6b-9aaa-f869a5b2a8fd UI            
> : System.Management.Automation.Internal.Host.InternalHostUserInterface
> CurrentCulture   : en-US CurrentUICulture : en-US PrivateData      : 
> IsRunspacePushed :  Runspace         :

This server has WMF 3.0 installed and when I open either the ISE or a PowerShell prompt locally from the server, I get a v3 session.

Other machines do not display this behavior and do run powershell v3 when opened locally or via a remote tab

I'm at a loss to troubleshoot this behavior. I want the remote tab to open a v3 Session.

Any Thoughts?

Jason Horner
  • 3,630
  • 3
  • 23
  • 29

2 Answers2

1

To check what PowerShell version is running, use the variable $PSVersionTable.

The value in $PSVersionTable.PSVersion tells the PowerShell version.

Here is an example of a $PSVersionTable variable content.

Name                           Value
----                           -----
PSVersion                      3.0
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
CLRVersion                     4.0.30319.17929
BuildVersion                   6.2.9200.16384
PSCompatibleVersions           {1.0, 2.0, 3.0}
PSRemotingProtocolVersion      2.2
Eric Bouchard
  • 71
  • 1
  • 4
0

I'm sure the original poster has already moved on but if anyone else is looking for the answer here it is. It seems that some modules check the powershell version for compliance and look at the ServerRemoteHost version rather than Powershell itself. It's just bad form in the module definitions. PSRemoteRegistry is one such example.

To resolve the problem (or rather, work around the issue), just edit the .psd1 file for the module in question and change the version requirements back to 1.0.

Minimum version of the Windows PowerShell engine required by this module

PowerShellVersion = '1.0'

Name of the Windows PowerShell host required by this module

PowerShellHostName = ''

Minimum version of the Windows PowerShell host required by this module

PowerShellHostVersion = '1.0'

Problem solved.

user3166350
  • 51
  • 1
  • 1