SRXEnv.psm1
if($Host.Name -like 'ScriptRunner Extended (SRX) PowerShell*Host'){ throw "The SRXEnv module cannot be imported into a $($Host.Name)." } New-Variable -Name SRXEnv -Scope Global -Visibility Public -Description 'ScriptRunner host environment hashtable.' -Force function Reset-SRXEnvironment { <# .SYNOPSIS Reset global ScriptRunner PowerShell Host Environment Variable $SRXEnv. .DESCRIPTION Reset global ScriptRunner PowerShell Host Environment Variable $SRXEnv. #> [CmdletBinding()] param () $me = whoami $ipaddress = '127.0.0.1' if(Get-Command -Name 'Get-NetIPAddress' -ErrorAction SilentlyContinue){ $ipaddress = Get-NetIPAddress -AddressFamily IPv4 -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty 'IPAddress' -ErrorAction SilentlyContinue } $Global:SRXEnv = @{ ReportEmail = '' ResultEmail = '' ResultHtml = '' ResultList = New-Object -TypeName 'System.Collections.ArrayList' ResultList2 = New-Object -TypeName 'System.Collections.ArrayList' ResultMessage = '' ResultObjectJSON = $null SRXDisplayName = 'Name of the current Action' SRXStarted = Get-Date SRXStartedBy = $me SRXStartedIP = $ipaddress SRXStartedVia = "Interactive by `"$($me)`" ($($Host.Name))" } Write-Verbose ($Global:SRXEnv | Out-String) } New-Alias -Name Reset-SRXEnv -Value Reset-SRXEnvironment -Scope Global -Option Constant, AllScope -Force Reset-SRXEnvironment Export-ModuleMember -Variable 'SRXEnv' -Function 'Reset-SRXEnvironment' -Alias 'Reset-SRXEnv' # SIG # Begin signature block # MIIa5QYJKoZIhvcNAQcCoIIa1jCCGtICAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCA+YpjIqamD1xiS # ixjwKTCTDOk/x0DRY9h9ivuudbEAGqCCCWUwggSZMIIDgaADAgECAhBxoLc2ld2x # r8I7K5oY7lTLMA0GCSqGS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SIb3DQEJAzENBgsq # hkiG9w0BCRABBDAcBgkqhkiG9w0BCQUxDxcNMjAwMjExMTQwNjI2WjArBgsqhkiG # 9w0BCRACDDEcMBowGDAWBBQDJb1QXtqWMC3CL0+gHkwovig0xTAvBgkqhkiG9w0B # CQQxIgQgkmrtyTh69ReviX96CLN/OoWjWOzNZsS/IqxXFf5lP04wDQYJKoZIhvcN # AQEBBQAEggEAxYS4aqU9nMGSDk4dOn5a9T6AapsEjbXK780P8eblCdpsZXWQkpOB # FPCwt8+fPmYwBZL+V/NZaqYwzSGzdE3QeUi6xMDYEMRCele6bhIAY9OM6wvs1mdi # POS6RvmHiw1Y959He7guWUHDJIxowOOpG82PIpRffZU3+slPEFKzQXmhPwbpChVX # 538IHJhP5t/2IhSXUOCz/hVVoU2gM7Tn5/yqvjK/jdnU/a+YV/jG6/BT5eB+8qKf # KIWHXFg2/WlQAba+zEjVc+/5gX6LQngI9RJP+eIKzS6Sb+IuysCCxzRl3/ulbMOM # wLqFaTWXesGGmt63NwFflhyIL+MN1w7NCA== # SIG # End signature block |