I try to run a PowerShell script using Exec()
preprocessor function, but I need to pass two arguments to it. How can I do that? The following snippet doesn't work.
#define PSScript SourcePath + "\\UpdateJson.ps1"
#define ConfigPath SourcePath + "\\ClientConfig.json"
#expr Exec("PowerShell -NoProfile -ExecutionPolicy Bypass -File {#PSScript} {#ConfigPath} Str({#BuildNumber})")
Thanks!
Use +
operator, the same way you are already using it in your PSScript
and ConfigPath
declarations.
Additionally, the Exec
function needs the arguments separately.
*Other things:
#define PSScript SourcePath + "\UpdateJson.ps1"
#define ConfigPath SourcePath + "\ClientConfig.json"
#expr Exec("PowerShell", \
"-NoProfile -ExecutionPolicy Bypass -File """ + PSScript + """ " + \
"""" + ConfigPath + """ " + Str(BuildNumber))