-1

I need to copy a file from an azure storage account to a vm via azure DSC.

Below is what i tried

Configuration ExampleDSC { Install-Module -Name 'xPSDesiredStateConfiguration' -force Import-DscResource -Name 'xPSDesiredStateConfiguration'

Node localhost
{
    File CreateFolder
    {
        Type            = 'Directory'
        DestinationPath = 'C:\NewFolder'
        Ensure          = "Present"
    }

    xRemoteFile remotefile {
# for uri generate a sas token then copy the sas token url in the uri line below
          Uri             = "storageblob+SAS token"
          DestinationPath = "C:\NewFolder\"
          DependsOn       = "[File]CreateFolder"
          MatchSource     = $false 


}

}

But I am getting below error - please help

Error message: "The DSC Extension received an incorrect input: An error occurred while executing script or module 'importcertificate.ps1': At C:\Packages\Plugins\Microsoft.Powershell.DSC\2.80.1.0\DSCWork\importcertificate.1\importcertificate.ps1:4 char:6

  •  Import-DscResource -Name 'xPSDesiredStateConfiguration'
    

Unable to load resource 'xPSDesiredStateConfiguration': Resource not found.. Please correct the input and retry executing the extension."

Should i only use : install PSDesiredStateConfiguration?

old_timer
  • 69,149
  • 8
  • 89
  • 168

1 Answers1

0

Is the xPSDesiredStateConfiguration folder/module in the same directory? It doens't ship with Windows so you'll need to get it from https://www.powershellgallery.com/packages/xPSDesiredStateConfiguration/8.10.0.0

That's the version I've been using, works fine.