Reputation: 3052
I've tried a simple:
wget https://www.dropbox.com/sh/dropboxStuff/dropboxStuff?dl=1 -O DirectoryName
But it's downloading a zip file.
Upvotes: 2
Views: 3275
Reputation: 28174
To do this in one line with PowerShell 5's Expand-Archive
cmdlet:
Invoke-WebRequest -Uri https://www.dropbox.com/sh/dropboxStuff/dropboxStuff?dl=1 -O temp.zip; Get-Item temp.zip | Expand-Archive -DestinationPath "FolderName"; Remove-Item temp.zip
You may be able to do it by piping Invoke-WebRequest
to Expand-Archive
with -PassThru
but I haven't been able to make it work yet.
Upvotes: 2
Reputation: 841
In Powershell v5
Expand-Archive c:\a.zip -DestinationPath c:\a
To know your PS vesion
$PSVersionTable.PSVersion
If you don't have PS v5
Add-Type -AssemblyName System.IO.Compression.FileSystem
function Unzip
{
param([string]$zipfile, [string]$outpath)
[System.IO.Compression.ZipFile]::ExtractToDirectory($zipfile, $outpath)
}
Unzip "C:\a.zip" "C:\a"
Source: This Question
Upvotes: 3