无法作为 azure webjob 执行 powershell 5.0 脚本
Can not execute powershell 5.0 script as azure webjob
当我在 kudu cmd 中的 azure 站点上执行时:
$PSVersionTable.PSVersion
然后我得到 4.0 for powershell。
我想提取一个 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 网站上升级它?
Azure Functions 尚不支持 PowerShell 5.0,但我们希望在未来几个月内添加该功能。有关问题的另一个实例,请参阅 https://social.msdn.microsoft.com/Forums/en-US/c4987e93-8617-43a7-969f-cc49aa723245/powershell-v5。
当我在 kudu cmd 中的 azure 站点上执行时:
$PSVersionTable.PSVersion
然后我得到 4.0 for powershell。
我想提取一个 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 网站上升级它?
Azure Functions 尚不支持 PowerShell 5.0,但我们希望在未来几个月内添加该功能。有关问题的另一个实例,请参阅 https://social.msdn.microsoft.com/Forums/en-US/c4987e93-8617-43a7-969f-cc49aa723245/powershell-v5。