Private/Get-SqlSpnSourceChoice.ps1
|
# ============================================================================= # Script : Get-SqlSpnSourceChoice.ps1 # Author : Keith Ramsey # ============================================================================= # Change Log # ----------------------------------------------------------------------------- # 2026-05-09 Keith Ramsey Phase 2 release polish - DR-202 standard header applied. # ============================================================================= function Get-SqlSpnSourceChoice { <# .SYNOPSIS Prompts the user to choose between discovered services and the standard pool. .DESCRIPTION Wraps PromptForChoice in a function so Pester can mock the prompt. Direct $Host.UI.* calls cannot be mocked; only function/cmdlet calls can. #> [CmdletBinding()] param() $choices = @( [System.Management.Automation.Host.ChoiceDescription]::new('&Discovered', 'Scan local registry / services.') [System.Management.Automation.Host.ChoiceDescription]::new('&StandardPool', 'Pick from pre-defined roles.') ) return $Host.UI.PromptForChoice( 'Account Source Selection', 'Manage accounts running on this server, or pick from the Standard Pool?', $choices, 0) } |