-
Notifications
You must be signed in to change notification settings - Fork 1
Read PSFile
PRASOON KARUNAN V edited this page Nov 27, 2016
·
4 revisions
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.
PS C:\> Read-PSFile -LookupPath c:\Scripts -String 'PowerPlan'
Reads all .ps1 scripts and output occurance of the string 'PowerPlan' in all files
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
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