I'm building out a powershell script that does quite a bit of work extracting csv's from a zip, converting OS->lat/lon, stuffing the contents robustly into a DB, and then emailing a distribution list with stats on the whole process.
Most of this is now complete, but to make the whole thing a little more portable I'm providing paths to input/working/output folders as parameters of the powershell call from a batch file.
This is all working fantatstically until I need to call python scripts to do the lat/lon work, as passing in the variable parameter paths doesn't seem to work with any permutation/combination.
The following is a simplified version of the python path within the .PS1 script which works from both command prompt and from within the .PS1 file if called directly (where -i -o are input/output path parameters).
c:\python27\python.exe D:\PythonPPC\subs.py -i D:\PPC\subs_export.csv -o D:\PPC\subs_export_lat_lon.csv
In my script I would like to replace the two path parameters -i/-o with variables something like:
c:\python27\python.exe D:\PythonPPC\subs.py -i $inputPathsubs_export.csv -o $outputPathsubs_export_lat_lon.csv
Does anyone have any idea on how to invoke this command as I've tried the &$exe method described on stack and a few other places, but this simply results in the error shown below:
CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
Any help would be greatly appreciated.