Last active
July 15, 2024 09:25
-
-
Save dfinke/7773004 to your computer and use it in GitHub Desktop.
Developers use GUIDs in there code. This PowerShell function takes a path, looks for C# files and searches (greps) for a GUID pattern. `Find-GuidUsage c:\<Your Code>`
This file contains hidden or 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
function Find-GuidUsage { | |
param( | |
[Parameter(Mandatory=$true)] | |
$path, | |
$filter="*.cs" | |
) | |
$GuidPattern = "({|\()?[A-Fa-f0-9]{8}-([A-Fa-f0-9]{4}-){3}[A-Fa-f0-9]{12}(}|\))?" | |
dir $path -Recurse $filter | | |
Select-String $GuidPattern | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment