I have a script to undeploy my solution and I want to simply add a confirmation message. I found hundrets of blog entries, how to remove a confirmation via -confirm:$false parameter, but I find the opposite.

Something like this:

Write-Host "Are you shure that you want to remove the given solution (this can't be undone)?"

if (confirm() ) {
    Uninstall-SPSolution -Identity $wspIdentitySTR -confirm:$false

1 Answer 1


Pulled from some really old PS1 code

Doesn't this work anymore?

$ServerName = Read-Host -Prompt 'What is the server name?'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.