diff options
| author | Alex Pooley (@zuedev) <zuedev@gmail.com> | 2026-05-25 09:08:11 +0100 |
|---|---|---|
| committer | Alex Pooley (@zuedev) <zuedev@gmail.com> | 2026-05-25 09:08:11 +0100 |
| commit | 9404d187f2d645435fbbbe35982e488851f83ee8 (patch) | |
| tree | 5d3f51deb8e177d353deedeea4206af002aed1a6 /scripts/powershell/Get-GitDirty.ps1 | |
| parent | 481378543fb0601062726b54d141b0687d579eaa (diff) | |
| download | monorepo-9404d187f2d645435fbbbe35982e488851f83ee8.tar monorepo-9404d187f2d645435fbbbe35982e488851f83ee8.tar.gz monorepo-9404d187f2d645435fbbbe35982e488851f83ee8.tar.bz2 monorepo-9404d187f2d645435fbbbe35982e488851f83ee8.tar.xz monorepo-9404d187f2d645435fbbbe35982e488851f83ee8.zip | |
add old content
Diffstat (limited to 'scripts/powershell/Get-GitDirty.ps1')
| -rw-r--r-- | scripts/powershell/Get-GitDirty.ps1 | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/powershell/Get-GitDirty.ps1 b/scripts/powershell/Get-GitDirty.ps1 new file mode 100644 index 0000000..9216ef2 --- /dev/null +++ b/scripts/powershell/Get-GitDirty.ps1 @@ -0,0 +1,19 @@ +<# +.SYNOPSIS + Lists immediate subdirectories containing git repositories with pending changes. + +.DESCRIPTION + This script scans all depth-1 directories in the current location. + It filters for valid git repositories and checks if 'git status' returns any output. + Only the names of repositories with uncommitted changes (dirty) are returned. + +.EXAMPLE + PS C:\MyProjects> Get-GitDirty + + Returns a list of folder names that have pending changes. +#> + +Get-ChildItem -Directory | +Where-Object { Test-Path "$($_.FullName)\.git" } | +Where-Object { git -C $_.FullName status --porcelain } | +Select-Object Name
\ No newline at end of file |
