Skip to content

Commit 7f74e80

Browse files
Merge pull request KelvinTegelaar#1281 from Ren-Roros-Digital/addteam
fix: fixed Add Team
2 parents a02dc01 + 7b72786 commit 7f74e80

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Teams-Sharepoint/Invoke-AddTeam.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ Function Invoke-AddTeam {
1818
# Write to the Azure Functions log stream.
1919
Write-Host 'PowerShell HTTP trigger function processed a request.'
2020

21-
$Owners = ($userobj.owner).value
21+
$Owners = ($userobj.owner)
2222
try {
23-
23+
if ($null -eq $Owners) {
24+
throw "You have to add at least one owner to the team"
25+
}
2426
$Owners = $Owners | ForEach-Object {
2527
$OwnerID = "https://graph.microsoft.com/beta/users('$($_)')"
2628
@{

0 commit comments

Comments
 (0)