Functions/Open-OWA.ps1
|
function Open-OWA { <# .Notes AUTHOR: Skyler Hart CREATED: 2021-10-18 22:54:07 LASTEDIT: 2021-10-18 22:54:48 .LINK https://wanderingstag.github.io #> [Diagnostics.CodeAnalysis.SuppressMessageAttribute( "PSAvoidGlobalVars", "", Justification = "Have tried other methods and they do not work consistently." )] [CmdletBinding()] [Alias('OWA')] Param ( [Parameter(Mandatory=$false)] [Switch]$Chrome, [Parameter(Mandatory=$false)] [Switch]$Edge, [Parameter(Mandatory=$false)] [Switch]$Firefox, [Parameter(Mandatory=$false)] [Switch]$InternetExplorer ) $config = $Global:WSToolsConfig $URL = $config.OWA if ($Chrome) {Start-Process "chrome.exe" $URL} elseif ($Edge) {Start-Process Microsoft-Edge:$URL} elseif ($Firefox) {Start-Process "firefox.exe" $URL} elseif ($InternetExplorer) {Start-Process "iexplore.exe" $URL} else { #open in default browser (New-Object -com Shell.Application).Open($URL) } } |