mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-23 00:13:36 +01:00
Added list-network-shares.ps1
This commit is contained in:
parent
336e83d3ef
commit
7cc8831c19
@ -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
|
||||
|
|
@ -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
15
Scripts/list-network-shares.ps1
Executable 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
|
||||
}
|
Loading…
Reference in New Issue
Block a user