System.Net.WebClient

Aus Wiki-WebPerfect
Wechseln zu: Navigation, Suche

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>")