Automatically answer yes when pruning SMB shares

This commit is contained in:
Chris Roberts 2018-12-19 08:59:13 -08:00
parent 3e8f4a5df4
commit ee2072ec53
1 changed files with 1 additions and 1 deletions

View File

@ -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}"