diff --git a/file.ts b/file.ts new file mode 100644 index 000000000..64d10f77d --- /dev/null +++ b/file.ts @@ -0,0 +1,8 @@ +const { ProfileInfo } = require("@zowe/imperative"); +(async () => { + const profInfo = new ProfileInfo("zowe"); + await profInfo.readProfilesFromDisk(); + const upd = { profileName: "lpar1.zosmf", profileType: "zosmf" }; + await profInfo.updateProperty({ ...upd, property: "user", value: "abc", setSecure: true }); + await profInfo.updateProperty({ ...upd, property: "password", value: "daaaef", setSecure: true }); +})(); \ No newline at end of file diff --git a/packages/imperative/src/config/src/ProfileInfo.ts b/packages/imperative/src/config/src/ProfileInfo.ts index 978a34cd9..3ad72f6c0 100644 --- a/packages/imperative/src/config/src/ProfileInfo.ts +++ b/packages/imperative/src/config/src/ProfileInfo.ts @@ -601,7 +601,7 @@ export class ProfileInfo { layerProperties = this.mLoadedConfig.findLayer(false, osLoc.global)?.properties; realBaseProfileName = layerProperties?.defaults.base; } - if (realBaseProfileName) baseProfile = this.mLoadedConfig.api.profiles.buildProfile(realBaseProfileName, layerProperties?.profiles); + if (realBaseProfileName) baseProfile = this.mLoadedConfig.api.profiles.buildProfile(realBaseProfileName, layerProperties?.profiles); // else baseProfile = null; } if (baseProfile != null) {