I am on version 10.1.500.14, DMT Version 4.0.17.0.
We are trying to automate the DMT Process to bring in parts from our legacy system to Epicor 10. I see in the DMT Tool that there is a way to automate this process using powershell. The issue I am running into is when DMT launches from powershell it uses Environment = default and the ConnectionURL which is also default. I was wondering if anyone has a document showing all the options I can use in a DMT automation script, or if there is a way to change the Environment and ConnectionURLs.
Hi
Use -ConfigValue parameter to specify the sys config file.
Graeme
Hi Joe,
I don’t have a full list but this is what I used. I put my variables in a file:
$basePath = Get-Location
$logPath = “$basePath” + “\log”
$DataPath = “$basePath” + “\Data”
$logFile = “$logPath” + “\LoadLog_” + $(Get-Date -Uformat “%Y%m%d%H%M%S”) + “.txt”
$DMTPath = “E:\Epicor\ERP10.0Client\Client\DMT.exe”
$User = “MANAGER”
$EpicorConfig = “ERP10”
(The EpicorConfig variables uses the same environment name you would see in your DMT drop down when logging in via the GUI)
Then I import these variables into my scripts:
Load Session Variables
…\Scripts\SessionVars.ps1
And then execute DMT like this
Start-Process -Wait -FilePath $DMTPath -ArgumentList "-User $User -Pass $Password -ConfigValue=$EpicorConfig -NoUI -Add=true -Update=true -Import "Asset Group
" -Source $Source "
Note you need the spaces in the Import statement (in this case “Asset Group” and you use the back-tick to escape the quotes.
Finally, if you don’t want to code your password in your scripts but want to prompt for it:
Prompt for password for session
$Password = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecurePassword))
Hope that helps,
Mark W.
3 Likes
Fantastic Mark! This is exactly what I was looking for.
Thanks a ton
This is the part I needed! Thank you much!
tse.dba
(Andrew Koemm)
January 26, 2018, 9:26pm
6
Can you elaborate on this. I cannot figure this out. Do you have an example. Thanks!
Note you need the spaces in the Import statement (in this case “Asset Group” and you use the back-tick to escape the quotes.
In my example, I forgot the back-ticks to escape the quote marks around the input name which has embedded spaces:
Start-Process -Wait -FilePath $DMTPath -ArgumentList “-User $User -Pass $Password -ConfigValue=$EpicorConfig -NoUI -Add=true -Update=true -Import "Asset Group
” -Source $Source "
Mark W.
1 Like
Turns out I DIDN’T miss the backticks, the forum software is filtering them out!
`"Asset Group`"
Mark W.
2 Likes