mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
14 lines
355 B
PowerShell
14 lines
355 B
PowerShell
|
|
function ConvertFrom-IcingaSecureString()
|
||
|
|
{
|
||
|
|
param([SecureString]$SecureString);
|
||
|
|
|
||
|
|
if ($SecureString -eq $null) {
|
||
|
|
return '';
|
||
|
|
}
|
||
|
|
|
||
|
|
[IntPtr]$BSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecureString)
|
||
|
|
[string]$String = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)
|
||
|
|
|
||
|
|
return $String;
|
||
|
|
}
|