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.