Created
September 4, 2023 07:10
-
-
Save wincmd64/d0ae088af570fcea17f5272a5c709242 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download from link in clipboard preserving timestamp | |
$clip = (Get-Clipboard) | |
Write-Host URL: $clip | |
try { (Invoke-WebRequest $clip -Method Head).Headers.'Last-Modified' } catch { Write-Warning "Last-Modified error" } | |
try { (Invoke-WebRequest $clip -Method Head).Headers.'Content-Length'/1mb } catch { Write-Warning "Content-Length error" } | |
Write-Host `n"DOWNLOAD?" -ForegroundColor Green | |
pause | |
Start-BitsTransfer -Source $clip -Destination (New-Object -ComObject Shell.Application).NameSpace('shell:Downloads').Self.Path |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment