0

I am trying to write a python script which will run a run.ps1 PowerShell script. The run.ps1 file is located in different location entirely so I will need to cd into that folder then run the script. In Windows power shell I just need to cd into the file directory then run ./run.ps1. I am trying to simulate that process in Python.

So far I have got:

import subprocess 
subprocess.run("C:/..pathtofile/run.ps1")

This opens up that script in notepad. I want to actually run the script like I would in the terminal.

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.