无法执行powershell 5.0脚本作为azure webjob

时间:2017-02-02 21:45:16

标签: powershell azure azure-webjobs powershell-v5.0

当我在kudu cmd的天蓝色网站上这样做时:

$PSVersionTable.PSVersion

然后我为powershell获得 4.0

我想提取一个zip文件,但是我从webjob日志文件中收到此错误:

[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网站上升级呢?

1 个答案:

答案 0 :(得分:2)

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