Get-FileShare

Gets the file/SMB shares on the local computer.

Syntax

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

Description

The Get-FileShare function uses WMI to get the file/SMB shares on the current/local computer. The returned objects are Win32_Share WMI objects.

Use the Name paramter to get a specific file share by its name. If a share with the given name doesn't exist, an error is written and nothing is returned.

The Name parameter supports wildcards. If you're using wildcards to find a share, and no shares are found, no error is written and nothing is returned.

Get-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 retrieve. Wildcards accepted. If the string contains WMI sensitive characters, you'll need to escape them.

false false

EXAMPLE 1

Get-FileShare

Demonstrates how to get all the file shares on the local computer.

EXAMPLE 2

Get-FileShare -Name 'Build'

Demonstrates how to get a specific file share.

EXAMPLE 3

Get-FileShare -Name 'Carbon*'

Demonstrates that you can use wildcards to find all shares that match a wildcard pattern.