Uninstalls/removes a file share from the local computer.


Uninstall-FileShare [-Name] <String> [-WhatIf] [-Confirm] [<CommonParameters>]


The Uninstall-FileShare function uses WMI to uninstall/remove a file share from the local computer, if it exists. If the file shares does not exist, no errors are written and nothing happens. The directory on the file system the share points to is not removed.

Uninstall-FileShare was added in Carbon 2.0.

Related Commands


Name Type Description Required? Pipeline Input Default Value
Name String

The name of a specific share to uninstall/delete. Wildcards accepted. If the string contains WMI sensitive characters, you'll need to escape them.

true false
WhatIf SwitchParameter false false
Confirm SwitchParameter false false
CommonParameters This cmdlet supports common parameters. For more information type
Get-Help about_CommonParameters.


Uninstall-FileShare -Name 'CarbonShare'

Demonstrates how to uninstall/remove a share from the local computer. If the share does not exist, Uninstall-FileShare silently does nothing (i.e. it doesn't write an error).