File Name Search in PowerShell


Here a simple but effective command to retrieve a list of all files in a directory tree containing a specific text in the file name.
dir c:users -r -i “*yourtext*”

Explanation

  • The first argument is the directory to search (c:users).
  • Process all sub-directories with the –r switch.
  • The -i switch is used to specify which file names to search for, in this case all files containingyourtext

Yorumlar

Bu blogdaki popüler yayınlar

TERMINAL SERVICES UNLIMITED

Debugging Group Policy Processing

Windows 7: Optional update delivery is not working - “You may be a victim of software counterfeiting.”