File tree Expand file tree Collapse file tree 2 files changed +44
-9
lines changed
tools/office-cmdlet-updater Expand file tree Collapse file tree 2 files changed +44
-9
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,12 @@ module.exports = {
2
2
GET_TEAM : 'Get-Team' ,
3
3
INSTALL_MICROSOFT_TEAM : 'Install-Module MicrosoftTeams -SkipPublisherCheck' ,
4
4
CONNECT_MICROSOFT_TEAM : 'Connect-MicrosoftTeams' ,
5
- INSTALL_PLATYPS : 'Install-Module -Name platyPS -Scope CurrentUser' ,
5
+ INSTALL_PLATYPS : 'Install-Module -Name platyPS -SkipPublisherCheck - Scope CurrentUser' ,
6
6
IMPORT_PLATYPS : 'Import-Module platyPS' ,
7
- UPDATE_MARKDOWN : 'Update-MarkdownHelp -Path "{}" -LogPath "{}"'
7
+ UPDATE_MARKDOWN : 'Update-MarkdownHelp -Path "{}" -LogPath "{}"' ,
8
+ SKYPE_SET_POLICY : 'Set-ExecutionPolicy RemoteSigned ' ,
9
+ SKYPE_INSTALL_MODULE : 'Import-Module "C:\\\\Program Files\\\\Common Files\\\\Skype for Business Online\\\\Modules\\\\SkypeOnlineConnector\\\\SkypeOnlineConnector.psd1" -Force' ,
10
+ SKYPE_GET_CRED : '$cred = Get-Credential' ,
11
+ SKYPE_CREATE_SESSION : '$session = New-CsOnlineSession -Credential $cred -Verbose' ,
12
+ SKYPE_IMPORT_SESSION : 'Import-PSSession -Session $session'
8
13
} ;
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ class PowerShellService {
25
25
26
26
result += output ;
27
27
28
- [ output , err ] = await of ( this . authIfNeeded ( ) ) ;
28
+ [ output , err ] = await of ( this . preInstallTeams ( ) ) ;
29
29
30
30
if ( err ) {
31
31
await this . dispose ( ) ;
@@ -34,17 +34,47 @@ class PowerShellService {
34
34
35
35
result += output ;
36
36
37
+ [ output , err ] = await of ( this . preInstallSkype ( ) ) ;
38
+
39
+ if ( err ) {
40
+ await this . dispose ( ) ;
41
+ throw new Error ( err ) ;
42
+ }
43
+
44
+ result += output ;
45
+
46
+ return result ;
47
+ }
48
+
49
+ async preInstallSkype ( ) {
50
+ let result ;
51
+
52
+ //result += await this._invokeCommand(commands.SKYPE_SET_POLICY);
53
+
54
+ result += await this . _invokeCommand ( commands . SKYPE_INSTALL_MODULE ) ;
55
+
56
+ result += await this . _invokeCommand ( commands . SKYPE_GET_CRED ) ;
57
+
58
+ result += await this . _invokeCommand ( commands . SKYPE_CREATE_SESSION ) ;
59
+
60
+ result += await this . _invokeCommand ( commands . SKYPE_IMPORT_SESSION ) ;
61
+
37
62
return result ;
38
63
}
39
64
40
- async authIfNeeded ( ) {
65
+ async _invokeCommand ( command ) {
66
+ const [ output , err ] = await of ( this . invokeCommand ( command ) ) ;
67
+
68
+ if ( err ) {
69
+ throw new Error ( err ) ;
70
+ }
71
+
72
+ return output ;
73
+ }
74
+
75
+ async preInstallTeams ( ) {
41
76
let output , err , result ;
42
77
43
- // const checkAuthCommand = commands.GET_TEAM;
44
- //
45
- // [output, err] = await of(this.invokeCommand(checkAuthCommand));
46
- //
47
- // result += output;
48
78
// TODO: check if user already auth
49
79
50
80
const installModule = commands . INSTALL_MICROSOFT_TEAM ;
You can’t perform that action at this time.
0 commit comments