Skip to content

How to correctly remove properties from a Zowe config file #1561

Answered by t1m0thyj
juleskreutzer asked this question in Q&A
Discussion options

You must be logged in to vote

Could you please try replacing the updateKnownProperty calls with the following?

await this.profileInfo.updateKnownProperty({ mergedArgs, property: 'tokenValue', value: undefined as any, setSecure: false });
await this.profileInfo.updateKnownProperty({ mergedArgs, property: 'tokenType', value: undefined as any });

Two things to note here:

  • The undefined as any should work to remove the property but of course the as any is not ideal. We should probably either update the type declaration of IProfArgValue to include undefined, or perhaps add a removeKnownProperty method as you suggested 🙂
  • The setSecure property must be set to false in order to remove an item from the "secure" array in the co…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@juleskreutzer
Comment options

@t1m0thyj
Comment options

Answer selected by VitGottwald
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants