I\'m trying to get Powershell to run my PS script in post built - but somehow it doesn\'t work like it\'s supposed to:
Following command in Post-Build:
add cmd-file (e.g. run-script.cmd) with this content:
@echo off set pspath=%windir%\Sysnative\WindowsPowerShell\v1.0 if not exist %pspath%\powershell.exe set pspath=%windir%\System32\WindowsPowerShell\v1.0 %pspath%\powershell.exe -ExecutionPolicy RemoteSigned %*
and call it from build event in a such manner:
$(SolutionDir)scripts\run-script.cmd $(SolutionDir)scripts\restore-default-file.ps1 -source $(ProjectDir)App_Data\Configs\Mip.Security.Sample.config -destination $(ProjectDir)App_Data\Configs\Mip.Security.config