by oogabooga at 2012-09-05 08:16:38
Anybody else having a problem launching version 2 with the WMF 3.0 RTM package?by poshoholic at 2012-09-05 08:26:36
[1]: $PSVersionTable
Name Value
---- -----
WSManStackVersion 3.0
PSCompatibleVersions {1.0, 2.0, 3.0}
SerializationVersion 1.1.0.1
BuildVersion 6.2.9200.16398
PSVersion 3.0
CLRVersion 4.0.30319.269
PSRemotingProtocolVersion 2.2
[2]: powershell -version 2
Windows PowerShell
Copyright (C) 2012 Microsoft Corporation. All rights reserved.
Transcript started, output file is C:\Users\ccarmichael\Documents\PowerShell_transcript.20120905100815.txt
[1]: $PSVersionTable
Name Value
---- -----
WSManStackVersion 3.0
PSCompatibleVersions {1.0, 2.0, 3.0}
SerializationVersion 1.1.0.1
BuildVersion 6.2.9200.16398
PSVersion 3.0
CLRVersion 4.0.30319.269
PSRemotingProtocolVersion 2.2
[2]: Invoke-RestMethod
cmdlet Invoke-RestMethod at command pipeline position 1
Supply values for the following parameters:
Uri:
I’m working on Windows Server 2008 R2 with the WMF 3.0 RTM package installed and I haven’t had any problem with getting PowerShell -version 2 to work so far.by oogabooga at 2012-09-05 08:33:50Windows PowerShell
Copyright (C) 2012 Microsoft Corporation. All rights reserved.
PS C:\Users\Administrator> $PSVersionTable
Name Value
---- -----
PSVersion 3.0
WSManStackVersion 3.0
SerializationVersion 1.1.0.1
CLRVersion 4.0.30319.17929
BuildVersion 6.2.9200.16398
PSCompatibleVersions {1.0, 2.0, 3.0}
PSRemotingProtocolVersion 2.2
PS C:\Users\Administrator> powershell -version 2
Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.
PS C:\Users\Administrator> $PSVersionTable
Name Value
---- -----
CLRVersion 2.0.50727.5456
BuildVersion 6.1.7601.17514
PSVersion 2.0
WSManStackVersion 2.0
PSCompatibleVersions {1.0, 2.0}
SerializationVersion 1.1.0.1
PSRemotingProtocolVersion 2.1
Just to double-check, is this on a downlevel system that you installed WMF 3.0 on manually?
This is Windows 7 Professional with Service Pack 1by poshoholic at 2012-09-05 08:53:08
I installed this package: Windows6.1-KB2506143-x64.msu
Thanks for your help.
That should work then.by oogabooga at 2012-09-05 08:58:13
Did you restart your computer after installing the WMF package? Also, do you see any difference between invoking PowerShell -version 2 from PowerShell vs from the Start|Run menu (or cmd.exe)?
Yeah, I restarted when it prompted and again just for good measure. Checked for any additional updates (none were available).by poshoholic at 2012-09-05 09:12:44
Also, the same exact results when running this from cmd.exe
I also tried clearing out my profile just to make sure nothing in there was messing with it. That didn’t work either.
Last, I tried it from the 32bit shell…still no dice.
boo
Did you do anything with your PowerShell environment to force it to run with .NET 4 (the config file trick) prior to upgrading? I’m just trying to think of potential causes for this that could affect how PowerShell is run on a system.by willsteele at 2012-09-05 09:36:03
Kirk,by oogabooga at 2012-09-05 10:05:02
The config file trick you mentioned has me wondering. Is Powershell.exe a .NET application or a Win32 application? Based on the fact that there’s a .config file I would group that with the .NET app stack, but, when I try to poke around powershell.exe with Reflector I get nothing back. Thought you might have a thought on that.
I haven’t read about the config file trick, and I haven’t really installed too much on this box. Here, let me try to outline all the Powershelly stuff:by poshoholic at 2012-09-05 11:17:57
[list]
PowerGUI 3.2.0.2237
PowerCLI 5.0.1
PowerStudio 2012
SeeShell 1.1.0.0
[/list]
Now that I think about it…SeeShell required me to install .NET 4, but after looking, I don’t see the powershell.exe.config file and I don’t see the OnlyUseLatestCLR registry entry either.
I even uninstalled SeeShell and relaunched Powershell and it is still stuck at version 3.
PowerGUI is explicitly written to use PowerShell 2.0, even on a PowerShell 3.0 system, even with the 3.2 release that uses .NET 4.0. I have PowerGUI installed locally and it defaults to PowerShell 2.0. Which is handy considering it doesn’t have any features to support anything that has come in PowerShell 3.0. It’s entirely dependent on PowerShell 2.0. With that in mind, I wonder what you get from $PSVersionTable when you invoke that variable in PowerGUI now that you have upgraded.by poshoholic at 2012-09-05 11:21:49
Will, tbh I’m not sure how PowerShell.exe was written. But the config file trick is documented and used, as described here: http://stackoverflow.com/questions/2094 … -4-runtime. Without thinking too hard since PowerShell requires .NET, I would be inclined to think it’s a .NET app, yet it is also based on a very old console, so I really don’t know. I’ve never dug into PowerShell.exe itself using reflection.by oogabooga at 2012-09-05 11:38:26
Interesting…PowerGUI does force it to 2.0 successfully:by poshoholic at 2012-09-05 12:48:53
[code2=powershell][2]: $PSVersionTable
Name Value
---- -----
PSVersion 2.0
PSCompatibleVersions {1.0, 2.0}
BuildVersion 6.1.7601.17514
PSRemotingProtocolVersion 2.1
WSManStackVersion 2.0
CLRVersion 4.0.30319.269
SerializationVersion 1.1.0.1[/code2]
I wonder what that means? That PowerGUI forces it to 2.0 differently than v3 I suppose.
Well, PowerGUI is compiled using the System.Management.Automation dll that comes with version 2 of PowerShell, so it is bound to that version. Any host developers that want to support PowerShell 3 need to rebuild their host while linking in the System.Management.Automation dll that comes with WMF 3. And if they want to support both, well it gets more complicated than that. All to say, I’m not surprised PowerGUI opens with version 2 properly because it’s all it was built to handle. This is quite convenient now that version 3 is out because it makes for easier testing using v2 by just using PowerGUI. The same holds true for the current version of PowerSE, another free editor. The console in v3 was of course built to handle both though, so there’s something getting in the way of it properly opening version 2 on your system, which I guess is why we’re talking about this at all. At least now you have a workaround, since you can get at v2 by using PowerGUI.by oogabooga at 2012-09-05 12:58:35
Thanks for your help Kirk. The workaround does get me out of the woods at least and enable me to use the swanky new intellisense with the ISE.by poshoholic at 2012-09-05 13:14:41
I’m not going to mark this one as ‘SOLVED’ in hopes that one day someone will figure out the root cause.
Thanks again.
I’m glad the workaround works for you. I’ve pointed the thread out to some others who may have other troubleshooting ideas so that we can have a better chance at finding out what the root cause is.by stevenmurawski at 2012-09-05 13:22:56
oogabooga,by oogabooga at 2012-09-05 13:29:26
Were you running one of the early versions of the Windows Management Framework before installing the RTM bits?
There have been some oddities in that scenario.
Steve
No, I thought about it but since this is a new gig I decided not to put myself into a situation where I trashed my computer before they got to know me a little bit.