git - How to pass Powershell parameters through pipe -
i have powershell script iterates through folder's directories , runs git log
.
however cannot figure out how $author
parameter through 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 }
given script:
# log.ps1 param( [string]$author ) get-childitem -directory | % { push-location $_.fullname; git --no-pager log --author=$author; pop-location }
invoking yields correct result:
.\log.ps1 "someauthor"
Comments
Post a Comment