【问题标题】:How to make the proxy settings of a windows VM by using desired state configuration (DSC) in Azure?如何使用 Azure 中的所需状态配置 (DSC) 进行 Windows VM 的代理设置?
【发布时间】:2021-06-07 17:06:20
【问题描述】:

我正在检查如何使用 Azure 中的所需状态配置 (DSC) 来进行 Windows VM 的代理设置。有 DSC 的库吗?

通常,我使用以下命令从 cli 设置代理:

Set-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -name ProxyServer -Value "123.123.123.123:80"
Set-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -name ProxyEnable -Value 1

netsh winhttp set proxy 123.123.123.123:80

有什么想法吗?

【问题讨论】:

    标签: windows azure proxy azure-automation dsc


    【解决方案1】:

    你可以试试Script resource。在该资源中,您可以使用 TestScript 和/或 GetScript 属性来检查代理设置是否已按要求设置。如果尚未设置代理设置,则使用 SetScript 属性使用您提供的 cmdlet 实际设置代理设置。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-01
      • 1970-01-01
      • 2021-12-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多