< Back

Get-CFileShare

Sun Jan 12, 2020 9:39 pm

NAME Get-CFileShare



SYNOPSIS

Gets the file/SMB shares on the local computer.





SYNTAX

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





DESCRIPTION

The `Get-CFileShare` 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-CFileShare` was added in Carbon 2.0.





PARAMETERS

-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.



Required? false

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Get-CFileShare



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









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Get-CFileShare -Name 'Build'



Demonstrates how to get a specific file share.









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Get-CFileShare -Name 'Carbon*'



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











RELATED LINKS

https://msdn.microsoft.com/en-us/library/aa394435.aspx

Get-CFileSharePermission

Install-CFileShare

Test-CFileShare

Uninstall-CFileShare