Updated Connect-GraylogService to import the ConvertFrom-GraylogSession function before it calls is

This commit is contained in:
Nathan Windisch 2024-07-26 13:57:45 +01:00
parent 3511d98e62
commit 63bfd2bc40

View File

@ -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