Skip to content

Instantly share code, notes, and snippets.

@rollwagen
Last active May 11, 2023 23:29
Show Gist options
  • Save rollwagen/9afb5575ecad8866850456245f49982a to your computer and use it in GitHub Desktop.
Save rollwagen/9afb5575ecad8866850456245f49982a to your computer and use it in GitHub Desktop.
powershell snippets #powershell #upload
$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