windows - 这个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"
解决方案
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
推荐阅读
- amazon-web-services - 如何通过 Cloudformation 模板为 AWS API GW 启用 Cloudwatch 日志记录
- git - Git 显示子模块修订
- python - 如何使用 python 中的 zipfile 库将 ZipFile 存储在 ZipFile 中
- symfony - KnpPaginatorBundle 中的自定义排序查询
- java - iText 字体设置为短语未反映
- reactjs - 在 React 数据表的列标题上附加顺风类
- jqtree - 阻止 jqTree UI 显示某些节点的放入节点的选项
- node.js - Raspberry Pi 能否托管 Node JS 应用程序
- python - 抓取动态生成的 CSS 标签
- javascript - 哪些 TypeScript 标识符和构造(除了枚举)“存活”了编译并且可以在运行时在 JavaScript 中访问?