Secure String Parameters

Product: PowerShell Universal
Version: 1.4.6

Is there a way to pass in a parameter as secure string? I’ve tried…

Param(
    $Userame, 
    [Security.SecureString]$Password
)

I get the following error:

Error occurred during a cryptographic operation. at Microsoft.PowerShell.ProtectedData.Unprotect(Byte[] encryptedData, Byte[] optionalEntropy, DataProtectionScope scope) at Microsoft.PowerShell.SecureStringHelper.Unprotect(String input) at System.Management.Automation.InternalDeserializer.ReadSecureString() at System.Management.Automation.InternalDeserializer.DeserializeSecureString(InternalDeserializer deserializer) at System.Management.Automation.InternalDeserializer.ReadPrimaryKnownType(TypeSerializationInfo pktInfo) at System.Management.Automation.InternalDeserializer.ReadOneDeserializedObject(String& streamName, Boolean& isKnownPrimitiveType) at System.Management.Automation.InternalDeserializer.ReadOneObject(String& streamName) at System.Management.Automation.Deserializer.Deserialize(String& streamName) at System.Management.Automation.PSSerializer.DeserializeAsList(String source) at System.Management.Automation.PSSerializer.Deserialize(String source) at UniversalAutomation.Host.JobService.ExecuteScript(executeScriptRequest request) in D:\a\universal\universal\src\Host\JobService.cs:line 137