@@ -29,7 +29,7 @@ function Parse-GitStatus($includeNumstat = $false, $extraArgs) {
2929
3030 $allArgs = @ (' status' , ' -s' )
3131 if ($extraArgs ) { $allArgs += $extraArgs }
32- $allFiles = Invoke-Git @allArgs | % {
32+ $allFiles = Invoke-Git @allArgs | ForEach-Object {
3333 $oldFilename = $null
3434 $relativePath = $_.Substring (3 ).Replace(" `" " , " " )
3535
@@ -78,7 +78,7 @@ function Parse-GitStatus($includeNumstat = $false, $extraArgs) {
7878 }
7979 return $returns
8080
81- } | % {$_ }
81+ } | ForEach-Object {$_ }
8282
8383
8484
@@ -113,8 +113,8 @@ function Add-GitNumstat($allFiles, $staged) {
113113 }
114114
115115
116- $eolWarnings = $numstatResult | ? { $_ -is [System.Management.Automation.ErrorRecord ] }
117- $eolWarnings | % {
116+ $eolWarnings = $numstatResult | ForEach-Object { $_ -is [System.Management.Automation.ErrorRecord ] }
117+ $eolWarnings | ForEach-Object {
118118 $line = $_.Exception.Message
119119 if ($line.StartsWith (' The file will have its original line' )) {
120120 # Ignore this one
@@ -127,7 +127,7 @@ function Add-GitNumstat($allFiles, $staged) {
127127 $fromEol = $match.matches [0 ].groups[' from' ]
128128 $toEol = $match.matches [0 ].groups[' to' ]
129129 $fileName = $match.matches [0 ].groups[' file' ].Value.Replace(' /' , ' \' )
130- $matchingStatus = $allFiles | Where {$_.file -eq $fileName }
130+ $matchingStatus = $allFiles | Where-Object {$_.file -eq $fileName }
131131 if ($matchingStatus ) {
132132 $matchingStatus | Add-Member - NotePropertyName ' lineEndings' - NotePropertyValue " $fromEol -> $toEol " - Force
133133 }
@@ -136,13 +136,13 @@ function Add-GitNumstat($allFiles, $staged) {
136136 }
137137
138138
139- $numstatResult = $numstatResult | ? { $_ -isnot [System.Management.Automation.ErrorRecord ] }
140- $numstatResult | % {
139+ $numstatResult = $numstatResult | Where-Object { $_ -isnot [System.Management.Automation.ErrorRecord ] }
140+ $numstatResult | ForEach-Object {
141141 # Output format: +++ `t --- `t fileName
142142 $numstat = $_.Trim ().Split(" `t " )
143143 $file = Quote- Path $numstat [2 ]
144144 $numstat = @ {file = $file ;added = $numstat [0 ];deleted = $numstat [1 ]}
145- $matchingStatus = $allFiles | Where {$_.staged -eq $staged -and $numstat.file -eq $_.file }
145+ $matchingStatus = $allFiles | Where-Object {$_.staged -eq $staged -and $numstat.file -eq $_.file }
146146
147147 if ($matchingStatus ) {
148148 $matchingStatus.added = $numstat.added
0 commit comments