Execute-process with PIDKEY

Hello Experts,

As a newcomer to the AppDeployment Toolkit, I am having difficulty locating information on how to include the PIDKEY parameter. I have successfully executed the following command in the command prompt.

SetupDstmp.exe /s -a /quiet PIDKEY=PAXXXXX-XXXX-XXXX ALLUSER=2 /l “%Windir%\Logs\SetupDstmp_log_4July.txt”

Thanks guys!!

This will likely be the way you construct the quotes around the parameters as the PowerShell command

Your Install command in PSADT will probably need to look like this:

Execute-Process -Path "$($dirFiles)\SetupDstmp.exe" -Parameters "/s -a /quiet PIDKEY=PAXXXXX-XXXX-XXXX ALLUSER=2 /l `"$($envWinDir)\Logs\SetupDstmp_log_4July.txt`""

Note the backtick ` before each of the double quotes surrounding the path to your log file, this is to escape the extra double quotes, so the Execute-Process command will work seamlessly

  • The $dirFiles parameter is native to PSADT and points to the \Files\ path within PSADT
    (See: Variables · PSAppDeployToolkit)
  • The $envWinDir parameter is a PSADT native environment variable that points to the Windows Directory
    N.B. This is different from the native PowerShell command $env:windir
    (See: Variables · PSAppDeployToolkit)
2 Likes

Thank you @Adrian_Scott for your quick response! Appreciate it. I will test it out ok~

1 Like

@Adrian_Scott , truely the experts here!

thanks… its work like magic…

1 Like

why the $ before the ($dirfiles) ?

why the $ before the ($dirfiles) ?

Because, if the path to $dirfiles contains a space, it may not give you the resultant path you are expecting.
I tend to put variables within $() for all variables output within double quotes to ensure the full content of the variable is output correctly

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.