Better appDiff output
This commit is contained in:
parent
774bce8ec7
commit
ca45404af1
38
Data/AppsToIgnore.json
Normal file
38
Data/AppsToIgnore.json
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
[
|
||||
{
|
||||
"DisplayName": "Hyland Web ActiveX Controls"
|
||||
},
|
||||
{
|
||||
"DisplayName": "Intel(R) Processor Graphics"
|
||||
},
|
||||
{
|
||||
"DisplayName": "Microsoft Visual Studio Setup WMI Provider (default)"
|
||||
},
|
||||
{
|
||||
"DisplayName": "NetSupport Manager"
|
||||
},
|
||||
{
|
||||
"DisplayName": "Office 16 Click-to-Run Localization Component"
|
||||
},
|
||||
{
|
||||
"DisplayName": "Realtek Audio COM Components (driver)"
|
||||
},
|
||||
{
|
||||
"DisplayName": "Realtek High Definition Audio Driver"
|
||||
},
|
||||
{
|
||||
"DisplayName": "Vulkan Run Time Libraries (default)"
|
||||
},
|
||||
{
|
||||
"DisplayName": "Microsoft Teams Meeting Add-in for Microsoft Office"
|
||||
},
|
||||
{
|
||||
"DisplayName": "Documentation Manager"
|
||||
},
|
||||
{
|
||||
"DisplayName": "64 Bit HP CIO Components Installer"
|
||||
},
|
||||
{
|
||||
"DisplayName": "Teams Machine-Wide Installer"
|
||||
}
|
||||
]
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -2,6 +2,13 @@ param (
|
|||
$examplePC
|
||||
)
|
||||
|
||||
$GetPCNotInstalledApps = @(
|
||||
"Citrix",
|
||||
"Microsoft Visual C\+\+",
|
||||
"RightFax",
|
||||
"Windows Driver Package"
|
||||
)
|
||||
|
||||
function Get-AppDiff {
|
||||
param(
|
||||
[Parameter(Mandatory)]
|
||||
|
|
@ -17,20 +24,23 @@ function Get-AppDiff {
|
|||
# Open example file
|
||||
$lookupTablePath = Join-Path (get-item $PSScriptRoot).Parent.FullName 'Data\ExpectedApps.json'
|
||||
$example = get-content $lookupTablePath | ConvertFrom-Json
|
||||
# Open file with manually added apps to ignore
|
||||
$lookupTablePath = Join-Path (get-item $PSScriptRoot).Parent.FullName 'Data\AppsToIgnore.json'
|
||||
$ignore = get-content $lookupTablePath | ConvertFrom-Json
|
||||
$exclude = $example + $ignore
|
||||
$output = @()
|
||||
# Finds each app that isn't in the example
|
||||
foreach ( $app in $apps ) {
|
||||
if (
|
||||
# Apps that shouldn't be considered an "installed app"
|
||||
(-not ($app.DisplayName -match "Citrix")) -and
|
||||
(-not ($app.DisplayName -match "Microsoft Visual C\+\+")) -and
|
||||
(-not ($app.DisplayName -match "RightFax")) -and
|
||||
# This check is last for performance
|
||||
(-not ( $example.DisplayName -contains $app.DisplayName ) )
|
||||
)
|
||||
{
|
||||
$output += $app
|
||||
$skip = $false
|
||||
foreach ($notapp in $GetPCNotInstalledApps) {
|
||||
if ($app.DisplayName -match $notapp) {
|
||||
$skip = $true
|
||||
break
|
||||
}
|
||||
}
|
||||
if ($skip -or $exclude.DisplayName -contains $app.DisplayName) { continue }
|
||||
|
||||
$output += $app
|
||||
}
|
||||
|
||||
if($TableView){
|
||||
|
|
@ -73,9 +83,23 @@ function Copy-FileNoDestruct ($srcpath, $dstpath) {
|
|||
function Get-ExampleApps {
|
||||
param( $examplePC )
|
||||
$appsPath = (Join-Path (get-item $PSScriptRoot).Parent.FullName 'Private\Apps.ps1')
|
||||
$sccmPath = (Join-Path (get-item $PSScriptRoot).Parent.FullName 'Private\SCCMQuery.ps1')
|
||||
Import-Module -Force $appsPath
|
||||
$apps = Get-Apps $examplePC
|
||||
$apps = Remove-Version $apps
|
||||
Import-Module -Force $sccmPath
|
||||
$apps = Get-Apps $examplePC | Select-Object -Property "DisplayName"
|
||||
$trimmedApps = @()
|
||||
foreach ($app in $apps) {
|
||||
$skip = $false
|
||||
foreach ($notapp in $GetPCNotInstalledApps) {
|
||||
if (!$app.DisplayName -or $app.DisplayName -match $notapp) {
|
||||
$skip = $true
|
||||
break
|
||||
}
|
||||
}
|
||||
if ($skip) { continue }
|
||||
$trimmedApps += $app
|
||||
}
|
||||
$apps = Remove-Version $trimmedApps
|
||||
# Open example file
|
||||
$lookupTablePath = Join-Path (get-item $PSScriptRoot).Parent.FullName 'Data\ExpectedApps.json'
|
||||
Copy-FileNoDestruct $lookupTablePath $($lookupTablePath + ".bak")
|
||||
|
|
|
|||
Loading…
Reference in a new issue