Public/Application/Get-DefaultBrowser.ps1
|
FUNCTION Get-DefaultBrowser { $httpProgId = (Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice" -ErrorAction SilentlyContinue).ProgId switch -Regex ($httpProgId) { '^ChromeHTML' { RETURN "Google Chrome" } '^MSEdgeHTM|^MicrosoftEdge' { RETURN "Microsoft Edge" } '^FirefoxURL' { RETURN "Mozilla Firefox" } '^BraveHTML' { RETURN "Brave" } '^IE\.HTTP' { RETURN "Internet Explorer" } default { RETURN "Unknown or no default set" } } } |