Forum Discussion
Get information from parameter store in JSON or in different lines
- May 13, 2022
Hey, Rubens.
I'm not quite sure what you mean by filter, but here's some quick illustrations on how to work with your JSON string.
Cheers,
Lain
Something is off with this scenario, as using a plain-text string throws a different error to the "null" error mentioned in the question.
My confusion is increased by the $password variable apparently showing the plain-text string value obtained from the AWS commandlet.
Mind you, my mock test was in Windows PowerShell 5.1, so perhaps what you've suggested is right for PowerShell - I'm not sure. Either way, I'm at a loss.
Here's an illustration of the difference between $null and plain-text strings and their corresponding errors under Windows PowerShell 5.1.
Cheers,
Lain
- May 13, 2022I got this from there, didn't test it but usually you need to convertto-securestring for these kind of things.. https://social.technet.microsoft.com/Forums/en-US/ebfc706d-93be-4ca0-83e0-33d9e072fb97/powershell-script-monitor-with-encrypted-password?forum=operationsmanagerauthoring
- LainRobertsonMay 13, 2022Silver Contributor
No, you're quite correct about the need for a conversion. What's got me confused is $password being $null (according to the exception thrown) and yet at the same time having a value in the Write-Host.
I can't figure that part out.
Cheers,
Lain