Skip to content

Instantly share code, notes, and snippets.

View cmsp-marufe's full-sized avatar

Michael Arufe cmsp-marufe

View GitHub Profile
@cmsp-marufe
cmsp-marufe / ConvertFrom-SecureStringToPlainText.ps1
Created November 5, 2024 14:23 — forked from JeremyTBradshaw/ConvertFrom-SecureStringToPlainText.ps1
For PowerShell 5.1 and older, convert secure strings back to plain text
function ConvertFrom-SecureStringToPlainText ([System.Security.SecureString]$SecureString) {
[System.Runtime.InteropServices.Marshal]::PtrToStringAuto(
[System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecureString)
)
}