Private/Get-SqlSpnScenarioChoice.ps1
|
# ============================================================================= # Script : Get-SqlSpnScenarioChoice.ps1 # Author : Keith Ramsey # ============================================================================= # Change Log # ----------------------------------------------------------------------------- # 2026-05-09 Keith Ramsey Phase 2 release polish - DR-202 standard header applied. # 2026-05-21 Keith Ramsey DR-309 v1 surface narrowing: MSDTC choice removed # from the interactive picker. Picker now offers only # the three lab-proven scenarios. # ============================================================================= function Get-SqlSpnScenarioChoice { <# .SYNOPSIS Prompts the user to pick the SPN registration scenario. .DESCRIPTION Wraps PromptForChoice. Returns the index of the chosen scenario: 0 Standalone, 1 FCI, 2 AlwaysOn. (MSDTC removed in v1.4.0 per DR-309.) #> [CmdletBinding()] param() $choices = @( [System.Management.Automation.Host.ChoiceDescription]::new('&Standalone', 'Standard Instance: FQDN + Port') [System.Management.Automation.Host.ChoiceDescription]::new('&Clustered', 'FCI Instance: Virtual Name + Port') [System.Management.Automation.Host.ChoiceDescription]::new('&AlwaysOn', 'Availability Group: Listener Name') ) return $Host.UI.PromptForChoice('Scenario Selection', 'Pick the registration pattern:', $choices, 0) } |