0

I am trying to port this script to PowerShell:

https://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/

In PowerShell I run git verify-pack from the root of my repository with:

git verify-pack -v .git\objects\pack\pack-*.idx

But I get the error:

fatal: Cannot open existing pack file 'C:\test\MyRepo\.git\objects\pack\*.idx'
C:\test\MyRepo\.git\objects\pack\*.pack: bad

I took a look at:

Equivalent of git verify-pack -v | sort | tail

but it does not really address the wildcard pack-*.idx. Is that not possible in PowerShell?

Community
  • 1
  • 1
u123
  • 15,603
  • 58
  • 186
  • 303

1 Answers1

2

Looks like Git relies on wildcard expansion by shell. In PS you have to do it yourself:

git verify-pack -v (Get-ChildItem '.\.git\objects\pack\*.idx')
beatcracker
  • 6,714
  • 1
  • 18
  • 41