$caption = "TITLE" $message = "MESSAGE" $yes = new-Object System.Management.Automation.Host.ChoiceDescription "&Yes","HELP_FOR_YES" $no = new-Object System.Management.Automation.Host.ChoiceDescription "&No","HELP_FOR_NO" $choices = [System.Management.Automation.Host.ChoiceDescription[]]($yes,$no) $answer = $host.ui.PromptForChoice($caption,$message,$choices,0) if($answer -eq 0){ //YOUR_CODE_IF_YES }
Error An unhandled exception of type ‘System.PlatformNotSupportedException’ occurred in Microsoft.SharePoint.dll Additional information: Microsoft SharePoint is not supported in 32-bit process. Please verify that you are running in a 64-bit executable. […]