Last active
May 11, 2023 23:29
-
-
Save rollwagen/9afb5575ecad8866850456245f49982a to your computer and use it in GitHub Desktop.
powershell snippets #powershell #upload
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
$sourceFilePath = "/etc/apt/archive" | |
$siteAddress = "https://file.io/?expires=1w" | |
$webClient = New-Object System.Net.WebClient | |
$response | |
try { | |
$response = $webClient.UploadFile($siteAddress,$sourceFilePath) | |
} catch { | |
Write-Host $_ | |
} | |
[System.Text.Encoding]::ASCII.GetString($response) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment