Added list-network-shares.ps1

This commit is contained in:
Markus Fleschutz 2021-02-16 16:12:51 +01:00
parent 336e83d3ef
commit 7cc8831c19
3 changed files with 17 additions and 0 deletions

View File

@ -45,6 +45,7 @@ list-unused-files.ps1, lists unused files in a directory tree
list-cmdlets.ps1, lists the PowerShell cmdlets
list-earthquakes.ps1, lists earthquakes with magnitude >= 6.0 for the last 30 days
list-modules.ps1, lists the PowerShell modules
list-network-shares.ps1, lists the network shares of the local computer
list-news.ps1, lists the latest news
list-os-releases.ps1, lists OS releases and download URL
list-printers.ps1, lists all printer known to the computer

1 Script Description
45 list-cmdlets.ps1 lists the PowerShell cmdlets
46 list-earthquakes.ps1 lists earthquakes with magnitude >= 6.0 for the last 30 days
47 list-modules.ps1 lists the PowerShell modules
48 list-network-shares.ps1 lists the network shares of the local computer
49 list-news.ps1 lists the latest news
50 list-os-releases.ps1 lists OS releases and download URL
51 list-printers.ps1 lists all printer known to the computer

View File

@ -51,6 +51,7 @@ Table of Contents
* [list-cmdlets.ps1](Scripts/list-cmdlets.ps1) - lists the PowerShell cmdlets
* [list-earthquakes.ps1](Scripts/list-earthquakes.ps1) - lists earthquakes with magnitude >= 6.0 for the last 30 days
* [list-modules.ps1](Scripts/list-modules.ps1) - lists the PowerShell modules
* [list-network-shares.ps1](Scripts/list-network-shares.ps1) - lists the network shares of the local computer
* [list-news.ps1](Scripts/list-news.ps1) - lists the latest news
* [list-os-releases.ps1](Scripts/list-os-releases.ps1) - lists OS releases and download URL
* [list-printers.ps1](Scripts/list-printers.ps1) - lists all printer known to the computer

15
Scripts/list-network-shares.ps1 Executable file
View File

@ -0,0 +1,15 @@
#!/bin/powershell
<#
.SYNTAX ./list-network-shares.ps1
.DESCRIPTION lists the network shares of the local computer
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
try {
get-wmiobject win32_share | where {$_.name -NotLike "*$"}
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}