-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCompare-Files.ps1
42 lines (34 loc) · 1.33 KB
/
Compare-Files.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<#
.SYNOPSIS
Compares 2 lists of computers and outputs differences to text file.
.DESCRIPTION
This script will save a XML file containing installed patches/updates, firmware/driver versions, and various software versions.
It is intended to be used for validation of a small set of values and not a global inventory report.
The P&U tool creates inventory reports that can be used for broader coverage.
.PARAMETER SCCMFile
location of SCCM computer list
.PARAMETER SnagItFile
location of SnagIt computer list
.PARAMETER CompWOSCCM
location of output file
.EXAMPLE
.\Compare-Files.ps1 -SCCMFile 'C:\Temp\other.sccm.file.txt'
This would change the default SCCM file location
#>
Param
(
[string]$SCCMFile='C:\Temp\SCCMComputers.txt',
[string]$SnagItFile='C:\Temp\ComputersWithSnagIt.txt',
[string]$CompWOSCCM='C:\Temp\CompWOSCCM.txt'
)
If (-not (Test-Path $SCCMFile))
{
Throw $SCCMFile + " could not be found"
}
$SC = Get-Content $SCCMFile
Write-Host ("SCCM computers from: " + $SCCMFile) -ForegroundColor Cyan
$SF = Get-Content 'C:\tmp\ComputersWithSnagIt.txt'
Write-Host ("SnagIt computers from: " + $SnagItFile) -ForegroundColor Cyan
# Compare-Object $SC $SF | Out-File $CompWOSCCM
$SCCMFile | Where{$SnagItFile -notcontains $_}
Write-Host ("Files output at: " + $CompWOSCCM) -ForegroundColor Green