DMT Powershell - $Pass is not taking all characters

Hello I am trying to create a powershell script with DMT but it seems that it is not taking all of my characters for $Pass. I have this below:

#DMT Automation Example 1

$DMTPath = “C:\Epicor\ICE3.2.500.0ClientTEST\Client\DMT.exe”
$User = “admin”
$Pass = “adminDMT”
$Source = “C:\Users\ale\Documents\DMT\CustomerDMT.csv”

#Load Data
Start-Process -Wait -FilePath $DMTPath -ArgumentList "-User $User -Pass $Pass -Delete -Import Part -Source $Source "

As you can see I have 8 characters for the password but when I run the script only 5 characters gets pulled. Has anyone had this issue before?

I think you want to change how the PW is pulled in, this is the last command line DMT stuff that I did:

SET /P PW=Enter password 

echo %PW%

start C:\Mine\Client\DMT.exe -User=NATHAN-Pass=%PW% -Export -BAQ="BAQName" -Target="C:\target.csv" -NoUI -UseFieldNames

I’ll give this a try and get back to you if this worked.

I ran your script as written, except I added Write-Host to the front of the command,
so I could see what Powershell parsed.

#DMT Automation Example 1

$DMTPath = “C:\Epicor\ICE3.2.500.0ClientTEST\Client\DMT.exe”
$User = “admin”
$Pass = “adminDMT”
$Source = “C:\Users\ale\Documents\DMT\CustomerDMT.csv”

#Load Data
Write-Host Start-Process -Wait -FilePath $DMTPath -ArgumentList "-User $User -Pass $Pass -Delete -Import Part -Source $Source "

The output was:

Start-Process -Wait -FilePath C:\Epicor\ICE3.2.500.0ClientTEST\Client\DMT.exe -ArgumentList -User admin -Pass adminDMT -Delete -Import Part -Source C:\Users\ale\Documents\DMT\CustomerDMT.csv

Not sure if it helps, but it looks like it is getting and parsing the pw correctly on my pc.

Do you need parentheses in your final command?
If you do, you need to create them like $Variable = “”“Your Data”“”

Hi all, I figured out the issue. My password had a “$” in it and it was not picking up with " " so I used ’ ’ instead and it is now working fine.

1 Like

Just to be clear, you used single quotes on the line that set the $Pass variable, like:

$DMTPath = "C:\Epicor\ICE3.2.500.0ClientTEST\Client\DMT.exe"
$User = "admin"
$Pass = 'admin$DMT'

(I added a $ to your password for visual effects)

Or on the line with the Start-Process ?

I used single quotes on the line that set the $Pass variable, exactly like how you have it. I only figured this out when I used the Write-Host to see what it was outputting and noticed that it was dropping the “$” and anything after it.

2 Likes