1 2 3 4 5 6 7 8 |
$jsonc = Get-Content -Path .\credenciales.json -Encoding UTF8 -Raw | ConvertFrom-Json $cred = New-Object -TypeName PSCredential $jsonc.UserName,($jsonc.Password | ConvertTo-SecureString) Start-Process notepad -Credential $cred #Extraer password de tipo SecureString $BSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($cred.Password) $PlainPassword = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR) $PlainPassword |