What is a right way to restore secured string from text file via Powershell

154 Views Asked by At

I would like to avoid using password in plain text via using cmdkey and simpliest way to achieve that, from my point of view, is to copy coded string to a text grabbed from ConvertTo-SecureString and save is to txt file and then import this back using ConvertFrom-SecureString. Problem is that when I'm trying to convert secured string back from what is stored in text file and then print output it's different from one which is saved in text file. I'm planning to use this technique on different computers, is it because different machines recover secured string differently or what I'm doing wrong?

0

There are 0 best solutions below