question

JeremyRunkles-3217 avatar image
0 Votes"
JeremyRunkles-3217 asked AllenLiu-MSFT commented

MDT Application install via PS script

I am trying to install an application with a powershell script using MDT. Below is what I have in the Quiet Install Command field.

powershell -ExecutionPolicy Bypass -noprofile -File \\server\folder\scripts\McAfee\AgentInstall.ps1

have tried it with " " around the location, with and without the .exe after the powershell. I keep getting the error code -196608.

I am using Management Console 3.0 version 20H2.

windows-server-powershellmem-mdt
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AllenLiu-MSFT avatar image
0 Votes"
AllenLiu-MSFT answered AllenLiu-MSFT commented

Hi, @JeremyRunkles-3217
Thank you for posting in Microsoft Q&A forum.
We may try to copy the file to the Scripts folder in the DeploymentShare folder, and then run command line:
powershell.exe -file "%ScriptRoot%\file-name.ps1"
In the Start in field indicate %ScriptRoot%

For the reference:
https://rdr-it.com/en/mdt-running-powershell-script-during-deployment/
(Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.)


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

This would work but I need it as an application install not in a task.

0 Votes 0 ·

Hi, @JeremyRunkles-3217
You may put your .ps1 file to the Application folder and try this:
powershell.exe -executionpolicy bypass -noprofile -noninteractive -file ".[yourscriptfile].ps1"

There main issue with just putting the ps1 file as the command is the executionpolicy, since the default is restricted.

You may refer to the last reply of the post:
https://serverfault.com/questions/610710/running-powershell-scripts-as-an-application-in-mdt-2013
(Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.)

0 Votes 0 ·
RichMatheisen-8856 avatar image
0 Votes"
RichMatheisen-8856 answered JeremyRunkles-3217 commented

That -196608 error converts to hex FFFD0000. I've seen that sometimes returned to mean "path not found".

If you run the script yourself does it work?

Is it safe to assume that this is an unattended install? If so, try adding "-noninteractive" to PowerShell's parameters.

If the AgentInstall.ps1 script from McAfee? You might try asking them how to go about running it from MDT.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for the info. If I run the application by itself through MDT it works but with its deploying it pops up the PS screen for a sec and then closes.

0 Votes 0 ·