Usage Tips:
- Click on a keyword to enable inline editing.
- Click inside a code block to copy (excludes comments).
- Use the button to view examples.
- Click outside to collapse all examples.
Decrypt secure string
$s = cat pass.xml
Sample Output:
PS C:\programdata> $s = "01000000d0 ...[SNIP]... e63b3f24ec"
$ss = Convertto-securestring -string $s
Sample Output:
PS C:\programdata> $ss = Convertto-securestring -string $s
$ss = Convertto-securestring -string $s
# Decrypt
(New-Object System.Management.Automation.PSCredential 'N/A', $ss).GetNetworkCredential().Password
Sample Output:
PS C:\programdata> (New-Object System.Management.Automation.PSCredential 'N/A', $ss).GetNetworkCredential().Password
(New-Object System.Management.Automation.PSCredential 'N/A', $ss).GetNetworkCredential().Password
AhXpFsOusi ...[SNIP]... 0LxlUqc0Y=
# Or save as cred
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist "<USER>", $ss
Sample Output:
TO-DO
$cred.GetNetworkCredential().password
Sample Output:
TO-DO