Functions/Open-EITSM.ps1
|
function Open-EITSM { <# .Notes AUTHOR: Skyler Hart CREATED: 10/03/2017 10:52:44 LASTEDIT: 2020-04-17 15:47:44 KEYWORDS: REQUIRES: .LINK https://wanderingstag.github.io #> [Diagnostics.CodeAnalysis.SuppressMessageAttribute( "PSAvoidGlobalVars", "", Justification = "Have tried other methods and they do not work consistently." )] [CmdletBinding()] [Alias('Remedy','EITSM','Open-Remedy','ServiceNow','SNOW','Open-ServiceNow')] 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.Remedy 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) } } |