So, I have a Powershell script that downloads files, e.g.
$mech = new-object System.Net.WebClient
$mech.DownloadFile('http://www.example.com/folder./index.html', 'out.html')
Note the trailing dot here ^
which does not work (gives a 404), looking at the actual request sent, it turns out the trailing dot gets taken out which seems to originate from this bug: https://connect.microsoft.com/VisualStudio/feedback/details/386695/
This seems to be fixed in some versions of .Net but Powershell does not use these versions (I'm using PS2.0 in Win7 which uses .Net 2.0.50727.5472, also tried in PS3.0 which uses .Net 4.0.30319.17929, both are not patched note .Net 4.5.something is installed)
So, this might be a simple question but, there is a workaround listed in the above link, how would I apply this in Powershell?
Alternatively, how do I get Powershell to use a patched version of .Net (and which versions are patched?)
I would prefer to not resort to using external programs such as wget otherwise I might as well not write this in Powershell, however if I must, it needs to support UTF8 in the url
Also, the server is not happy with the . replaced with %2e