Executing PS1 File via .BAT

Hello Together,

AM trying to execute the PS1 file created via App Deployment Toolkit and i face issue with Execute-MSI function.

Could someone please let me know if you face the any similar issue.

Thanks in Advance

I created an “Install.bat” and an “Uninstall.bat” to do just that.
See my script below.

Install.bat

@ECHO OFF
SET ThisScriptsDirectory=%~dp0
SET PowerShellScriptPath=%ThisScriptsDirectory%Deploy-Application.ps1
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File """"%PowerShellScriptPath%"""" -DeploymentType """"Install""""  ' -Verb RunAs}";

Uninstall.bat

@ECHO OFF
SET ThisScriptsDirectory=%~dp0
SET PowerShellScriptPath=%ThisScriptsDirectory%Deploy-Application.ps1
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File """"%PowerShellScriptPath%"""" -DeploymentType """"Uninstall""""  ' -Verb RunAs}";

I pasted the two batch scripts in my AppDeployToolkit root directory and make them a part of each deployment project I create.

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