diff --git a/Functions/Public/Connect-GraylogService.ps1 b/Functions/Public/Connect-GraylogService.ps1 index c122c90..1be6bb4 100644 --- a/Functions/Public/Connect-GraylogService.ps1 +++ b/Functions/Public/Connect-GraylogService.ps1 @@ -30,7 +30,6 @@ function Connect-GraylogService { [PSCredential] $Credential ) - if ((Test-GraylogSession -SkipSecretCheck)) { return } # If the session is still valid, don't create a new one if (-NOT $Credential) { try { $Credential = Get-Secret Graylog_Credential -Vault Graylog -ErrorAction Stop @@ -61,6 +60,7 @@ function Connect-GraylogService { try { $null = Invoke-RestMethod @Request } catch { throw $_.Exception.Message } + Import-Module "$PSScriptRoot\..\Private\ConvertFrom-GraylogSession.ps1" $GraylogSession | ConvertFrom-GraylogSession | Set-Secret Graylog_Session } # Export-ModuleMember -Function Connect-Graylog \ No newline at end of file