Running a Python script from powershell

I’m trying to set up a build step to run a python script with parameters passed to it in powershell after it is deployed to the selected environment. I wrote a test script for powershell and was able to run it locally on my PC with no issues, however I’m having trouble implementing it in Octopus deploy.

I have included images of the test script and the output.

Outcome.JPG

I found a solution.
I needed to call the python script like so

$result = & “$python” “$PythonScript” “$var1”