Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions Applications/Application_MDM_Remove.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -326,15 +326,24 @@ $global:authToken = Get-AuthToken -User $User

####################################################

$App = Get-IntuneApplication -Name "Microsoft Excel"
# One App
# $App = Get-IntuneApplication -Name "Microsoft Excel"

# Multiple Apps
$App = Get-IntuneApplication

if($App){

if(@($App).count -gt 1){

Write-Host "More than one application has been found, please specify a single application..." -ForegroundColor Red
Write-Host

foreach ($Object in $App) {
if ($Object.displayName -ne "Company Portal") {
write-host "Removing Application..." -f Yellow
$Object.displayname + ": " + $Object.'@odata.type'
$Object.id
Remove-IntuneApplication -id $Object.id
write-host
}
}
}

elseif(@($App).count -eq 1){
Expand Down