I am running a script that will update a config file
$FC = GC C:\File\Trivoli.config
In this config file i am grepping for this line
property-set name="HonorProcessScheduledEndTime" value="true"
If the value in this line is "true" I need to change the value to "false"
I then need to restart the trvoli service so the update on this config file takes effect.
If the Value is already "false" then I just need to write-host the file is already updated.
Here's the Rough Script, thanks for looking.
$FC = GC C:\File\Trivoli.config
$FC | foreach { If ( $_ -like "*Runthisprogram*")
{$_ -replace "true", "false"
Stop-Service w32time -verbose
Start-Sleep -sec 2
Start-service w32time -verbose
} Else
{ Write-Host Config already updated}
}