2

I want the user to approve an action in the pre or post build event by requesting an user input - like 'y' or 'n'. Thereby the user can cancel the task if he forgot to switch the Configuration by mistake for example.

if $(ConfigurationName) == Release (
   //ask user to type in some text
)

Can someone provide me an example? Unfortunately, I couldn't find anything. If possible I would like to avoid calling another batch file. Thx in advance.

LM358
  • 141
  • 9

1 Answers1

3

Initiate your command in the build event command window with "start /wait".

Example:

start /wait powershell.exe -file $(ProjectDir)\UpdateAssemblyVersion.ps1 -configuration $(ConfigurationName)

Then you can request user input by using Read-Host.

Blobfisher
  • 86
  • 5