PowerShell powershell = PowerShell.Create();
PSCommand command = new PSCommand();
command.AddScript("[System.Net.ServicePointManager]::ServerCertificateValidationCallback+={$true}");
Is that right?
What's the next step?
From MSDN:
PSCommand command = new PSCommand();
command.AddScript(
"[System.Net.ServicePointManager]::ServerCertificateValidationCallback+={$true}"
);
PowerShell powershell = PowerShell.Create();
powershell.Commands = cmd;
var results = powershell.Invoke();
powershell.Commands = cmd; be powershell.Commands = command; ?
powershell.Invoke()after you've done what Coincoin suggests.