How do I get PowerShell 4 cmdlets such as Test-NetConnection to work on Windows 7?

后端 未结 7 801
刺人心
刺人心 2021-02-07 05:27

The situation. On a Windows 7 SP1 machine, I have updated with Windows6.1-KB2819745-x64-MultiPkg.msu. Furthermore, in PowerShell $PSVersionTable now reports ‘PSVersion 4.0’.

7条回答
  •  深忆病人
    2021-02-07 05:52

    Adding to Anton Krouglov's answer. PowerShell modules are cross-platform compatible. So a module copied from Windows Server 2012 R2 x64 can be imported to Windows 7 x86, and even if you are running as standard user without rights to copy them to C:\Windows\System32\WindowsPowerShell\v1.0\Modules you can copy it to any local folder, and run.

    Assuming you copied the NetTCPIP, DnsClient, and NetSecurity modules from a Windows Server 2012 or higher machine, and save them to a folder you can import them using

    Get-ChildItem -Directory .\psmodules | foreach { Import-Module -Name $_.FullName -Verbose}
    Test-NetConnection -InformationLevel "Detailed"
    

提交回复
热议问题