Azure 虚拟桌面会话主机“自定义配置”无法运行

问题描述 投票:0回答:1

我正在尝试使用“自定义配置”选项创建主机池虚拟机。说明中建议的自定义解决方案(https://raw.githubusercontent.com/Azure/RDS-Templates/master/wvd-sh/arm-template-customization/script.ps1)似乎没有做任何事情。我尝试使用本地管理员用户/密码通过堡垒直接连接到虚拟机,并尝试手动运行解决方案脚本。在那里,错误是:

File C:\\Users\localadmin\\VD0T\\Virtual-Desktop-Optimization-Tool-main\\Windows_VDOT.ps1 cannot be
loaded because running scripts is disabled on this system.
For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.

我在这里做错了什么,还是说明不正确?

azure azure-virtual-machine
1个回答
0
投票

正如评论中所解释的,您的执行策略设置为受限,这就是您收到阻止程序的原因。

您的脚本在远程签名或不受限制时可以工作,但在受限制时会失败。

enter image description here

使用

检查您的执行策略
Get-ExecutionPolicy -List

然后,如果受限制,请将其更改为远程签名或无限制。

Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser -Force

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.