Multiple Archive resources

Tagged: 

This topic contains 6 replies, has 3 voices, and was last updated by Profile photo of David Gardiner David Gardiner 2 years, 3 months ago.

  • Author
    Posts
  • #18126
    Profile photo of David Gardiner
    David Gardiner
    Participant

    I've got a DSC Configuration that uses two Archive resources.

    the problem is that it appears the Archive resource is caching the destination path from the first resource, and using that for the second resource (resulting in an error).

    I'm assuming I'm doing something wrong, but I do think it's curious that the source code for MSFT_ArchiveResource does seem to have a cache, and I'm wondering if the hash logic for the cache is getting confused somehow.

    -david

  • #18147
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator

    Are you unzipping the same archive to two different locations, or are these separate zip files?

  • #18152
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator

    I've been looking at the source code for the Archive resource. There is some caching behavior, but nothing that should be changing your destination argument, so far as I can tell. The cache is mainly there so DSC doesn't have to download and process the zip file every single time it checks your configuration (unless the source's last modified date attribute has changed.)

    In order to troubleshoot further, I'd probably have to see the Archive resource lines from your configuration script, and any error messages that you're getting.

  • #18168
    Profile photo of David Gardiner
    David Gardiner
    Participant

    Two different .zip files being unzipped to two different locations under a common directory. I'll see if i can create a simplified example.

  • #18169
    Profile photo of David Gardiner
    David Gardiner
    Participant

    Interesting – the second zip contains some sub-directories. It was created with 7Zip, and after editing the .zip by removing the subdirectories and then re-adding them it now works – so maybe it has something to do with how the .zip is formatted

  • #18187
    Profile photo of JasonMorgan
    JasonMorgan
    Member

    That's pretty interesting, I found that if I created archives with 7zip that the archive resource would fail to unpack them.

  • #18203
    Profile photo of David Gardiner
    David Gardiner
    Participant

    Further experimenting and if I create the .zip files so that they contain a directory as the root object, then they extract fine (eg. there are no files at the top level inside the zip).

    It's working, but there's definitely something unusual that happens sometimes – hard to know if it's 7zip or the Archive resource which is the culprit.

You must be logged in to reply to this topic.