-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
**Version 1.103.12.01 - 12/03/2022 - BETA** - Added UTF8 Encoding for CSV Exports #6 - Added option to exclude PMPC apps #5 - Added option to exclude specific apps using a filter
- Loading branch information
Showing
3 changed files
with
127 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<# | ||
.Synopsis | ||
Created on: 12/03/22 | ||
Created by: Ben Whitmore | ||
Filename: Get-AppList.ps1 | ||
.Description | ||
Function to get Applications from ConfigMgr and filter results | ||
#> | ||
Function Get-AppList { | ||
Param ( | ||
[Parameter(Mandatory = $True)] | ||
[String[]]$AppName, | ||
[Parameter(Mandatory = $False)] | ||
[Switch]$ExcludePMPC, | ||
[String]$ExcludeFilter, | ||
[Switch]$NoOGV | ||
|
||
) | ||
|
||
#Patch My PC Comment | ||
$PMPC_Comment = "Created by Patch My PC*" | ||
|
||
Write-Log -Message "Function: Get-App was called" -Log "Main.log" | ||
|
||
If ($ExcludePMPC -and $ExcludeFilter -and $NoOGV) { | ||
Write-Log -Message "Get-CMApplication -Fast | Where-Object { $($_.LocalizedDisplayName) -like $($AppName) -and (-not($($_.LocalizedDisplayName) -like $($ExcludeFilter))) -and (-not($($_.LocalizedDescription) -like $($PMPC_Comment))) } | Select-Object -ExpandProperty LocalizedDisplayName" -Log "Main.log" | ||
$ApplicationName = Get-CMApplication -Fast | Where-Object { $_.LocalizedDisplayName -like "$AppName" -and (-not($_.LocalizedDisplayName -like "$ExcludeFilter")) -and (-not($_.LocalizedDescription -like "$PMPC_Comment")) } | Select-Object -ExpandProperty LocalizedDisplayName | ||
} | ||
If ($ExcludePMPC -and $ExcludeFilter -and (-not($NoOGV))) { | ||
Write-Log -Message "Get-CMApplication -Fast | Where-Object { $($_.LocalizedDisplayName) -like $($AppName) -and (-not($($_.LocalizedDisplayName) -like $($ExcludeFilter))) -and (-not($($_.LocalizedDescription) -like $($PMPC_Comment))) } | Select-Object -ExpandProperty LocalizedDisplayName | Sort-Object | Out-GridView -Passthru -Title ""Select an Application(s) to process the associated Deployment Types""" -Log "Main.log" | ||
$ApplicationName = Get-CMApplication -Fast | Where-Object { $_.LocalizedDisplayName -like "$AppName" -and (-not($_.LocalizedDisplayName -like "$ExcludeFilter")) -and (-not($_.LocalizedDescription -like "$PMPC_Comment")) } | Select-Object -ExpandProperty LocalizedDisplayName | Sort-Object | Out-GridView -Passthru -Title "Select an Application(s) to process the associated Deployment Types" | ||
|
||
} | ||
If ($ExcludePMPC -and (-not($ExcludeFilter)) -and $NoOGV) { | ||
Write-Log -Message "Get-CMApplication -Fast | Where-Object { $($_.LocalizedDisplayName) -like $($AppName) -and (-not($($_.LocalizedDescription) -like $($PMPC_Comment))) } | Select-Object -ExpandProperty LocalizedDisplayName" -Log "Main.log" | ||
$ApplicationName = Get-CMApplication -Fast | Where-Object { $_.LocalizedDisplayName -like "$AppName" -and (-not($_.LocalizedDescription -like "$PMPC_Comment")) } | Select-Object -ExpandProperty LocalizedDisplayName | ||
|
||
} | ||
If ($ExcludePMPC -and (-not($ExcludeFilter)) -and (-not($NoOGV))) { | ||
Write-Log -Message "Get-CMApplication -Fast | Where-Object { $($_.LocalizedDisplayName) -like $($AppName) -and (-not($($_.LocalizedDescription) -like $($PMPC_Comment))) } | Select-Object -ExpandProperty LocalizedDisplayName | Sort-Object | Out-GridView -Passthru -Title ""Select an Application(s) to process the associated Deployment Types""" -Log "Main.log" | ||
$ApplicationName = Get-CMApplication -Fast | Where-Object { $_.LocalizedDisplayName -like "$AppName" -and (-not($_.LocalizedDescription -like "$PMPC_Comment")) } | Select-Object -ExpandProperty LocalizedDisplayName | Sort-Object | Out-GridView -Passthru -Title "Select an Application(s) to process the associated Deployment Types" | ||
|
||
} | ||
If ((-not($ExcludePMPC)) -and $ExcludeFilter -and $NoOGV) { | ||
Write-Log -Message "Get-CMApplication -Fast | Where-Object { $($_.LocalizedDisplayName) -like $($AppName) -and (-not($($_.LocalizedDisplayName) -like $($ExcludeFilter))) } | Select-Object -ExpandProperty LocalizedDisplayName" -Log "Main.log" | ||
$ApplicationName = Get-CMApplication -Fast | Where-Object { $_.LocalizedDisplayName -like "$AppName" -and (-not($_.LocalizedDisplayName -like "$ExcludeFilter")) } | Select-Object -ExpandProperty LocalizedDisplayName | ||
|
||
} | ||
If ((-not($ExcludePMPC)) -and $ExcludeFilter -and (-not($NoOGV))) { | ||
Write-Log -Message "Get-CMApplication -Fast | Where-Object { $($_.LocalizedDisplayName) -like $($AppName) -and (-not($($_.LocalizedDisplayName) -like $($ExcludeFilter))) } | Select-Object -ExpandProperty LocalizedDisplayName | Sort-Object | Out-GridView -Passthru -Title ""Select an Application(s) to process the associated Deployment Types""" -Log "Main.log" | ||
$ApplicationName = Get-CMApplication -Fast | Where-Object { $_.LocalizedDisplayName -like "$AppName" -and (-not($_.LocalizedDisplayName -like "$ExcludeFilter")) } | Select-Object -ExpandProperty LocalizedDisplayName | Sort-Object | Out-GridView -Passthru -Title "Select an Application(s) to process the associated Deployment Types" | ||
|
||
} | ||
If ((-not($ExcludePMPC)) -and (-not($ExcludeFilter)) -and $NoOGV) { | ||
Write-Log -Message "Get-CMApplication -Fast | Where-Object { $($_.LocalizedDisplayName) -like $($AppName) } | Select-Object -ExpandProperty LocalizedDisplayName" -Log "Main.log" | ||
$ApplicationName = Get-CMApplication -Fast | Where-Object { $_.LocalizedDisplayName -like "$AppName" } | Select-Object -ExpandProperty LocalizedDisplayName | ||
|
||
} | ||
If ((-not($ExcludePMPC)) -and (-not($ExcludeFilter)) -and (-not($NoOGV))) { | ||
Write-Log -Message "Get-CMApplication -Fast | Where-Object { $($_.LocalizedDisplayName) -like $($AppName) } | Select-Object -ExpandProperty LocalizedDisplayName | Sort-Object | Out-GridView -PassThru -Title ""Select an Application(s) to process the associated Deployment Types""" -Log "Main.log" | ||
$ApplicationName = Get-CMApplication -Fast | Where-Object { $_.LocalizedDisplayName -like "$AppName" } | Select-Object -ExpandProperty LocalizedDisplayName | Sort-Object | Out-GridView -Passthru -Title "Select an Application(s) to process the associated Deployment Types" | ||
|
||
} | ||
|
||
Return $ApplicationName | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters