Skip to content

Commit 7b72786

Browse files
committed
added throw message if no owner is defined
1 parent 2369625 commit 7b72786

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ Function Invoke-AddTeam {
2020

2121
$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)