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
|
$examplePC
|
||||||
)
|
)
|
||||||
|
|
||||||
|
$GetPCNotInstalledApps = @(
|
||||||
|
"Citrix",
|
||||||
|
"Microsoft Visual C\+\+",
|
||||||
|
"RightFax",
|
||||||
|
"Windows Driver Package"
|
||||||
|
)
|
||||||
|
|
||||||
function Get-AppDiff {
|
function Get-AppDiff {
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory)]
|
[Parameter(Mandatory)]
|
||||||
|
|
@ -17,21 +24,24 @@ function Get-AppDiff {
|
||||||
# Open example file
|
# Open example file
|
||||||
$lookupTablePath = Join-Path (get-item $PSScriptRoot).Parent.FullName 'Data\ExpectedApps.json'
|
$lookupTablePath = Join-Path (get-item $PSScriptRoot).Parent.FullName 'Data\ExpectedApps.json'
|
||||||
$example = get-content $lookupTablePath | ConvertFrom-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 = @()
|
$output = @()
|
||||||
# Finds each app that isn't in the example
|
# Finds each app that isn't in the example
|
||||||
foreach ( $app in $apps ) {
|
foreach ( $app in $apps ) {
|
||||||
if (
|
$skip = $false
|
||||||
# Apps that shouldn't be considered an "installed app"
|
foreach ($notapp in $GetPCNotInstalledApps) {
|
||||||
(-not ($app.DisplayName -match "Citrix")) -and
|
if ($app.DisplayName -match $notapp) {
|
||||||
(-not ($app.DisplayName -match "Microsoft Visual C\+\+")) -and
|
$skip = $true
|
||||||
(-not ($app.DisplayName -match "RightFax")) -and
|
break
|
||||||
# This check is last for performance
|
|
||||||
(-not ( $example.DisplayName -contains $app.DisplayName ) )
|
|
||||||
)
|
|
||||||
{
|
|
||||||
$output += $app
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($skip -or $exclude.DisplayName -contains $app.DisplayName) { continue }
|
||||||
|
|
||||||
|
$output += $app
|
||||||
|
}
|
||||||
|
|
||||||
if($TableView){
|
if($TableView){
|
||||||
$output | Out-GridView -Title "Get-PC Apps - $ComputerName"
|
$output | Out-GridView -Title "Get-PC Apps - $ComputerName"
|
||||||
|
|
@ -73,9 +83,23 @@ function Copy-FileNoDestruct ($srcpath, $dstpath) {
|
||||||
function Get-ExampleApps {
|
function Get-ExampleApps {
|
||||||
param( $examplePC )
|
param( $examplePC )
|
||||||
$appsPath = (Join-Path (get-item $PSScriptRoot).Parent.FullName 'Private\Apps.ps1')
|
$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
|
Import-Module -Force $appsPath
|
||||||
$apps = Get-Apps $examplePC
|
Import-Module -Force $sccmPath
|
||||||
$apps = Remove-Version $apps
|
$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
|
# Open example file
|
||||||
$lookupTablePath = Join-Path (get-item $PSScriptRoot).Parent.FullName 'Data\ExpectedApps.json'
|
$lookupTablePath = Join-Path (get-item $PSScriptRoot).Parent.FullName 'Data\ExpectedApps.json'
|
||||||
Copy-FileNoDestruct $lookupTablePath $($lookupTablePath + ".bak")
|
Copy-FileNoDestruct $lookupTablePath $($lookupTablePath + ".bak")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue