I have a script that generates PDF reports using a command line application.
Here's the script in batch form (dates are variables):
QsrCrExport.exe -f"C:\SMTP\Reports\Speed of Service Summary" -o"C:\SMTP\Daily_Archive\SpeedofService.pdf" -a"Date:%one%,%one%" -epdf
I'm trying to implement the above into Powershell using start-process with arguments but cannot seem to get the arguments to correctly work
$crexport = "C:\Program Files (x86)\ReportViewer\Bin\QsrCrExport.exe";
$arguments = '-f"C:\ProgramData\ReportViewer\Reports\Speed of Service Summary" -o"C:\SMTP\Generated\SpeedofService.pdf" -a"Date:$reportdate1,$reportdate2" -epdf'
Start-Process $crexport $arguments -Wait;
I know this won't work wrapped in single-quotes as the variables wont be replaced with the value, however if I remove all the double quotes within the arguments and wrap the whole line in double quotes it still won't work.
I'm pretty new to powershell so apologies if this is something really straight forward.