Installs a file/SMB share.
Install-FileShare [-Name] <String> [-Path] <String> [[-Description] <String>] [[-FullAccess] <String>] [[-ChangeAccess] <String>] [[-ReadAccess] <String>] [-Force] [<CommonParameters>]
Install-FileShare function installs a new file/SMB share. If the share doesn't exist, it is created. In Carbon 2.0, if a share does exist, its properties and permissions are updated in place, unless the share's path needs to change. Changing a share's path requires deleting and re-creating. Before Carbon 2.0, shares were always deleted and re-created.
ReadAccess parameters to grant full, change, and read sharing permissions on the share. Each parameter takes a list of user/group names. If you don't supply any permissions,
Everyone will get
Read access. Permissions on existing shares are cleared before permissions are granted. Permissions don't apply to the file system, only to the share. Use
Grant-Permission to grant file system permissions.
Before Carbon 2.0, this function was called
|Name||Type||Description||Required?||Pipeline Input||Default Value|
The share's name.
The path to the share.
A description of the share
The identities who have full access to the share.
The identities who have change access to the share.
The identities who have read access to the share
Deletes the share and re-creates it, if it exists. Preserves default beheavior in Carbon before 2.0.
Install-Share -Name TopSecretDocuments -Path C:\TopSecret -Description 'Share for our top secret documents.' -ReadAccess "Everyone" -FullAccess "Analysts"
Shares the C:\TopSecret directory as
TopSecretDocuments and grants
Everyone read access and
Analysts full control.