diff --git a/powershell/llcsharp/schema/password.ts b/powershell/llcsharp/schema/password.ts index 84541fe4fc9..a3d36079ef8 100644 --- a/powershell/llcsharp/schema/password.ts +++ b/powershell/llcsharp/schema/password.ts @@ -43,7 +43,7 @@ export class Password extends String { switch (mediaType) { case KnownMediaType.Json: // node should be a JsonString - return toExpression(`${node} is ${ClientRuntime.JsonString} ${tmp} ? (${this.declaration})(${tmp}.ToString()) : ${defaultValue}`); + return toExpression(`${node} is ${ClientRuntime.JsonString} ${tmp} ? (${this.declaration})(new System.Net.NetworkCredential("",(string)${tmp}).SecurePassword) : ${defaultValue}`); } } finally { popTempVar();