7

I just installed new powershell 3 on my Windows 7 machine and than I found out that new version of powershell doesn't work with Sharepoint 2010.

I also found a solution for this problem (here or here). But it only solves the problem for the standart powershell console. As we do most of the work through ISE, I wonder if it is possible to do the same thing in ISE?

I tried to add Version parameter, but ISE doesn't know it. I tried to type powershell -version 2 into ISE's console, but it didn't help.

If it would not be possible, I have another question: I need to use ISE with Sharepoint 2010, so how can I uninstall powershell 3 and new ISE?

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
jumbo
  • 4,670
  • 5
  • 39
  • 44
  • What you would need to find out if ISE is customizable enough so when it launches the powershell session inside you can provide a command line parameter to the powershell command. I would have to install new ISE and take a look on my own. Otherwise you might be stuck with editing scripts in ISE but testing outside using manually launched console. – Roman Oct 23 '12 at 22:46
  • I looked into settings and I couldn't find anything useful there. So maybe it is possible through some code customization, in profile maybe. But I don't know anything about such customizations... For now it seem I am stuck :( – jumbo Oct 24 '12 at 07:19
  • i did try quickly to create a powershell_ise.exe.config file as per [Forcing the Application ...](http://stackoverflow.com/questions/2046089/force-an-application-to-run-under-specific-net-runtime-version). I think that folder is protected somehow. I'll research further soon. – Roman Oct 24 '12 at 23:36

2 Answers2

6

This is a known issue when the Windows Management Framework 3.0 update is installed (it inlcudes PS 3.0) which, as it uses .net 4.0 makes all the SP2010 cmdlets (which are 3.5), incompatible.

The console application can accept the "-version 2" switch, but as pointed out this is not compatible with the ISE.

It is a known issue, another article suggests uninstalling the WMF update and re-booting the server, which I think is the only real answer to the last part of your question.

JJones
  • 795
  • 6
  • 12
1

You can do this by creating new PSSession.

Register-PSSessionConfiguration -Name PS2 -PSVersion 2.0 –ShowSecurityDescriptorUI

# Please consult system admin when your run set-item and Enable-WSManCredSSP command
Set-Item wsman:localhost\client\trustedhosts -value * -Confirm:$false -Force
Enable-WSManCredSSP -Role Client –DelegateComputer * -Force
Enable-WSManCredSSP -Role Server -Force

# For test purpose
# Get-WSManCredSSP
# get-item wsman:localhost\client\trustedhosts

$cred = Get-Credential
$session = New-PSSession -ComputerName $env:COMPUTERNAME -authentication credssp -ConfigurationName PS2 -Credential $cred
Enter-PSSession $session

# 2.0 runtime
Add-PSSnapin microsoft.sharepoint.powershell
$web = Get-SPWeb http://SPSite/
$web.Url

Exit-PSSession

Unregister-PSSessionConfiguration -Name PS2

Disable-WSManCredSSP -Role Client
Disable-WSManCredSSP -Role Server

If you don't exit PSSession, you can run 2.0 runtime command from Powershell ISE 3.