Give Users Ability to Open URL

i would like the ability for the user to be able to open a URL directly from one of the prompts/dialogs. I was thinking of either the URL directly in the prompt/dialog message or a button they can click on which opens the URL.

You could put this on a response button; I’ve never tried putting a link in the prompts themselves.

$PromptResponse = Show-InstallationPrompt ""
if ($PromptResponse -eq 'Yes I want to go to URL' ) {
   Start-Process firefox.exe www.google.com
   Start-Process iexplore.exe www.google.com
   Start-Process chrome.exe www.google.com
   Start-Process microsoft-edge:www.google.com 
   #note that UWP apps like Edge open differently!
}

Note that clicking the button would dismiss the prompt; if you want the button to be only for the URL opening, and need to capture a different response to move forward in the deployment, you can simply call the prompt again.

$PromptResponse = Show-InstallationPrompt ""
if ($PromptResponse -eq 'Yes I want to go to URL' ) {
  Start-Process firefox.exe www.google.com
  Start-Process iexplore.exe www.google.com
  Start-Process chrome.exe www.google.com
  Start-Process microsoft-edge:www.google.com
  $PromptResponse = 'again'
}
1 Like

thanks for the info! very helpful! is there a way to integrate this into the show-installationwelcome for deferrals. i didn’t see an easy way to do so. so i may have to prompt the user with the deferral window and then this prompt to go to the url.

Is there a way? Absolutely. Your best bet would be to make your own function using Show-InstallationWelcome as a template, and incorporating the buttons from Show-InstallationPrompt. You could edit the inbox function if you wanted to, but this would cause problems with code updates in the future.

My advice is to just give the user both prompts.