I'm trying to find all .git\config files but I cannot figure out how to do it.
When I just use \.git as a pattern, it finds all directories
Get-ChildItem -Path C:\Repositories -Recurse -Hidden |
Where-Object {
$_.FullName -match '\.git'
} |
Select-Object FullName
but when I exapnd it to \.git\\config$ to give me only the config files it yields no results:
Get-ChildItem -Path C:\Repositories -Recurse -Hidden |
Where-Object {
$_.FullName -match '\.git\\config$'
} |
Select-Object FullName
What am I missing here? Is it because the config file does not have an extension?
I'm using powershell 5.1.
config isn't a hidden file, so only showing hidden files is causing it to be ignored.
Get-ChildItem -Recurse -Force | where-object fullname -match '\.git\\config'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With