0

First, I'm fairly new to this roll, and it's likely that this has been answered, but that I do not understand the information.

I have a ps1 file that I want to run on Server A. The script in the PS1 file connects to Server B and runs a Schedule Task. I'm able to verify this part works by calling up the PS1 file from command prompt on Server A.

I have a an Automated Test written with c#, and I need to add code to the test that will run the PS1 file. Is someone able to assist with this and break it down to beginner format?

  • 2
    Have you looked into [Process.Start()](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.start?view=netframework-4.7.2)? – Jaskier Oct 31 '18 at 16:53
  • 1
    These may also be helpful: [Call a Powershell Script](https://stackoverflow.com/questions/20195392/to-call-a-powershell-script-file-example-ps1-from-c-sharp) and [Execute Powershell Script](https://stackoverflow.com/questions/527513/execute-powershell-script-from-c-sharp-with-commandline-arguments) – Jaskier Oct 31 '18 at 17:03
  • 2
    Possible duplicate of [To call a powershell script file (example.ps1) from C#](https://stackoverflow.com/questions/20195392/to-call-a-powershell-script-file-example-ps1-from-c-sharp) – JohnLBevan Oct 31 '18 at 17:12

0 Answers0