Test-FileShare

Tests if a file/SMB share exists on the local computer.

Syntax

Test-FileShare [-Name] <String> [<CommonParameters>]

Description

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.

Related Commands

Parameters

Name Type Description Required? Pipeline Input Default Value
Name String

The name of a specific share to check.

true false

EXAMPLE 1

Test-FileShare -Name 'CarbonShare'

Demonstrates how to test of a file share exists.