Skip to content

Commit e82e118

Browse files
Supports preview 1.1.5 and multilanguage
1 parent ebecebf commit e82e118

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1467
-215
lines changed
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
#Requires -Version 5.0
2+
#Requires -Modules @{ModuleName = "microsoftteams"; ModuleVersion = "1.1.5"}
3+
4+
<#
5+
.SYNOPSIS
6+
Add a Teams App to Microsoft Teams
7+
8+
.DESCRIPTION
9+
10+
.NOTES
11+
This PowerShell script was developed and optimized for ScriptRunner. The use of the scripts requires ScriptRunner.
12+
The customer or user is authorized to copy the script from the repository and use them in ScriptRunner.
13+
The terms of use for ScriptRunner do not apply to this script. In particular, ScriptRunner Software GmbH assumes no liability for the function,
14+
the use and the consequences of the use of this freely available script.
15+
PowerShell is a product of Microsoft Corporation. ScriptRunner is a product of ScriptRunner Software GmbH.
16+
© ScriptRunner Software GmbH
17+
18+
.COMPONENT
19+
Requires Module microsoftteams 1.1.5 or greater
20+
Requires .NET Framework Version 4.7.2.
21+
Requires Library script MSTLibrary.ps1
22+
23+
.LINK
24+
https://github.com/scriptrunner/ActionPacks/tree/master/O365/MS-Teams/Apps
25+
26+
.Parameter MSTCredential
27+
[sr-en] Provides the user ID and password for organizational ID credentials
28+
[sr-de] Enthält den Benutzernamen und das Passwort für die Anmeldung
29+
30+
.Parameter AppId
31+
[sr-en] Teams App identifier in Microsoft Teams
32+
[sr-de] Teams App ID in Microsoft Teams
33+
34+
.Parameter TeamID
35+
[sr-en] Team identifier in Microsoft Teams
36+
[sr-de] ID des Microsoft Teams
37+
38+
.Parameter UserID
39+
[sr-en] User identifier in Microsoft Teams
40+
[sr-de] Benutzer ID in Microsoft Teams
41+
42+
.Parameter Permissions
43+
[sr-en] RSC permissions for the Teams App, e.g. "TeamSettings.Read.Group ChannelMessage.Read.Group"
44+
[sr-de] RSC-Berechtigungen für die Teams-App, z.B. "TeamSettings.Read.Group ChannelMessage.Read.Group"
45+
46+
.Parameter TenantID
47+
[sr-en] Specifies the ID of a tenant
48+
[sr-de] ID eines Mandanten
49+
#>
50+
51+
[CmdLetBinding()]
52+
Param(
53+
[Parameter(Mandatory = $true,ParameterSetName ="byTeam")]
54+
[Parameter(Mandatory = $true,ParameterSetName ="byUser")]
55+
[pscredential]$MSTCredential,
56+
[Parameter(Mandatory = $true,ParameterSetName ="byTeam")]
57+
[string]$TeamID,
58+
[Parameter(Mandatory = $true,ParameterSetName ="byUser")]
59+
[string]$UserID,
60+
[Parameter(Mandatory = $true,ParameterSetName ="byTeam")]
61+
[Parameter(Mandatory = $true,ParameterSetName ="byUser")]
62+
[string]$AppId,
63+
[Parameter(ParameterSetName ="byTeam")]
64+
[Parameter(ParameterSetName ="byUser")]
65+
[string]$Permissions,
66+
[Parameter(ParameterSetName ="byTeam")]
67+
[Parameter(ParameterSetName ="byUser")]
68+
[string]$TenantID
69+
)
70+
71+
Import-Module microsoftteams
72+
73+
try{
74+
[string[]]$Properties = @('DisplayName','TeamsAppId','Version','TeamsAppDefinitionId')
75+
ConnectMSTeams -MTCredential $MSTCredential -TenantID $TenantID
76+
77+
[hashtable]$cmdArgs = @{'ErrorAction' = 'Stop'
78+
'AppId' = $AppId
79+
}
80+
81+
if($PSCmdlet.ParameterSetName -eq 'byTeam'){
82+
$cmdArgs.Add('TeamID',$TeamID)
83+
}
84+
else{
85+
$cmdArgs.Add('UserID',$UserID)
86+
}
87+
if($PSBoundParameters.ContainsKey('Permissions')){
88+
$cmdArgs.Add('Permissions',$Permissions)
89+
}
90+
91+
$null = Add-TeamsAppInstallation @cmdArgs
92+
$cmdArgs.Remove('AppId')
93+
$cmdArgs.Remove('Permissions')
94+
$result = Get-TeamsAppInstallation @cmdArgs | Sort-Object DisplayName | Select-Object $Properties
95+
96+
if($SRXEnv) {
97+
$SRXEnv.ResultMessage = $result
98+
}
99+
else{
100+
Write-Output $result
101+
}
102+
}
103+
catch{
104+
throw
105+
}
106+
finally{
107+
DisconnectMSTeams
108+
}

O365/MS-Teams/Apps/Get-MSTTeamsApp.ps1

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Requires -Version 5.0
1+
#Requires -Version 5.0
22
#Requires -Modules @{ModuleName = "microsoftteams"; ModuleVersion = "1.0.3"}
33

44
<#
@@ -24,22 +24,28 @@
2424
https://github.com/scriptrunner/ActionPacks/tree/master/O365/MS-Teams/Apps
2525
2626
.Parameter MSTCredential
27-
Provides the user ID and password for organizational ID credentials
27+
[sr-en] Provides the user ID and password for organizational ID credentials
28+
[sr-de] Benutzerkonto für die Ausführung
2829
2930
.Parameter AppId
30-
The app's ID generated by Teams (different from the external ID)
31+
[sr-en] The app's ID generated by Teams (different from the external ID)
32+
[sr-de] Die von Teams generierte ID der App (unterscheidet sich von der externen ID)
3133
3234
.Parameter ExternalID
33-
The external ID of the app, provided by the app developer and used by Azure Active Directory
34-
35+
[sr-en] The external ID of the app, provided by the app developer and used by Azure Active Directory
36+
[sr-de] Externe ID der Anwendung, die vom Entwickler der Anwendung bereitgestellt und von Azure Active Directory verwendet wird
37+
3538
.Parameter DisplayName
36-
Name of the app visible to users
39+
[sr-en] Name of the app visible to users
40+
[sr-de] Anzeigename der App
3741
3842
.Parameter DistributionMethod
39-
The type of app in Teams. For LOB apps, use "organization"
43+
[sr-en] The type of app in Teams. For LOB apps, use "organization"
44+
[sr-de] Art der Anwendung in Teams. Für LOB-Apps verwenden Sie "Organisation".
4045
4146
.Parameter TenantID
42-
Specifies the ID of a tenant
47+
[sr-en] Specifies the ID of a tenant
48+
[sr-de] Identifier des Mandanten
4349
#>
4450

4551
[CmdLetBinding()]
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
#Requires -Version 5.0
2+
#Requires -Modules @{ModuleName = "microsoftteams"; ModuleVersion = "1.1.5"}
3+
4+
<#
5+
.SYNOPSIS
6+
Get a Teams App installed in Microsoft Teams
7+
8+
.DESCRIPTION
9+
10+
.NOTES
11+
This PowerShell script was developed and optimized for ScriptRunner. The use of the scripts requires ScriptRunner.
12+
The customer or user is authorized to copy the script from the repository and use them in ScriptRunner.
13+
The terms of use for ScriptRunner do not apply to this script. In particular, ScriptRunner Software GmbH assumes no liability for the function,
14+
the use and the consequences of the use of this freely available script.
15+
PowerShell is a product of Microsoft Corporation. ScriptRunner is a product of ScriptRunner Software GmbH.
16+
© ScriptRunner Software GmbH
17+
18+
.COMPONENT
19+
Requires Module microsoftteams 1.1.5 or greater
20+
Requires .NET Framework Version 4.7.2.
21+
Requires Library script MSTLibrary.ps1
22+
23+
.LINK
24+
https://github.com/scriptrunner/ActionPacks/tree/master/O365/MS-Teams/Apps
25+
26+
.Parameter MSTCredential
27+
[sr-en] Provides the user ID and password for organizational ID credentials
28+
[sr-de] Enthält den Benutzernamen und das Passwort für die Anmeldung
29+
30+
.Parameter AppId
31+
[sr-en] Teams App identifier in Microsoft Teams
32+
[sr-de] Teams App ID in Microsoft Teams
33+
34+
.Parameter TeamID
35+
[sr-en] Team identifier in Microsoft Teams
36+
[sr-de] ID des Microsoft Teams
37+
38+
.Parameter UserID
39+
[sr-en] User identifier in Microsoft Teams
40+
[sr-de] Benutzer ID in Microsoft Teams
41+
42+
.Parameter AppInstallationId
43+
[sr-en] Installation identifier of the Teams App
44+
[sr-de] Installations ID der Teams App
45+
46+
.Parameter TenantID
47+
[sr-en] Specifies the ID of a tenant
48+
[sr-de] ID eines Mandanten
49+
#>
50+
51+
[CmdLetBinding()]
52+
Param(
53+
[Parameter(Mandatory = $true,ParameterSetName ="byTeam")]
54+
[Parameter(Mandatory = $true,ParameterSetName ="byUser")]
55+
[pscredential]$MSTCredential,
56+
[Parameter(Mandatory = $true,ParameterSetName ="byTeam")]
57+
[string]$TeamID,
58+
[Parameter(Mandatory = $true,ParameterSetName ="byUser")]
59+
[string]$UserID,
60+
[Parameter(ParameterSetName ="byTeam")]
61+
[Parameter(ParameterSetName ="byUser")]
62+
[string]$AppId,
63+
[Parameter(ParameterSetName ="byTeam")]
64+
[Parameter(ParameterSetName ="byUser")]
65+
[string]$AppInstallationId,
66+
[Parameter(ParameterSetName ="byTeam")]
67+
[Parameter(ParameterSetName ="byUser")]
68+
[string]$TenantID
69+
)
70+
71+
Import-Module microsoftteams
72+
73+
try{
74+
[string[]]$Properties = @('DisplayName','TeamsAppId','Version','TeamsAppDefinitionId')
75+
ConnectMSTeams -MTCredential $MSTCredential -TenantID $TenantID
76+
77+
[hashtable]$cmdArgs = @{'ErrorAction' = 'Stop'}
78+
79+
if($PSCmdlet.ParameterSetName -eq 'byTeam'){
80+
$cmdArgs.Add('TeamID',$TeamID)
81+
}
82+
else{
83+
$cmdArgs.Add('UserID',$UserID)
84+
}
85+
if($PSBoundParameters.ContainsKey('AppId')){
86+
$cmdArgs.Add('AppId',$AppId)
87+
}
88+
if($PSBoundParameters.ContainsKey('AppInstallationId')){
89+
$cmdArgs.Add('AppInstallationId',$AppInstallationId)
90+
}
91+
92+
$result = Get-TeamsAppInstallation @cmdArgs | Sort-Object DisplayName | Select-Object $Properties
93+
94+
if($SRXEnv) {
95+
$SRXEnv.ResultMessage = $result
96+
}
97+
else{
98+
Write-Output $result
99+
}
100+
}
101+
catch{
102+
throw
103+
}
104+
finally{
105+
DisconnectMSTeams
106+
}

O365/MS-Teams/Apps/New-MSTTeamsApp.ps1

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Requires -Version 5.0
1+
#Requires -Version 5.0
22
#Requires -Modules @{ModuleName = "microsoftteams"; ModuleVersion = "1.0.3"}
33

44
<#
@@ -24,16 +24,20 @@
2424
https://github.com/scriptrunner/ActionPacks/tree/master/O365/MS-Teams/Apps
2525
2626
.Parameter MSTCredential
27-
Provides the user ID and password for organizational ID credentials
27+
[sr-en] Provides the user ID and password for organizational ID credentials
28+
[sr-de] Benutzerkonto für die Ausführung
2829
2930
.Parameter AppPath
30-
The local path of the app manifest zip file
31+
[sr-en] The local path of the app manifest zip file
32+
[sr-de] Lokaler Pfad der Anwendungs-Manifest-Zip-Datei
3133
3234
.Parameter DistributionMethod
33-
The type of app in Teams. For LOB apps, use "organization"
35+
[sr-en] The type of app in Teams. For LOB apps, use "organization"
36+
[sr-de] Art der Anwendung in Teams. Für LOB-Apps verwenden Sie "Organisation".
3437
3538
.Parameter TenantID
36-
Specifies the ID of a tenant
39+
[sr-en] Specifies the ID of a tenant
40+
[sr-de] Identifier des Mandanten
3741
#>
3842

3943
[CmdLetBinding()]

O365/MS-Teams/Apps/Remove-MSTTeamsApp.ps1

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Requires -Version 5.0
1+
#Requires -Version 5.0
22
#Requires -Modules @{ModuleName = "microsoftteams"; ModuleVersion = "1.0.3"}
33

44
<#
@@ -24,13 +24,16 @@
2424
https://github.com/scriptrunner/ActionPacks/tree/master/O365/MS-Teams/Apps
2525
2626
.Parameter MSTCredential
27-
Provides the user ID and password for organizational ID credentials
27+
[sr-en] Provides the user ID and password for organizational ID credentials
28+
[sr-de] Benutzerkonto für die Ausführung
2829
2930
.Parameter AppId
30-
The app's ID generated by Teams (different from the external ID)
31+
[sr-en] The app's ID generated by Teams (different from the external ID)
32+
[sr-de] Die von Teams generierte ID der App (unterscheidet sich von der externen ID)
3133
3234
.Parameter TenantID
33-
Specifies the ID of a tenant
35+
[sr-en] Specifies the ID of a tenant
36+
[sr-de] Identifier des Mandanten
3437
#>
3538

3639
[CmdLetBinding()]

0 commit comments

Comments
 (0)