Author Posts

August 19, 2014 at 5:05 am

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.


August 19, 2014 at 7:44 am

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

August 19, 2014 at 8:32 am

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.

August 19, 2014 at 3:17 pm

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

August 19, 2014 at 3:42 pm

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

August 20, 2014 at 6:53 am

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

August 20, 2014 at 4:00 pm

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.