Created
October 14, 2019 12:45
-
-
Save nestorium/0ca209a232f164db645293c3db749df0 to your computer and use it in GitHub Desktop.
Powershell script to find files recursively that have longer lines than the parameter set
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$rootDirectory = "c:\Temp\" | |
$maxLengthOfCharacters = 30000 | |
$foundFiles = Get-ChildItem $rootDirectory -File -Recurse | Where-Object {(Get-Content($_.Fullname) | Measure-Object -Maximum Length | Select-Object -ExpandProperty Maximum) -ge $maxLengthOfCharacters} | |
$foundFiles | ForEach-Object{ Write-Host $_.Name} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment