filter string from live (updating) log file using windows powershell
问题 I have a computer that is logging events from a device on a serial port. Putty is logging them to a file. I used to have this running on a Linux machine. Basically would tail -f event.log >> script.sh This was the *nix script #!/bin/bash outfile=sras_pages.log while read -r line do IFS=' ' read -ra split <<< "$line" [[ ${split[1]} == AC/BATT_PWR ]] && echo "${line:9:29}" [[ ${split[1]} == COMM-FAULT ]] && echo "${line:9:29}" done >> "$outfile" Basically I want to forward only character