blob: 0ed84ba3a05b7616381435602200557bde600c76 (
plain)
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
43
44
45
46
47
48
49
50
51
|
##############################################################################
##
## compare-config-content
##
##############################################################################
<#
.SYNOPSIS
Compares mono build configuration content detecting diff's.
#>
param(
## first config source to compare.
$mono_config_source1,
## second config source to compare.
$mono_config_source2
)
if ((Test-Path -isvalid $mono_config_source1) -And (Test-Path $mono_config_source1))
{
$mono_config_source1_content = Get-Content $mono_config_source1
}
else
{
$mono_config_source1_content = $mono_config_source1
}
if ((Test-Path -isvalid $mono_config_source2) -And (Test-Path $mono_config_source2))
{
$mono_config_source2_content = Get-Content $mono_config_source2
}
else
{
$mono_config_source2_content = $mono_config_source2
}
## Compare content.
$comparedLines = Compare-Object $mono_config_source1_content $mono_config_source2_content -IncludeEqual | Sort-Object { $_.InputObject.ReadCount }
$comparedLines | foreach {
if($_.SideIndicator -ne "==")
{
Write-Host "Changes detected."
exit 1;
}
}
exit 0;
|