We all know how annoying it is working somewhere with a proxy server that requires authentication, especially as Microsoft increasingly don’t support the scenario with many of their Azure-related tools. However, it is quite possible to use authenticated proxies with .NET applications including Powershell.

For the former, edit the application .config file and add

<defaultProxy useDefaultCredentials="true" />

And for Powershell, add the following to your scripts or $profile

$proxyString = "http://proxy:8080"
$proxyUri = new-object System.Uri($proxyString)
[System.Net.WebRequest]::DefaultWebProxy = new-object System.Net.WebProxy ($proxyUri, $true)
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials

If, like me, you manage hundreds of Desktops and Servers, sooner or later you’re going to come across one with a completely broken .NET install that no amount of uninstalling, reinstalling, patching and fiddling will fix properly.

If this sounds familiar, then what you need is the .NET Framework Cleanup Tool, written by Aaron Stebner, formerly of Microsoft’s Developer Division setup team.

It will strip out any installable version of the .NET framework upto and including 4.x and, so far at least, it has always managed to fix my broken installs.

Usual caveats apply, see the original blog post for more details.