Powershell fun
February 21, 2020 —
~level3
Turns out powershell has different streams for different things. Capture them all with this one trick
https://stackoverflow.com/a/44808718
archiving at https://archive.md/7eNnv https://outline.com/rms4SH
While ($True) {
date | Out-File -Append "output.txt";
$output = try
{
Invoke-WebRequest
-Uri "https://www.google.com"
-UseDefaultCredentials
-AllowUnencryptedAuthentication
*>&1
}
catch
{
$_
};
$output | Out-File -Append "output.txt";
Start-Sleep 30;
}
tags: windows, powershell, programming, shitpost