2017-12-16 00:31:44 +00:00
|
|
|
ForEach ($share_name in $args) {
|
2018-12-19 16:59:13 +00:00
|
|
|
$result = net share $share_name /DELETE /YES
|
2017-12-16 00:31:44 +00:00
|
|
|
if ($LastExitCode -ne 0) {
|
|
|
|
Write-Output "share name: ${share_name}"
|
|
|
|
Write-Error "error - ${result}"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Write-Output "share removal completed"
|
|
|
|
exit 0
|