February 2019
Intermediate to advanced
626 pages
15h 51m
English
The ServerCertificateValidationCallback property of ServicePointManager does not work as expected in PowerShell Core. Attempts to assign and use a script block may result in an error being displayed, as shown here, when making a web request:
PS> [System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $true }PS> [System.Net.WebClient]::new().DownloadString('https://expired.badssl.com/')Exception calling "DownloadString" with "1" argument(s): "The SSL connection could not be established, see inner exception. There is no Runspace available to run scripts in this thread. You can provide one in the DefaultRunspace property of the System.Management.Automation.Runspaces.Runspace type. The script block you attempted ...Read now
Unlock full access