Skip to content

Read PSFile

PRASOON KARUNAN V edited this page Nov 27, 2016 · 4 revisions

Description

This cmdlet shows the specified Script by adding line numbers,by default it will search in current directory for .ps1 script and shows the occurence with line numbers for each file with file name.

Example

PS C:\> Read-PSFile -LookupPath c:\Scripts -String 'PowerPlan'

Reads all .ps1 scripts and output occurance of the string 'PowerPlan' in all files

Example

PS C:\> Read-PSFile -LookupPath c:\Scripts -Recurse -String 'PowerShell'

Reads and outputs with line numbers and the line of occurence of the string 'Powershell' for each .ps1 file by recursing into subdirectories

Example

PS C:\> Read-PSFile -LookupPath -Type '.xml' -String 'Schema'

Reads all .xml files under -path c:\Files and outputs the occurence of the -String 'Schema' in all .xml files with filename

Clone this wiki locally