About 7,540,000 results
Open links in new tab
  1. How to search a string in multiple files and return the names of files

    Nov 16, 2011 · To see what the different properties are... This is faster. The second argument is -filter: Weirdly, I've found the select-string pattern matches against directory names as well. +1, This works perfectly for my case, however use select Pattern, LineNumber, Filename for …

  2. PowerShell Find String in Files: A Quick Guide

    To search for a specific string within files using PowerShell, you can utilize the `Select-String` cmdlet, which scans through files and returns the lines containing the desired text. Here's a code snippet for that: What is a String in the Context of PowerShell? In PowerShell, a string is a sequence of characters used to represent text data.

  3. How to use findstr in powershell to search for a string in the …

    Nov 16, 2019 · Is there a way to use findstr to get powershell to search through the whole drive for a specific string? If you're going to use PowerShell I'd recommend you stick with the native cmdlets over using findstr, Select-String can do what you want: For more information on Select-String run Get-Help Select-String -Online.

  4. PowerShell Find file (Search for Files using Get-ChildItem)

    Sep 8, 2023 · Using Get-ChildItem, you can find files. You can easily find files by name, and location, search file for string, or find file locations using a match pattern. You can use the Get-ChildItem cmdlet in PowerShell to. Find files in a directory. Search for files by an extension in the current directory. Find files on the root drive.

  5. powershell - Find specific String in Textfile - Stack Overflow

    Oct 7, 2021 · Check SS64 for explanations and useful examples for everything in PowerShell and cmd. Another way of checking if a string exists in the file would be: echo Contains String. echo Not Contains String. but this doesn't give you an indicaion of where in the file the text exists.

  6. Use Windows PowerShell to search for files

    Jun 27, 2016 · We can use Get-Childitem to show a list of files and/or directories quite easily. The following example lists all files on the root of Drive C: If we add a –Recurse parameter, we can show everything that we have access to. So far, this is no different from running the following command in the CMD prompt. So, why PowerShell?

  7. How to Use PowerShell Select-String for Exact Matches?

    Feb 27, 2025 · As a PowerShlell developer, many times, you will need to search through text files, logs, or even command output for specific strings. You can achieve this by using the Select-String cmdlet in PowerShell. In this tutorial, I will explain, how to use Select-String for exact matches with some examples.

  8. How to Use PowerShell to Search for Files Containing a String

    Jul 19, 2024 · Learn how to use PowerShell to search for files containing specific strings. This blog post covers setting up your environment, basic commands, and advanced search techniques.

  9. How to Find Strings in Files in PowerShell?

    Feb 22, 2024 · To find a string in a file using PowerShell, you can use the Select-String cmdlet, which is similar to grep in Unix/Linux. For instance, Select-String -Path “C:\MyFolder\file.txt” -Pattern “your-search-string” will search for “your-search-string” in the specified file.

  10. Search String in File or Grep in PowerShell - ShellGeek

    Jan 31, 2023 · PowerShell Grep equivalent cmdlet is Select-String which uses regular expressions to search string in files. Select-String cmdlet in Powershell works similar to grep in UNIX and findstr in PowerShell. Select-String searches for …

  11. Some results have been removed
Refresh