checking confirm action removing computers from AD

by morochi at 2013-02-19 14:46:06

I have a script that deletes computers from AD using remove-adcomputer, and create a log with the name of the machine and time when the machine was deleted. The problem I have is that I want to add an entry to the
log only when the user click yes in the confirm message box when running the script in the Powershell ISE or enter Y in the confirm message in the shell. If the user change his mind and click no, then I dont want to enter an entry
in the blog. My question is how you check if the user click on confirm and use and if else statement for this.
by AlexBrassington at 2013-02-19 23:23:32
It sounds like you want something like this: http://technet.microsoft.com/en-us/maga … 77563.aspx