简体   繁体   English

无法将Powershell 5.0脚本作为Azure Webjob执行

[英]Can not execute powershell 5.0 script as azure webjob

When I do on my azure site in kudu cmd: 当我在kudu cmd的Azure网站上执行操作时:

$PSVersionTable.PSVersion

then I get 4.0 for powershell. 然后我得到4.0的powershell。

I want to extract a zip file but I get this error from my webjob log file: 我想提取一个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

Well the Expand-Archive needs powershell 5.0 but how can I upgrade that on my azure site? 好了,Expand-Archive需要Powershell 5.0,但是如何在我的Azure站点上对其进行升级?

PowerShell 5.0 is not yet supported in Azure Functions, but we are looking to add that in the coming months. Azure Functions尚不支持PowerShell 5.0,但我们希望在未来几个月内将其添加。 See https://social.msdn.microsoft.com/Forums/en-US/c4987e93-8617-43a7-969f-cc49aa723245/powershell-v5 for another instance of the question. 有关该问题的另一个实例,请参见https://social.msdn.microsoft.com/Forums/en-US/c4987e93-8617-43a7-969f-cc49aa723245/powershell-v5

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM