Automatically answer yes when pruning SMB shares
This commit is contained in:
parent
3e8f4a5df4
commit
ee2072ec53
|
@ -1,5 +1,5 @@
|
||||||
ForEach ($share_name in $args) {
|
ForEach ($share_name in $args) {
|
||||||
$result = net share $share_name /DELETE
|
$result = net share $share_name /DELETE /YES
|
||||||
if ($LastExitCode -ne 0) {
|
if ($LastExitCode -ne 0) {
|
||||||
Write-Output "share name: ${share_name}"
|
Write-Output "share name: ${share_name}"
|
||||||
Write-Error "error - ${result}"
|
Write-Error "error - ${result}"
|
||||||
|
|
Loading…
Reference in New Issue