Skip to content

Instantly share code, notes, and snippets.

@thnk2wn
Last active June 20, 2017 01:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thnk2wn/e476bcf8df2b57c03f2f960dfbbe8bde to your computer and use it in GitHub Desktop.
Save thnk2wn/e476bcf8df2b57c03f2f960dfbbe8bde to your computer and use it in GitHub Desktop.
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