Reputation: 2465
I have this Powershell script which iterates through this folder's directories and runs git log
.
However I cannot figure out how to get the $author
parameter through to the git
command.
Param(
[string]$author,
[string]$since
)
Get-ChildItem | ? { $_.PSIsContainer } | % { Push-Location $_.FullName; Write-Host "--" (Get-Location);`
git --no-pager log --author=$author --since='1 friday ago' --until='now' --format='%Cgreen%cr%Creset %s%Creset' --graph --decorate;`
Pop-Location }
Upvotes: 0
Views: 641
Reputation: 59913
Given this script:
# Log.ps1
Param(
[string]$author
)
Get-ChildItem -Directory | % { Push-Location $_.FullName; git --no-pager log --author=$author; Pop-Location }
Invoking it like this yields the correct result:
.\Log.ps1 "SomeAuthor"
Upvotes: 1