Link to home
Start Free TrialLog in
Avatar of Albert Widjaja
Albert WidjajaFlag for Australia

asked on

Installing Powershell IDE on Windows Server 2008 R2 with .NET Fx 2.0 only?

Hello People,

I'm in the middle of decommissioning Exchange Server 2010 in the company that is already been using Office 365.

I need to install Visual Studio Code and its Powershell extension, under Windows Server 2008 R2, however, the .NET Fx is still on v2.0,

Hence I got stuck into this error:
User generated image
Can someone please suggest to me what do I need to do so I can have Powershell IDE running?
As for the PowerShell code, I assume I will still need to do the Remoting even when executing the code within the Exchange Server itself with the IDE:

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://localhost/PowerShell/ -Authentication Kerberos
Import-PSSession $Session -AllowClobber
Import-Module ActiveDirectory -ErrorAction STOP

Open in new window


Thank you.
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

add the feature Windows powershell ISE from add roles and features (requires .net 3.51).. you don't need VS CodeUser generated image
You can install ISE using:
Import-Module ServerManager 
 Add-WindowsFeature PowerShell-ISE

Open in new window

I would not recommend VS Code on Windows 2008 R2 for powershell scripting
Avatar of Albert Widjaja

ASKER

OK, I will uninstall it.

so if I enable the PowerShell ISE on the Windows Server 2008 R2, does the .Net Fx must also be updated to 3.5?
.net 3.51 comes with Server 2008R2/Windows 7
No, only .NET 3.0 is required
OK, since I'm using the Exchange Server 2010, I cannot just enable the .NET Fx without causing disruptions to the current email flow.

or can I just enable the PowerShell ISE only?
nothing to do with .net fx
.net 3.5.1 should already be installed as a prereq for exchange.
FYI, Powershell 2 is a security hazard these days.. you should really update it or remove it.
You can just enable ISE
SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
To find .NET frameworks installed run:

Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse |
Get-ItemProperty -name Version -EA 0 |
Select PSChildName, Version

Open in new window

THis is it:

PSChildName                      Version
-----------                      -------
v2.0.50727                       2.0.50727.5420
1033                             2.0.50727.5420
v3.0                             3.0.30729.5420
Setup                            3.0.30729.5420
1033                             3.0.30729.5420
Windows Communication Foundation 3.0.4506.5420
Windows Presentation Foundation  3.0.6920.5011
v3.5                             3.5.30729.5420
1033                             3.5.30729.5420
Client                           4.5.51209
1033                             4.5.51209
Full                             4.5.51209
1033                             4.5.51209
Client                           4.0.0.0


[PS] C:\>$PSVersionTable

Name                           Value
----                           -----
CLRVersion                     2.0.50727.8762
BuildVersion                   6.1.7601.17514
PSVersion                      2.0
WSManStackVersion              2.0
PSCompatibleVersions           {1.0, 2.0}
SerializationVersion           1.1.0.1
PSRemotingProtocolVersion      2.1

Open in new window

ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial