Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public string GetCmDOutput(string cmd)
- ProcessStartInfo startInfo = new ProcessStartInfo("control", cmd)
- {
- WindowStyle = ProcessWindowStyle.Hidden,
- UseShellExecute = false,
- RedirectStandardOutput = true,
- CreateNoWindow = true
- };
- string output = string.Empty;
- Process process = Process.Start(startInfo);
- process.OutputDataReceived += (sender, e) => output = string.Concat(output, e.Data);
- process.BeginOutputReadLine();
- process.Start();
- process.WaitForExit();
- Delay.Milliseconds(1500) //API-specific delay
- return output;
- }
- string cmd = @"psexec.exe \remoteComputerName -u username -p password -c cmd /c wmic qfe";
- GetCmdOutput(cmd);
- Report.Info(cmd); //API-specific reporting
- <Exec IgnoreExitCode="True"
- Command="$(PSToolsPath)PsExec.exe \%(RemoteSereverIP) -u $(Username) -p $(UserPassword) -w $(ReleaseAssetsBasePath)BuildCommands msbuild Build.xml /t:switchwebsites /p:Releaseversion=$(Releaseversion);" >
- </Exec>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement