So I'm trying to decrypt a Csv that was securestring using a key and read it as an array, but when I decrypt it into plaintext using:
$unsec = $secure | convertfrom-securestring -asplaintext
it looks like several lines of this:
@{Num=123; RDM=abc}
@{Num=456; RDM=def}
What's the best way of decrypting the data into an array?
Thank you
You need to serialize the data before converting it to a
SecureStringotherwise you would end up with string representations of your objects when you convert it back to a plainstring. You should useConvertTo-CsvbeforeConvertTo-SecureString.Using
Get-Processas an example:Now if you want to decrypt the
$encryptedstring you can:You should also be aware of the following limitation: