【问题标题】:Can not execute powershell 5.0 script as azure webjob无法将 powershell 5.0 脚本作为 azure webjob 执行
【发布时间】:2017-02-02 21:45:15
【问题描述】:

当我在 kudu cmd 中的 azure 网站上进行操作时:

$PSVersionTable.PSVersion

然后我得到 4.0 for powershell。

我想提取一个 zip 文件,但我从我的网络作业日志文件中收到此错误:

[02/02/2017 21:37:20 > b2afe2: ERR ] + Expand-Archive $output -DestinationPath $env:WEBROOT_PATH
[02/02/2017 21:37:20 > b2afe2: ERR ] + ~~~~~~~~~~~~~~
[02/02/2017 21:37:20 > b2afe2: ERR ]     + CategoryInfo          : ObjectNotFound: (Expand-Archive:String) [], Comm 
[02/02/2017 21:37:20 > b2afe2: ERR ]    andNotFoundException
[02/02/2017 21:37:20 > b2afe2: ERR ]     + FullyQualifiedErrorId : CommandNotFoundException
[02/02/2017 21:37:20 > b2afe2: ERR ]  
[02/02/2017 21:37:20 > b2afe2: SYS INFO] Status changed to Success

好吧,Expand-Archive 需要 powershell 5.0,但我如何在我的 azure 网站上升级它?

【问题讨论】:

    标签: powershell azure azure-webjobs powershell-5.0


    【解决方案1】:

    Azure Functions 尚不支持 PowerShell 5.0,但我们希望在未来几个月内添加该功能。有关该问题的另一个实例,请参阅 https://social.msdn.microsoft.com/Forums/en-US/c4987e93-8617-43a7-969f-cc49aa723245/powershell-v5

    【讨论】:

      猜你喜欢
      • 2019-01-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-20
      • 1970-01-01
      • 1970-01-01
      • 2020-01-09
      • 1970-01-01
      相关资源
      最近更新 更多