@@ -4,11 +4,11 @@ $serverPath = "$SPLUNKHOME\etc\restartserver.txt"
4
4
$dsPath = " $SPLUNKHOME \etc\restartds.txt"
5
5
$guidPath = " $SPLUNKHOME \etc\restartguid.txt"
6
6
$dateTimePath = " $SPLUNKHOME \etc\restartdatetime.txt"
7
- $restartInput = { $ (Test-Path " $SPLUNKHOME \etc\restartinput.txt" - PathType Leaf)}
8
- $restartServer = { $ (Test-Path " $SPLUNKHOME \etc\restartserver.txt" - PathType Leaf)}
9
- $restartDS = { $ (Test-Path " $SPLUNKHOME \etc\restartds.txt" - PathType Leaf)}
10
- $restartGUID = { $ (Test-Path " $SPLUNKHOME \etc\restartguid.txt" - PathType Leaf)}
11
- $restartDateTime = { $ (Test-Path " $SPLUNKHOME \etc\restartdatetime.txt" - PathType Leaf)}
7
+ $restartInput = $ (Test-Path " $SPLUNKHOME \etc\restartinput.txt" - PathType Leaf)
8
+ $restartServer = $ (Test-Path " $SPLUNKHOME \etc\restartserver.txt" - PathType Leaf)
9
+ $restartDS = $ (Test-Path " $SPLUNKHOME \etc\restartds.txt" - PathType Leaf)
10
+ $restartGUID = $ (Test-Path " $SPLUNKHOME \etc\restartguid.txt" - PathType Leaf)
11
+ $restartDateTime = $ (Test-Path " $SPLUNKHOME \etc\restartdatetime.txt" - PathType Leaf)
12
12
13
13
# ## Filter to attach timestamps where necessary
14
14
filter timestamp {" $ ( Get-Date - Format ' yyyy-MM-dd HH:mm:ss.fff' ) ${env: COMPUTERNAME} : $_ " }
@@ -17,19 +17,19 @@ if ($restartInput -eq "True" -OR $restartServer -eq "True" -OR $restartDS -eq "T
17
17
Write-output " One or more settings has been changed." | timestamp
18
18
Write-output " Restarting forwarder." | timestamp
19
19
if ($restartInput -eq " True" ) {
20
- Delete - Item - path " $inputPath "
20
+ Remove -Item - path " $inputPath "
21
21
}
22
22
if ($restartServer -eq " True" ) {
23
- Delete - Item - path " $serverPath "
23
+ Remove -Item - path " $serverPath "
24
24
}
25
25
if ($restartDS -eq " True" ) {
26
- Delete - Item - path " $dsPath "
26
+ Remove -Item - path " $dsPath "
27
27
}
28
28
if ($restartGUID -eq " True" ) {
29
- Delete - Item - path " $guidPath "
29
+ Remove -Item - path " $guidPath "
30
30
}
31
31
if ($restartDateTime -eq " True" ) {
32
- Delete - Item - path " $dateTimePath "
32
+ Remove -Item - path " $dateTimePath "
33
33
}
34
34
sleep 5
35
35
$restart = " restart"
0 commit comments