0

Looking for help with passing python variables into powershell.

Using the subprocess.call method to open powershell and run a powershell script that echos the variables from python I receive a not recognized error . Any help would be greatly appreciated.

Example python code:

row = ['hello' , 'world']
first = row[0]
second = row[1]
subprocess.call(["C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\powershell.exe",
". \"./testShell2\";", "&variables(first, second)"])

Example powershell:

ECHO $first
ECHO $second

Error recieved

The term 'first' is not recognized as the name of a cmdlet, function, script file, or operable program.

glwallum
  • 43
  • 7

1 Answers1

0

Ended up using python instead of powershell to complete project. Thank you

glwallum
  • 43
  • 7