System.Net.WebClient

Aus Wiki-WebPerfect
Version vom 28. Juni 2018, 15:34 Uhr von Admin (Diskussion | Beiträge)

(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu: Navigation, Suche

Download from URL with "System.NET.WebClient"

$webclient = new-object System.Net.WebClient
#[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} #If certificate Selfsigned
$webclient.Credentials = new-object System.Net.NetworkCredential($username, $password)
$webpage = $webclient.DownloadString("<URL>")