1: set-location c:\dev\codefiles
2: $count = 0
3: $files = Get-ChildItem -Recurse -File `
4: #if we want to filter the files based on date range
5: `#| Where-Object { $_.CreationTime -ge "12/13/2017" -and $_.CreationTime -le "12/29/2017" } `
6: ForEach($file in $files)
7: {
8: if ( (Get-Content $file -Raw).Contains("shipsite=`"KeywordToFind`""))
9: {
10: write-host $file; $count++;
11: }
12: }
13: Write-Host "count of files containing word:$count
Tuesday, 14 July 2020
Counting of files containing keyword in Powershell
When we want to see how many files are using a specific keyword, we can use below powershell script to do this.
This will be helpful if we want to estimate the amount of code changes needed for a keyword change.
Subscribe to:
Post Comments (Atom)
How to Handle SSIS Database movement from one environment to another
Below are the steps to follow the movement of SSISDB from one environment to another: -- opening the existing Database master key in S...
-
We are using Azure Data Factory to load data from Azure storage blobs to SQL Server on-premises. During data loading, we faced SQL Error: ...
-
Hello World, Through this blog, I am going to ruminate over lots of technical stuff around databases. Hoping to provide quality conten...
-
Below are the steps to follow the movement of SSISDB from one environment to another: -- opening the existing Database master key in S...
No comments:
Post a Comment