powershell-2.0 - powershell 2.X 是否支持下载和运行脚本?
问题描述
我创建了一个install.ps1
来安装一个大程序。在类 UNIX 操作系统中,我们曾经这样做:
bash -c "$(curl -L https://url/to/my/install.sh)"
我的脚本是为 Windows 2008 Server sp2 设计的,默认的 powershell 是 2.x。powershell 2.x 可以这样运行吗?</p>
start-bitstransfer -source https://url/to/my/install.ps1 | powershell
我试过这样,但新的 powershell 会话失败了,这不是我们想要的。
解决方案
推荐阅读
- python - ModuleNotFoundError 仅在终端启动时出现,如何解决?
- azure - 从本地文件系统读取 Azure 审核日志
- scala - scala可以隐式地将2个隐式连接到一个隐式元组中吗?
- php - 仅当类别具有产品 WooCommerce 时才在 foreach 中返回结果
- reactjs - 第一个按钮单击后反应组件不更新
- c# - 图片不是从某些网站加载的
- swagger - .Net核心应用程序中的配置方法面临问题
- javascript - 使用二叉树的迭代解决方案来获得等于目标总和的路径总和时遇到问题
- jquery - 如何使用 jQuery 从多个集合选择中提取 id?
- mongodb - 如何仅允许用户访问 docker 中的 MongoDB?