From 7c8ef7b38408334bb3ef4a8d73a763ee5a8ce7ff Mon Sep 17 00:00:00 2001 From: BNWEIN Date: Sat, 11 Nov 2023 10:31:36 +0000 Subject: [PATCH] Fixed Missing Return Fixed missing return --- Modules/CIPPCore/Public/Remove-CIPPMobileDevice.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Modules/CIPPCore/Public/Remove-CIPPMobileDevice.ps1 b/Modules/CIPPCore/Public/Remove-CIPPMobileDevice.ps1 index 6f65ff4da439..ad59e935e9d1 100644 --- a/Modules/CIPPCore/Public/Remove-CIPPMobileDevice.ps1 +++ b/Modules/CIPPCore/Public/Remove-CIPPMobileDevice.ps1 @@ -12,15 +12,16 @@ function Remove-CIPPMobileDevice { $devices = New-ExoRequest -tenantid $tenantFilter -cmdlet "Get-MobileDevice" -Anchor $username -cmdParams @{mailbox = $username } | ForEach-Object { try { New-ExoRequest -tenantid $tenantFilter -cmdlet "Remove-MobileDevice" -Anchor $username -cmdParams @{Identity = $_.Identity } - "Removed device: $($_.FriendlyName)" + return "Removed device: $($_.FriendlyName)" } catch { - "Could not remove device: $($_.FriendlyName)" + return "Could not remove device: $($_.FriendlyName)" continue } } Write-LogMessage -user $ExecutingUser -API $APIName -message "Deleted mobile devices for $($username)" -Sev "Info" -tenant $tenantFilter + return "Deleted mobile devices for $($username)" } catch { Write-LogMessage -user $ExecutingUser -API $APIName -message "Could not delete mobile devices for $($username): $($_.Exception.Message)" -Sev "Error" -tenant $tenantFilter