Baq with parameters in DMT

Guys have anybody run in powershell baq with parameters using powershell i have this code but it is not working any idea

Start-Process -Wait -FilePath $DMTPath -ArgumentList "-User $User -Pass $Pass -Export -ChangeCompany=CMP -BAQ GelLastHeadNum -Parameters $ordernum -Target $Source -NoUI -ConfigValue=Epicor10Live "
Write-Output "Loading Data $(get-date) " $Source

If you can provide error messages or expected/unexpected behaviors then you will get a better response from the group.

the problem is that is loading DMT bit it is not passing the parameters so i move the whole thing so rest and it is working now but thanks for the tip

Double check the proper way to use string variables in powershell. It might not be expanding the argument list the way you think it is.

For example, the following has variables $reportdate1 and $reportdate2 But see how the -a parameter (including the -a is in single quotes, with the actual parameter’s values in the double quotes.

-ArgumentList @('-f"C:\ProgramData\ReportViewer\Reports\Speed of Service Summary"', '-o"C:\SMTP\Generated\SpeedofService.pdf"', '-a"Date:$reportdate1,$reportdate2"', '-epdf') -wait

There are many ways tp skin this cat. But the way powershell expands those strings into other strings can get quite messy.

edit

To provide a bit more clarity on the above…

That argument list has 4 parameters

-f"C:\ProgramData\ReportViewer\Reports\Speed of Service Summary"
-o"C:\SMTP\Generated\SpeedofService.pdf"
-a"Date:$reportdate1,$reportdate2"
-epdf'

and each of those is enclosed in single quotes, like:
'f"C:\ProgramData\ReportViewer\Reports\Speed of Service Summary"'
with commas separating each single quoted parameter

1 Like