小编kem*_*ety的帖子

使用 Azure Windows VM 运行 PowerSell 脚本的自定义数据

我正在尝试在 Azure 云中配置 Windows VM 期间下载并安装 exe。我不想使用自定义脚本扩展,但我想使用“自定义数据”。我在 Azure 文档中找不到任何可靠的示例。

在AWS中,我找到了足够的资源,我可以开发下面的PowerShell脚本并将其添加到用户数据中,但这在Azure上不起作用,我尝试了不同的变体,但没有成功。以前有人这样做过吗?有没有这方面明确的文档?我读到 Azure 使用 Cloud-init,但同样,没有关于如何在 Windows 计算机上使用 Cloud-init 执行此操作的明确示例,所有示例均适用于 Linux。

<powershell>
start-transcript
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest 'https://www.domain-name.com/filename.exe' -OutFile C:\filename.exe
C:\filename.exe --quiet
</powershell>
Run Code Online (Sandbox Code Playgroud)

任何帮助,将不胜感激。

powershell azure

6
推荐指数
1
解决办法
5582
查看次数

标签 统计

azure ×1

powershell ×1