How to Use -confirm in PowerShell

后端 未结 10 1424
遥遥无期
遥遥无期 2020-12-07 20:10

I\'m trying to take user input and before proceeding I would like get a message on screen and than a confirmation, whether user wants to proceed or not. I\'m using the follo

10条回答
  •  臣服心动
    2020-12-07 20:41

    I prefer a popup.

    $shell = new-object -comobject "WScript.Shell"
    $choice = $shell.popup("Insert question here",0,"Popup window title",4+32)
    

    If $choice equals 6, the answer was Yes If $choice equals 7, the answer was No

提交回复
热议问题