如何使用Azure Automation DSC在目标节点上安装.exe文件?

时间:2019-05-31 12:02:22

标签: dsc

我正在尝试使用Azure Automation DSC在目标节点上安装.exe文件(Notepad ++),我能够将.exe文件从我的存储帐户复制到目标节点,但是它没有安装软件包。

下面是我的代码:

Configuration Notepad++
{
   param(
      [string]
   $location = "C:\elevatefolder\packageselevate\npp.7.6.6.Installer.x64.exe"
   )
        Import-DscResource -ModuleName xPSDesiredStateConfiguration

    Node "localhost"
    {
    File CreateDirectory
    {
       Ensure = "present"
       Type = "Directory"
       DestinationPath = "C:\elevatefolder"
           }
        xRemoteFile FileDownload
        {
            Uri = "<URL to my storage account>"
            DestinationPath = $location
                  }
    Package Notepad++
        {
            Ensure = "Present"
            Name = "Notepad++"
            Path = $location 
            ProductId = ""

0 个答案:

没有答案