mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-26 14:26:10 +01:00
Add list-submodules.ps1
This commit is contained in:
parent
1bc034b829
commit
0d55bd2ceb
@ -117,6 +117,7 @@ list-recycle-bin.ps1, lists the content of the recycle bin folder
|
||||
list-scripts.ps1, lists all PowerShell scripts in this repository
|
||||
list-services.ps1, lists the services on the local computer
|
||||
list-sql-tables.ps1, lists the SQL server tables
|
||||
list-submodules.ps1, lists the submodules of the current/given Git repository
|
||||
list-system-info.ps1, lists system information on the local computer
|
||||
list-tags.ps1, lists all tags in the current/given Git repository
|
||||
list-tasks.ps1, lists all Windows scheduler tasks
|
||||
|
|
@ -152,6 +152,7 @@ Mega Collection of PowerShell Scripts
|
||||
* [list-branches.ps1](Scripts/list-branches.ps1) - lists all branches in the current/given Git repository
|
||||
* [list-commits.ps1](Scripts/list-commits.ps1) - lists all commits in the current/given Git repository
|
||||
* [list-latest-tag.ps1](Scripts/list-latest-tag.ps1) - lists the latest tag on the current branch in a Git repository
|
||||
* [list-submodules.ps1](Scripts/list-submodules.ps1) - lists the submodules of the current/given Git repository
|
||||
* [list-tags.ps1](Scripts/list-tags.ps1) - lists all tags in the current/given Git repository
|
||||
* [pull-repo.ps1](Scripts/pull-repo.ps1) - pulls updates for the current/given Git repository (including submodules)
|
||||
* [pull-repos.ps1](Scripts/pull-repos.ps1) - pulls updates for all Git repositories under the current/given directory (including submodules)
|
||||
|
24
Scripts/list-submodules.ps1
Normal file
24
Scripts/list-submodules.ps1
Normal file
@ -0,0 +1,24 @@
|
||||
<#
|
||||
.SYNTAX list-submodules.ps1 [<repo-dir>]
|
||||
.DESCRIPTION lists the submodules of the current/given Git repository
|
||||
.LINK https://github.com/fleschutz/PowerShell
|
||||
.NOTES Author: Markus Fleschutz / License: CC0
|
||||
#>
|
||||
|
||||
param($RepoDir = "$PWD")
|
||||
|
||||
try {
|
||||
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
|
||||
set-location "$RepoDir"
|
||||
|
||||
$Null = (git --version)
|
||||
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
||||
|
||||
& git submodule
|
||||
if ($lastExitCode -ne "0") { throw "'git submodule' failed" }
|
||||
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
Loading…
Reference in New Issue
Block a user