1

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}

1 Answer 1

1

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)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.