Skip to content

Commit 2b51d54

Browse files
committed
Add stuffhub support
1 parent 36d977c commit 2b51d54

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

tools/office-cmdlet-updater/constants/commands.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ module.exports = {
1919
SET_LOGIN: '$Username = \'{}\'',
2020
SET_PASS: '$Password = \'{}\'',
2121
CONVERT_PASS_TO_SEC_STRING: '$SecureString = ConvertTo-SecureString -AsPlainText $Password -Force',
22-
CREAT_CRED: '$cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $Username,$SecureString'
22+
CREAT_CRED: '$cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $Username,$SecureString',
23+
STUFFHUB_INSTALL: 'Install-Module -Name MicrosoftStaffHub -RequiredVersion 1.0.0-alpha -AllowPrerelease'
2324
};

tools/office-cmdlet-updater/services/cmdlet.dependencies.service.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class CmdletDependenciesService {
3636
break;
3737
}
3838
case 'staffhub': {
39-
throw new Error('Not implemented exception');
39+
await this.preInstallStuffHub();
4040
break;
4141
}
4242
}
@@ -80,6 +80,11 @@ class CmdletDependenciesService {
8080
await this.ps.invokeCommand(commands.EXCHANGE_SESSION_IMPORT);
8181
}
8282

83+
async preInstallStuffHub() {
84+
// TODO: install module when installation error will be fix
85+
// await this.ps.invokeCommand(commands.STUFFHUB_INSTALL);
86+
}
87+
8388
_getCredentialsFromConfig() {
8489
const { login, pass } = this.config.get('platyPS.credentials');
8590

tools/office-cmdlet-updater/services/power.shell.service.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ class PowerShellService {
2424
const [output, err] = await of(this.ps.invoke());
2525

2626
if (err) {
27+
console.error(err);
28+
2729
throw new Error(err);
2830
}
2931

0 commit comments

Comments
 (0)