improve speed of Select-String

device config is at the very top of the xml, so this should be much faster
This commit is contained in:
pblivingston 2026-03-02 06:55:55 -05:00
parent defb2b68c0
commit 1f5b52b439

View File

@ -125,7 +125,7 @@ class IODevice : IRemote {
$newTime = (Get-Item $path).LastWriteTime
if ($newTime -gt $oldTime) {
try {
$line = Get-Content $path | Select-String -Pattern "<$($this.kindOfDevice)Dev index='$($this.index + 1)'"
$line = Get-Content $path | Select-String -Pattern "<$($this.kindOfDevice)Dev index='$($this.index + 1)'" -List
if ($line) { break }
}
catch {}