VirtualEngine / Lability

Virtual Engine test lab deployment and configuration module
MIT License
282 stars 50 forks source link

Inconsistent uncompressing of ZIP files as resources #420

Open Rokory opened 1 year ago

Rokory commented 1 year ago

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.