Skip to content

Inconsistent uncompressing of ZIP files as resources #420

@Rokory

Description

@Rokory

I have a resource like this:

@{
    ID = 'Solutions'
    Uri = 'https://somedownloadlink'
    Filename = 'Solutions.zip'
    Expand = $true
    DestinationPath = '\LabResources'
}

The ZIP file contains a single folder called 'Solutions' with approx. 40 files.

When I run the configuration on Windows 11, the VMs receiving that resource end up with a folder c:\LabResources\Solutions containing the files from the ZIP file.

When I run that same configuration on Windows Server 2022, the VMs receiving the resource end up with a folder c:\LabResources containing the files from the ZIP file. The folder Solutions is omitted.

When I change the Destination Path to \LabResource\Solutions, on Windows 11, I get c:\LabResources\Solutions\Solutions, on Windows Server 2022, I get c:\LabResources\Solutions.

I cannot figure out, why this is not running consistently. Moreover, I question, why the script uses complicated calls to the .NET Framework instead of simply using Expand-Archive, which works consistently on both platforms.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions