MatBee
MatBee

Reputation: 284

Powershell SDK 3

What is the correct way to get Powershell 3 SDK functions to work under Windows XP, Vista and 7 without the user having to install Powershell 3?

Assembly: system.management.automation.dll

Essentially this command has to run on Windows without needing Powershell 3.0 installed:

Import-Module NetConnection
Get-NetConnectionProfile | ForEach-Object {Set-NetConnectionProfile  -InterfaceIndex $_.InterfaceIndex -NetworkCategory Private}

Upvotes: 1

Views: 172

Answers (1)

Vikas Gupta
Vikas Gupta

Reputation: 4465

The module in question.. i.e. NetConnection is not part of Powershell SDK. It's part of Windows Server 2012 / 8 itself. See - http://technet.microsoft.com/en-us/library/dn264983(v=wps.620).aspx

Point is, even if you installed Powershell V3 alone on these older operating systems, it will not help you. The module in question most likely takes dependency on some other core windows components itself. (For example - Its a wrapper for WMI class located at root/StandardCimv2/MSFT_NetConnectionProfile)

Upvotes: 1

Related Questions