I would like to be able to do something similar to this is PowerShell
docker logs -f my-container | grep -q "string-to-match"
i.e. to follow a log file and when a string is matched you stop follow the file. My idea was to try something like this
docker logs -f my-container | Select-String "string-to-match".
I know it's not complete but I can't figure out how to make it work. I also did try to use WSL2 like this
docker logs -f my-container | wsl grep -q "string-to-match".
but it keeps following the log even after a match has been found!
A WSL-solution would solve my problem but a native PowerShell-solution would be preferable!