Open
Description
Summary
I'd think Expand-Archive is one of the heavily used cmdlets in various installation scripts. But currently you still need to do a lot of unnecessary things like:
- save temp archive file
- remove temp archive
- [in some cases] move files from the root catalog to some other folder
- Also, it doesn't work with tarballs (big deal for linux)
I think we should make Expand-Archive to pull archive directly from url avoiding writing/removing stuff on your disc. I guess that is not that hard to build some custom cmdlet, but I believe this should come out of the box, so installation script can rely on it.
Example:
I need nodejs binaries in my project. I want to put this in "node" subfolder (but not in something like node-v10.16.3-linux-x64 ). In bash this could be achived this way:
mkdir ./node
wget -qO- https://nodejs.org/dist/v10.16.3/node-v10.16.3-linux-x64.tar.xz | tar --transform 's/^dbt2-0.37.50.3/dbt2/' -xvz -C ./node --strip=1
Desired powershell functionality:
$url = https://nodejs.org/dist/v10.16.3/node-v10.16.3-linux-x64.tar.gz
Expand-Archive -Uri $url -type targz -Destination ./node -Strip -Force -Verbose
I think many other core cmdlets with -Path parameter would benefit from such thing too. Maybe we can make Path to understand paths with http:// prefix.