Skip to content

rbaas293/Find-Lines

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Find-Lines

PowerShell Module

SYNOPSIS

Prints matches of a Regex Pattern along with their corresponding line number.

Inputs

-Path

File or Directory to search for matches. Directory will not recurse. To recurse, use pipeline.

-Pattern

Mandatory Regex Pattern to search the given input for matches.

-Hashtable

Returns a hashtable object, see Outputs for more information.

Pipeline

This module accepts pipeline input objects from Get-ChildItem. Use of other pipeline inputs may have unexpected execution.

Outputs

Normal

Color coded output with line numbers and pattern matches.

find_readme_nc

Hashtable Mode (-Hashtable)

Returns a hashtable object with the following format:

  Key                     Value               
FileName    {        Key         Value        }
            {   <LineNumber>=<PatternMatch>   }

find_readme_nc_hashtable

Examples

  • Search file results for nc.

    Find-Lines -Path results -Pattern 'nc'
  • Search files in Desktop for nc

    Find-Lines -Path ~/Desktop -Pattern 'nc'
  • Search recursivly through the users Documents directory for nc

    ls -R ~/Documents | Find-Lines -Pattern nc 
    Get-ChildItem -Recurse ~/Documents | Find-Lines -Pattern nc

Install

Manually Using Commandline

git clone https://github.com/rbaas293/Find-Lines.git
cd Find-Lines
# Automatically transfers this module to default user modules directory.
.\toPSProfile.ps1

PSGallery

Coming Soon.

About

PowerShell Module which prints matches of a Regex Pattern along with their corresponding line number.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors