I would like to encrypt a password in PowerShell
I tried this :
In CLI :
Read-Host -prompt "Password ?" -AsSecureString | ConvertFrom-SecureString | out-file "D:\root.pwd"
In my script.ps1 :
$pwsNAS = Get-Content "D:\root.pwd" | ConvertTo-SecureString
plink.exe root@192.168.x.y -pw $pwdNAS df
But it doesn't work...
I tried with credentials, but it doesn't seems to be better...
(My password doesn't have any space or accented character)
Any idea?