Skip to content

Commit

Permalink
Suppress error if browser isn't found
Browse files Browse the repository at this point in the history
  • Loading branch information
pcgeek86 committed Aug 1, 2023
1 parent 63715f3 commit 66534cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion functions/private/Find-Browser.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ function Find-Browser {
'chrome'
'firefox'
'MicrosoftEdge.exe'
'chromium'
)
foreach ($Command in $CommandList) {
if (Get-Command -Name $Command) { return $Command }
if (Get-Command -Name $Command -ErrorAction Ignore) { return $Command }
}
}

0 comments on commit 66534cf

Please sign in to comment.