public/Get-PSession.ps1
<#PSScriptInfo
{ "VERSION": "1.0.0", "GUID": "9a38dcb2-9a2b-45fc-b938-b36e5a96e4d4", "FILENAME": "Get-PortainerSession.ps1", "AUTHOR": "Hannes Palmquist", "CREATEDDATE": "2022-10-24", "COMPANYNAME": "GetPS", "COPYRIGHT": "(c) 2022, Hannes Palmquist, All Rights Reserved" } PSScriptInfo#> function Get-PSession { <# .DESCRIPTION . .PARAMETER Name Description .EXAMPLE Get-PSession Description of example #> [CmdletBinding()] # Enabled advanced function support param( ) if ($script:PortainerSession) { Write-Debug -Message 'Get-PSession; PortainerSession found in script scope' return $script:PortainerSession } else { Write-Error -Message 'No Portainer Session established, please call Connect-Portainer' } } #endregion # SIG # Begin signature block # MIIbmAYJKoZIhvcNAQcCoIIbiTCCG4UCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR # AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUKOv+aD9gycsJsEg9hillRGcX # VhagghYPMIIDBDCCAeygAwIBAgIQFqvAHPTHupdKm+zXSmZcFTANBgkqhkiG9w0B # AQUFADAaMRgwFgYDVQQDDA9IYW5uZXNQYWxtcXVpc3QwHhcNMjExMTA2MjEzODU5 # WhcNMjYxMTA2MjE0ODU5WjAaMRgwFgYDVQQDDA9IYW5uZXNQYWxtcXVpc3QwggEi # MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC6WNXwWLjX4EAPDxg9U54O83Sr # Vdf41bEPJz8V0wDQm4MJnnBGZTCqPBENXsfSbIPhHwad+tcsd3nc1ZNuQEJTV3W1 # pXTOtNK+yV0r51VSJvFYYo3qXFyvWdi9n8Z8/yydoWy1vXkx7CsbmIuniODGEzIE # C1z0QYgrjyNmXw1CewOjX+oW2cgjiJqjuxsS/sLnmqAOMOeV3047GnEEKTyderWR # L/U+ohEu2WcMao1UCKEtUmPo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