System.Net.WebClient: Unterschied zwischen den Versionen
Aus Wiki-WebPerfect
Admin (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „== Download from URL with "System.NET.WebClient" == <source lang="powershell"> $webclient = new-object System.Net.WebClient #[System.Net.ServicePointManager]::…“) |
Admin (Diskussion | Beiträge) |
||
Zeile 2: | Zeile 2: | ||
<source lang="powershell"> | <source lang="powershell"> | ||
$webclient = new-object System.Net.WebClient | $webclient = new-object System.Net.WebClient | ||
− | #[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} #If | + | #If certificate Selfsigned |
− | $webclient.Credentials = new-object System.Net.NetworkCredential($username, $password) | + | #[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} |
+ | #If WebRequest need a User authentication | ||
+ | #$webclient.Credentials = new-object System.Net.NetworkCredential($username, $password) | ||
$webpage = $webclient.DownloadString("<URL>") | $webpage = $webclient.DownloadString("<URL>") | ||
</source> | </source> |
Aktuelle Version vom 28. Juni 2018, 15:40 Uhr
Download from URL with "System.NET.WebClient"
$webclient = new-object System.Net.WebClient #If certificate Selfsigned #[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} #If WebRequest need a User authentication #$webclient.Credentials = new-object System.Net.NetworkCredential($username, $password) $webpage = $webclient.DownloadString("<URL>")