DSC xRemoteFile

This topic contains 5 replies, has 2 voices, and was last updated by  Nitin Gupta 1 year, 2 months ago.

  • Author
    Posts
  • #55087

    Vojin Lekovic
    Participant

    Hi guys,

    I'm working on environment where I have to deliver IIS app from ZIP file stored in Azure Blob.
    Basically I have xRemoteFile which downloads file from specific URL to local disk, followed by xArchive that unzip that file to specific location. If the zip file on source is changed, is DSC going to detect that change and redownload file if I set "MatchSource = $true"? If it is, how can I make sure that corresponding xArchive is executed if new zip file is downloaded?

    Regards,
    Vojin

  • #55089

    Nitin Gupta
    Participant

    You can use 'Checksum' property of xArchive to achieve this. 'Checksum' supports the following: "SHA-1", "SHA-256", "SHA-512", "CreatedDate", "ModifiedDate"

    • #55090

      Vojin Lekovic
      Participant

      Didn't know there was Checksum for xArchive.
      Will try it right now.

      Thanks Nitin

      Vojin

    • #55092

      Vojin Lekovic
      Participant

      Tried... and it failed with "ModifiedDate". Looks like Validation is required


      PowerShell DSC resource MSFT_ArchiveResource failed to execute Test-TargetResource functionality with error message: Specifying a Checksum without requesting content validation (the Validate parameter) is not meaningful
      Parameter name: Checksum

  • #55097

    Vojin Lekovic
    Participant

    xArchive works, but xRemoteFile does not detect change...
    Basically what I need is to download file if it was changed on remote site....

  • #55099

    Nitin Gupta
    Participant

    You can't achieve that via xRemoteFile resource. You will have to write something custom for your scenario. Keep in mind that in order to figure out if something has changed on the remote site you either have to download the files every time and compare, or create a protocol that simplifies this process.

You must be logged in to reply to this topic.