【问题标题】:How to get Powershell to run SH scripts如何让 Powershell 运行 SH 脚本
【发布时间】:2012-11-24 11:30:51
【问题描述】:

谁能告诉我如何让 Powershell 运行 .sh 脚本?当我运行此命令时,它一直试图在记事本中打开我需要的文件:

.\update-version.sh 123

我已将 .SH 添加到我的 PATHEXT 环境变量中,并将 Microsoft.PowerShell_profile.ps1 目录添加到 Path 环境变量中。

【问题讨论】:

  • .sh 适用于 linux 系统,不是吗?你不使用 cygwin 来运行这些脚本吗?
  • 请从 update-version.sh 发布几行脚本代码
  • 谢谢,用 cygwin 搞定了

标签: powershell scripting environment-variables sh


【解决方案1】:

PowerShell 脚本具有 .ps1 扩展名(以及其他受支持的扩展名,例如 psm1、psd1 等),除此之外它不会运行其他扩展名。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-03-23
    • 2020-01-10
    • 2011-01-03
    • 1970-01-01
    • 2012-09-12
    • 2020-05-01
    • 2010-12-01
    相关资源
    最近更新 更多