Select-String

Vindt tekst in string en bestanden in PowerShell. Dit commando kan alleen gebruikt worden via PowerShell. Je kan Select-String gebruiken zoals grep in UNIX of findstr.exe in Windows. Meer informatie: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/select-string.

Select-String -Path "{{pad\naar\bestand}}" -Pattern '{{zoek_patroon}}'

Select-String -SimpleMatch "{{exacte_string}}" {{pad\naar\bestand}}

Select-String -Path "{{*.ext}}" -Pattern '{{zoek_patroon}}'

Select-String --Context {{2,3}} "{{zoek_patroon}}" {{pad\naar\bestand}}

Get-Content {{pad\naar\bestand}} | Select-String --NotMatch "{{zoek_patroon}}"