PowerShell powershell = PowerShell.Create(); PSCommand command = new PSCommand(); command.AddScript("[System.Net.ServicePointManager]::ServerCertificateValidationCallback+={$true}");
Это верно? Какой следующий шаг?
С MSDN :
PSCommand command = new PSCommand(); command.AddScript( "[System.Net.ServicePointManager]::ServerCertificateValidationCallback+={$true}" ); PowerShell powershell = PowerShell.Create(); powershell.Commands = cmd; var results = powershell.Invoke();