mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
13 lines
354 B
PowerShell
13 lines
354 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;
|
|
}
|