From d83cded1562a819ea2fa873d65361537e6f69a76 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Thu, 16 Jan 2025 21:16:39 +0100 Subject: [PATCH] SDn-connector: fix password... --- PowerFGT/Public/cmdb/system/sdn-connector.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PowerFGT/Public/cmdb/system/sdn-connector.ps1 b/PowerFGT/Public/cmdb/system/sdn-connector.ps1 index 1813f6a5..fa9e7b4b 100644 --- a/PowerFGT/Public/cmdb/system/sdn-connector.ps1 +++ b/PowerFGT/Public/cmdb/system/sdn-connector.ps1 @@ -80,12 +80,12 @@ function Add-FGTSystemSDNConnector { $_sdnconnector | add-member -name "username" -membertype NoteProperty -Value $username if (("Desktop" -eq $PSVersionTable.PsEdition) -or ($null -eq $PSVersionTable.PsEdition)) { - $bstr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($secret); + $bstr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($password); $sec = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($bstr); $_sdnconnector | add-member -name "password" -membertype NoteProperty -Value $sec } else { - $sec = ConvertFrom-SecureString -SecureString $secret -AsPlainText + $sec = ConvertFrom-SecureString -SecureString $password -AsPlainText $_sdnconnector | add-member -name "password" -membertype NoteProperty -Value $sec }