/// <summary> /// Will deploy and execute provided PowerShell script on remote server. /// </summary> /// <param name="scriptFile"></param> /// <returns></returns> public static IOfferRemoteExecution PowerShell(this IOfferRemoteExecution execute, string command, Action<IOfferPowerShellOptions> powerShellOptions) { var options = new PowerShellOptions(); powerShellOptions(options); var operation = new RemotePowerShellHostOperation(command, options.Values); Configure.Operation(execute, operation); return execute; }
/// <summary> /// Will deploy and execute provided PowerShell script on remote server with provided options. /// </summary> /// <param name="scriptFile"></param> /// <param name="powerShellOptions"></param> /// <returns></returns> public static IOfferRemoteExecution PowerShell(this IOfferRemoteExecution execute, FileInfo scriptFile, Action<IOfferPowerShellOptions> powerShellOptions) { var options = new PowerShellOptions(); powerShellOptions(options); var operation = new RemotePowerShellHostOperation(scriptFile, options.Values); Configure.Operation(execute, operation); return execute; }
public RemotePowerShellHostOperation(FileInfo scriptFile, PowerShellOptions.PowerShellOptionValues values = null) { _scriptFile = scriptFile; _values = values; _commandType = CommandType.ScriptFile; }
public RemotePowerShellHostOperation(string cmd, PowerShellOptions.PowerShellOptionValues values = null) { _cmd = cmd; _values = values; _commandType = CommandType.CmdLine; }