PowerShell - String Operations
You want to search for the word 'error' in all '.log' files in a folder and output only the matching text, not file names or line numbers. Which command achieves this?
Matches.Value. Select-String -Pattern 'error' -Path '*.log' -Raw outputs raw file content, not matches. Select-String -Pattern 'error' -Path '*.log' -Quiet returns only True/False. Select-String -Pattern 'error' -Path '*.log' | Select-Object Line outputs full line, not just match.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions