Anlage des Repos
This commit is contained in:
28
test/Konfig_auslesen.ps1
Normal file
28
test/Konfig_auslesen.ps1
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
LoadConfig Konfig_auslesen.xml
|
||||
|
||||
param($path = $(throw "You must specify a config file"))
|
||||
$global:appSettings = @{}
|
||||
$config = [xml](get-content $path)
|
||||
foreach ($addNode in $config.configuration.appsettings.add) {
|
||||
if ($addNode.Value.Contains(‘,’)) {
|
||||
# Array case
|
||||
$value = $addNode.Value.Split(‘,’)
|
||||
|
||||
for ($i = 0; $i -lt $value.length; $i++) {
|
||||
$value[$i] = $value[$i].Trim()
|
||||
}
|
||||
}
|
||||
else {
|
||||
# Scalar case
|
||||
$value = $addNode.Value
|
||||
}
|
||||
$global:appSettings[$addNode.Key] = $value
|
||||
}
|
||||
|
||||
|
||||
$appSettings["MaxScanDetailRows"]
|
||||
|
||||
$appSettings["datatypes"]
|
||||
|
||||
$appSettings["datatypes"][0]
|
||||
Reference in New Issue
Block a user