public RemotePowershellSession(ILogger logger, string targetServer, PowershellConnectionType connectionType, bool useSSL, Func <string, bool> shouldInvokePowershellCommand) { this.logger = logger; this.targetServer = targetServer; this.connectionType = connectionType; this.useSSL = useSSL; this.shouldInvokePowershellCommand = shouldInvokePowershellCommand; }
public RemotePowershellSession(string targetServer, PowershellConnectionType connectionType, bool useSSL, ILogger logger) { this.targetServer = targetServer; this.connectionType = connectionType; this.useSSL = useSSL; if (logger == null) { throw new ArgumentNullException(); } this.logger = logger; }
public PowerShellCommonSession(ILogger logger, string targetServer, PowershellConnectionType connectionType, PSCredential credentials) { this.RemotePowershellSession = new RemotePowershellSession(logger, targetServer, connectionType, true, new Func <string, bool>(this.ShouldInvokePowershellCommandHandler)); this.RemotePowershellSession.Connect(credentials, Thread.CurrentThread.CurrentUICulture); }