I ran cmd as administrator and input: start powershell
when open the powershell, I input: $client = new-object System.Net.WebClient $client.DownloadFile("https://www.cse.ust.hk/msbd5003/data/fruits.txt","D:\IT\fruits.txt")
here is the error information: Exception calling "DownloadFile" with "2" argument(s): "The underlying connection was closed: An unexpected error occurred on a send." At line:1 char:1
- $client.DownloadFile("https://www.cse.ust.hk/msbd5003/data/fruits.txt ...
-
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : WebException
I tried adding " $ client.Credentials = Get-Credential" while it did not work. How can i fix this?