-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathReadSQLConfigFile.ps1
More file actions
45 lines (33 loc) · 1.27 KB
/
Copy pathReadSQLConfigFile.ps1
File metadata and controls
45 lines (33 loc) · 1.27 KB
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
function Read-SQLConfigFile {
<#
.SYNOPSIS
Takes configuration file and shows features that are being set
.DESCRIPTION
Function to show what features and settings are being adjusted by the configuration file. Allows for comparison of
config files when combined with Compare-Object
.EXAMPLE
Read-SQLConfigFile -Path C:\temp\configuration.ini
explore all settings in specified configuration file
.EXAMPLE
get-childitem -filter *.ini | Read-SQLConfigFile
pass all ini files in current folder to Read-SQLConfigFile
.Example
$reference = get-item DPM_SQL_ConfigurationFile.ini | Read-SQLConfigFile
(get-item SP_SQL_ConfigurationFile.ini | Read-SQLConfigFile) | compare-object -ReferenceObject $reference
compare two configuration files to observe difference
.Notes
Author - Jonathan Allen
#>
[cmdletbinding()]
param(
[parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $true)][string]$Path,
[parameter()][string]$type
)
begin { }
process {
# get all rows that have = assignment
$content = Select-String -Path $Path -Pattern "=" -AllMatches
return ($content | Select-Object line )
}
end { }
}