首页 > 解决方案 > 这个win10 cmd命令如何在win7上工作?

问题描述

我想让以下命令在 Windows 7 上运行,但似乎在 Windows 7 上无法识别 Add-VpnConnection

set server_addr="Your VPN Server IP (or DNS name)"
# Create VPN connection
powershell -command "Add-VpnConnection -Name 'My IKEv2 VPN' -ServerAddress '%server_addr%' -TunnelType IKEv2 -AuthenticationMethod MachineCertificate -EncryptionLevel Required -PassThru"
# Set IPsec configuration
powershell -command "Set-VpnConnectionIPsecConfiguration -ConnectionName 'My IKEv2 VPN' -AuthenticationTransformConstants GCMAES256 -CipherTransformConstants GCMAES256 -EncryptionMethod AES256 -IntegrityCheckMethod SHA256 -PfsGroup None -DHGroup Group14 -PassThru -Force"

标签: windowscmd

解决方案


Add-VpnConnection在 Windows 7 上无法识别

Add-VpnConnection是 PowerShell 4.0 的一部分,内置于 Windows 版本 8.1+

您需要在 Windows7 上安装它。

请参阅如何安装 Windows PowerShell 4.0 - TechNet 文章 - 美国(英语) - TechNet Wiki以获取取决于您的 Windows 版本所需的文件。

如果要在 Windows 7 上安装最新版本的 PowerShell (7.1.2),请参阅如何在 Windows 7、Windows 8 和 Windows 10 中安装 PowerShell 7.1 | 教程发布 v7.1.2 PowerShell 发布 · PowerShell/PowerShell · GitHub


推荐阅读