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;
 }
示例#3
0
 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);
 }