Add list-drives.ps1

This commit is contained in:
Markus Fleschutz 2021-03-15 17:22:33 +01:00
parent be123b5af8
commit 153bdabaec
3 changed files with 19 additions and 0 deletions

View File

@ -4,6 +4,7 @@ check-drive-space.ps1, checks the given drive for free space left
check-ipv4-address.ps1, checks the given IPv4 address for validity
check-ipv6-address.ps1, checks the given IPv6 address for validity
check-mac-address.ps1, checks the given MAC address for validity
check-swap-space.ps1, checks the swap space for free space left
check-symlinks.ps1, checks every symlink in the given directory tree
check-windows-system-files.ps1, checks the validity of the Windows system files
check-xml-file.ps1, checks the given XML file for validity
@ -46,6 +47,7 @@ list-branches.ps1, lists the Git branches in the current/given repository
list-commits.ps1, lists the Git commits in the current/given repository
list-current-timezone.ps1, lists the current time zone details
list-clipboard.ps1, lists the contents of the clipboard
list-drives.ps1, lists all drives
list-environment-variables.ps1, lists all environment variables
list-empty-dirs.ps1, lists empty subfolders within the given directory tree
list-empty-files.ps1, lists empty files within the given directory tree

1 Script Description
4 check-ipv4-address.ps1 checks the given IPv4 address for validity
5 check-ipv6-address.ps1 checks the given IPv6 address for validity
6 check-mac-address.ps1 checks the given MAC address for validity
7 check-swap-space.ps1 checks the swap space for free space left
8 check-symlinks.ps1 checks every symlink in the given directory tree
9 check-windows-system-files.ps1 checks the validity of the Windows system files
10 check-xml-file.ps1 checks the given XML file for validity
47 list-commits.ps1 lists the Git commits in the current/given repository
48 list-current-timezone.ps1 lists the current time zone details
49 list-clipboard.ps1 lists the contents of the clipboard
50 list-drives.ps1 lists all drives
51 list-environment-variables.ps1 lists all environment variables
52 list-empty-dirs.ps1 lists empty subfolders within the given directory tree
53 list-empty-files.ps1 lists empty files within the given directory tree

View File

@ -31,9 +31,11 @@ Collection of PowerShell Scripts
---------------------------------
* [add-firewall-rules.ps1](Scripts/add-firewall-rules.ps1) - adds firewall rules for the given executables (requires admin rights)
* [check-drive-space.ps1](Scripts/check-drive-space.ps1) - checks the given drive for free space left
* [check-swap-space.ps1](Scripts/check-swap-space.ps1) - checks the swap space for free space left
* [check-windows-system-files.ps1](Scripts/check-windows-system-files.ps1) - checks the validity of the Windows system files (requires admin rights)
* [enable-crash-dumps.ps1](Scripts/enable-crash-dumps.ps1) - enables the writing of crash dumps
* [hibernate.ps1](Scripts/hibernate.ps1) - enables hibernate mode for the local computer (requires admin rights)
* [list-drives.ps1](Scripts/list-drives.ps1) - lists all drives
* [list-network-shares.ps1](Scripts/list-network-shares.ps1) - lists the network shares of the local computer
* [list-current-timezone.ps1](Scripts/list-current-timezone.ps1) - lists the current time zone details
* [list-installed-apps.ps1](Scripts/list-installed-apps.ps1) - lists the installed Windows Store apps

15
Scripts/list-drives.ps1 Executable file
View File

@ -0,0 +1,15 @@
#!/bin/powershell
<#
.SYNTAX ./list-drives.ps1
.DESCRIPTION lists all drives
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
try {
get-PSDrive -PSProvider FileSystem
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}