PowerShell powershell = PowerShell.Create();
PSCommand command = new PSCommand();
command.AddScript("[System.Net.ServicePointManager]::ServerCertificateValidationCallback+={$true}");
是吗?
下一步是什么?
答案 0 :(得分:6)
来自MSDN:
PSCommand command = new PSCommand();
command.AddScript(
"[System.Net.ServicePointManager]::ServerCertificateValidationCallback+={$true}"
);
PowerShell powershell = PowerShell.Create();
powershell.Commands = cmd;
var results = powershell.Invoke();