$Key = (55,198,215,78,28,29,92,101,8,164,203,133,117,153,209,244,123,100,109,9,78,29,55,250,77,193,38,34,222,157,202,241)
$SecureStringPath = "C:\scripts\securestring.txt"
$username = "domain\username"
$password = cat $SecureStringPath | convertto-securestring -Key $Key
$Cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
This is not a safe way to store a password if you have the key and the securestring you can still get the password in plain text.