Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
REM This is intended to be run only via the self-extracting zip exe created by build.
REM It copies extracted files to a known location in the event of an error, re-deploy, logging output etc.
REM It then hands off the real work to PowerShell for the deployment
@echo off
mode con cols=120
echo You are here: %~dp0
echo Copying extracted files to a known location
set targetDir=%userprofile%\Desktop\MyApp.Install
if exist %targetDir% rmdir /s /q %targetDir%
xcopy /s /i /r *.* %targetDir%
set deployScript="%targetDir%\deployPackage\Deploy.ps1"
echo Starting powershell to run the script %deployScript%
start powershell -file "%deployScript%" -WindowStyle Maximized
REM Below works but it results in powershell running in cmd.exe window, not powershell window host
REM powershell -file "%deployScript%"
REM pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment