-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathst-all.ps1
33 lines (29 loc) · 913 Bytes
/
st-all.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
function Test-Dir {
param ([string]$Dir)
$PrevDir = (Get-Location)
Set-Location $Dir
if (Test-Path -Path ".svn" -PathType Container) {
Write-Output ("========== {0} ==========" -f (Get-Location))
svn st
}
elseif (Test-Path -Path ".git" -PathType Container) {
Write-Output ("========== {0} ==========" -f (Get-Location))
git status
}
elseif (Test-Path -Path ".bzr" -PathType Container) {
Write-Output ("========== {0} ==========" -f (Get-Location))
bzr st
}
elseif (Test-Path -Path ".hg" -PathType Container) {
Write-Output ("========== {0} ==========" -f (Get-Location))
hg st
}
else {
$subDirs = Get-ChildItem -Path $Dir -Directory
foreach ($subDir in $subDirs) {
Test-Dir -Dir $subDir.FullName
}
}
Set-Location $PrevDir
}
Test-Dir -Dir (Get-Location)