I am implementing a tool to address software installs for Work from Home staff, and trying to download ZIP files containing either a folder that is an Autodesk "deployment" or a single EXE or MSI update file. The folder containing ZIP is unzipping fine with
[IO.Compression.ZipFile]::ExtractToDirectory($downloadFilePath, $deploymentPath)
However, the ZIP files that contain nothing but a single file are throwing
System.Management.Automation.MethodInvocationException
Exception calling "ExtractToDirectory" with "2" argument(s): "The archive entry was compressed using an unsupported compression method."
using
[IO.Compression.ZipFile]::ExtractToDirectory($downloadFilePath, $deploymentPath)
I also tried Expand-Archive -Path $downloadFilePath -DestinationPath $deploymentPath
and there I get a similar error
System.Management.Automation.MethodInvocationException
Exception calling "ExtractToFile" with "3" argument(s): "The archive entry was compressed using an unsupported compression method."
But oddly, I am not using three arguments. Also note that both approaches work with the zip of a folder, while neither approach works with the zip of a file.
All ZIP files have been created with Right Click>Send to>Compressed (zipped) folder
, highlighting either the deployment folder or the file to be zipped. And the problem ZIP file works fine to extract manually.
Any thoughts?