Updated list-network-shares.ps1

This commit is contained in:
Markus Fleschutz
2025-07-21 11:37:30 +02:00
parent 8ed1f2bebd
commit 8d1ef5b2e6

View File

@ -5,7 +5,7 @@
This PowerShell script lists all network shares (aka "shared folders") of the local computer.
.EXAMPLE
PS> ./list-network-shares.ps1
✅ Shared folder \\LAPTOP\Public -> D:\Public ("Public folder for file transfer")
✅ Shared folder \\LAPTOP\Public ("File transfer folder") -> D:\Public
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -18,7 +18,7 @@ try {
} else {
$shares = Get-WmiObject win32_share | where {$_.name -NotLike "*$"}
foreach ($share in $shares) {
Write-Output "✅ Shared folder \\$(hostname)\$($share.Name) -> $($share.Path) (`"$($share.Description)`")"
Write-Output "✅ Shared folder \\$(hostname)\$($share.Name) (`"$($share.Description)`") -> $($share.Path)"
}
}
exit 0 # success