/// <summary> /// Will execute a PowerShell command on remote server with provided options. /// </summary> /// <param name="command"></param> /// <param name="powerShellOptions"></param> /// <returns></returns> public static IOfferRemoteExecution PowerShell(this IOfferRemoteExecution execute, FileInfo scriptFile) { var psProvider = new RemotePowerShellHostOperation(scriptFile); Configure.Operation(execute, psProvider); return(execute); }
/// <summary> /// Will execute a PowerShell command on remote server. /// </summary> /// <param name="command"></param> /// <returns></returns> public static IOfferRemoteExecution PowerShell(this IOfferRemoteExecution execute, string command) { var psProvider = new RemotePowerShellHostOperation(command); Configure.Operation(execute, psProvider); 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); }
/// <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); }