【问题标题】:How to install Google chrome in VM using Desired state configuration (DSC) in azure?如何在 azure 中使用所需状态配置 (DSC) 在 VM 中安装 Google chrome?
【发布时间】:2020-04-12 06:26:43
【问题描述】:

我正在尝试使用以下代码在 azure 中使用 DSC 安装 google chrome。

Configuration InstallGoogleChorme
{

Import-DscResource –ModuleName 'PSDesiredStateConfiguration'

Node installChrome
    {
        #Google Chorme
         Package Chorme
         {
         Ensure = 'Present'
         Name = 'Google Chrome'
         Path = '‪C:\Users\google\Desktop\ChromeSetup.exe'
         ProductId = ''
         Arguments = '/silent /install'
        }
    }
}



InstallGoogleChorme -OutputPath C:\

Start-DscConfiguration -Path c:\ -Wait -Verbose -Force

但我无法安装并收到以下错误。

The WinRM client cannot process the request. If the authentication scheme is different from Kerberos, or if the client computer is not joined to a domain, then HTTPS transport must be used or the destination machine must be added to the TrustedHosts configuration setting. Use winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts list might not be authenticated. You can get more information about that by running the following command: winrm help config. + CategoryInfo : NotEnabled: (root/Microsoft/...gurationManager:String) [], CimException + FullyQualifiedErrorId : HRESULT 0x803380e4 + PSComputerName : installChrome

谁能帮我解决一下/

【问题讨论】:

  • 你是在虚拟机本地做这个吗?
  • 不,我正在从 azure 门户的自动化 DSC 中尝试这个。
  • 这只适用于本地(因为您使用的是start-dscconfiguration),那么您到底在做什么?
  • 我的要求是使用 DSC 安装 Google chrome

标签: azure azure-virtual-machine dsc


【解决方案1】:

通过在 VM 上运行“winrm enumerate winrm/config/listener”来验证 winrm 侦听器。 如果它不起作用,请确保您启用了 winrm 并通过 https 进行侦听

【讨论】:

【解决方案2】:

根据该错误消息,您可以尝试将目标 IP 地址添加到具有 Powershell 管理员权限的 TrustedHosts 列表中。

Set-Item WSMan:\localhost\Client\TrustedHosts -Value 'machineA,machineB'

注意:如果在 Powershell 上运行,上面的命令可能会失败

然后运行以下命令查看 TrustedHosts 列表中的计算机:

Get-Item WSMan:\localhost\Client\TrustedHosts

参考thisthis

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-06-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-01
    • 1970-01-01
    • 2018-10-24
    • 2017-09-16
    相关资源
    最近更新 更多