Running PowerShell scripts as an Application in MDT 2013

I don't know about MDT, but running UNC-located PowerShell scripts from the commandline goes something like powershell -ExecutionPolicy bypass -file \\path\to\file.ps1.
It works from cmd (without any security prompts):

Running UNC-based PowerShell scripts from commandline


in the 'quiet install command' of your application:

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. Even changing executionpolicy to remotesigned the script will not run because it's a UNC path.