Tests if a file/SMB share exists on the local computer.
Test-FileShare [-Name] <String> [<CommonParameters>]
The Test-FileShare function uses WMI to check if a file share exists on the local computer. If the share exists, Test-FileShare returns $true. Otherwise, it returns $false.
Test-FileShare was added in Carbon 2.0.
| Name | Type | Description | Required? | Pipeline Input | Default Value |
|---|---|---|---|---|---|
| Name | String | The name of a specific share to check. |
true | false |
Test-FileShare -Name 'CarbonShare'
Demonstrates how to test of a file share exists.