New-SCStorageFileShare

Creates a storage file share in VMM.

Syntax

New-SCStorageFileShare [-AllocationUnitSizeKB <UInt32>] [-DedupMode <DedupMode>] [-Description <String>]
 [-FileSystem <String>] [-JobVariable <String>] -Name <String> [-NumberOfColumns <UInt16>] [-PROTipID <Guid>]
 [-PhysicalDiskRedundancy <UInt16>] [-ResiliencySettingName <String>] [-RunAsynchronously] -SizeMB <UInt64>
 [-StorageClassification <StorageClassification>] -StorageFileServer <StorageFileServer>
 -StoragePool <StoragePool> [-VMMServer <ServerConnection>] [<CommonParameters>]
New-SCStorageFileShare [-AllocationUnitSizeKB <UInt32>] [-DedupMode <DedupMode>] [-Description <String>]
 [-FileSystem <String>] -JobGroup <Guid> [-JobVariable <String>] -Name <String> [-PROTipID <Guid>]
 [-ReadCacheSizeMB <UInt64>] [-RunAsynchronously] [-StorageClassification <StorageClassification>]
 -StorageFileServer <StorageFileServer> -StoragePool <StoragePool> [-VMMServer <ServerConnection>]
 [<CommonParameters>]
New-SCStorageFileShare [-AllocationUnitSizeKB <UInt32>] [-DedupMode <DedupMode>] [-Description <String>]
 [-FileSystem <String>] [-JobVariable <String>] -MediaType <StoragePhysicalDiskMediaType[]> -Name <String>
 [-NumberOfColumns <UInt16>] [-PROTipID <Guid>] [-PhysicalDiskRedundancy <UInt16>]
 [-ResiliencySettingName <String>] [-RunAsynchronously] [-StorageClassification <StorageClassification>]
 -StorageFileServer <StorageFileServer> -StoragePool <StoragePool> -StorageTierSizeMB <UInt64[]>
 [-VMMServer <ServerConnection>] [<CommonParameters>]
New-SCStorageFileShare [-ContinuouslyAvailable <Boolean>] [-Description <String>] [-JobVariable <String>]
 -LocalPath <String> -Name <String> [-PROTipID <Guid>] [-RunAsynchronously]
 [-StorageClassification <StorageClassification>] -StorageFileServer <StorageFileServer>
 [-VMMServer <ServerConnection>] [<CommonParameters>]
New-SCStorageFileShare [-Description <String>] -HostedStoragePool <String> [-JobVariable <String>]
 -Name <String> [-PROTipID <Guid>] [-RunAsynchronously] -SizeMB <UInt64>
 [-StorageClassification <StorageClassification>] -StorageFileServer <StorageFileServer>
 [-VMMServer <ServerConnection>] [<CommonParameters>]
New-SCStorageFileShare [-Description <String>] [-JobVariable <String>] -Name <String> [-PROTipID <Guid>]
 [-RunAsynchronously] [-StorageClassification <StorageClassification>] -StorageFileServer <StorageFileServer>
 -StorageVolume <StorageVolume> [-VMMServer <ServerConnection>] [<CommonParameters>]

Description

The New-SCStorageFileShare cmdlet creates a storage file share in Virtual Machine Manager (VMM).

Examples

Example 1: Create a storage file share

PS C:\> $FileServer = Get-SCStorageFileServer -Name "FileServer01.Contoso.com"
PS C:\> New-SCStorageFileShare -Name "FileShare02" -StorageFileServer $FileServer -LocalPath "C:\FileShare02"

The first command gets the storage file server object named FileServer01 and stores the object in the $FileServer variable.

The second command creates a storage file share named FileShare02 on FileServer01.

Example 2: Create a tiered storage file share on a shared SOFS

PS C:\> $FileServer = Get-SCStorageFileServer -Name "FileServer01.Contoso.com"
PS C:\> $StoragePool = Get-SCStoragePool -Name "Pool01"
PS C:\> New-SCStorageTier -MediaType "SSD" -SizeMB 1024  -PhysicalDiskRedundancy "2" -ResiliencySettingName "Mirror" -RunAsynchronously -JobGroup "2e42beba-fb19-4c15-94e6-64a54012dce3"
PS C:\> New-SCStorageTier -MediaType "HDD" -SizeMB 1024  -PhysicalDiskRedundancy "2" -ResiliencySettingName "Parity" -RunAsynchronously -JobGroup "2e42beba-fb19-4c15-94e6-64a54012dce3"
PS C:\> $StorageClassification = Get-SCStorageClassification -Name "Gold"
PS C:\> $StorageFileShare = New-SCStorageFileShare -StorageFileServer $FileServer -StoragePool $StoragePool -Name "FileShare01" -Description "shared SOSF" -RunAsynchronously -JobGroup "2e42beba-fb19-4c15-94e664a54012dce3" -FileSystem "CSVFS_ReFS" -StorageClassification $StorageClassification

The first command gets the storage file server object named FileServer01, and then stores it in the $FileServer variable.

The second command gets the storage pool named Pool01, and then stores it in the $StoragePool variable.

The third and fourth commands create storage tiers.

The fifth command gets the storage classification named Gold, and then stores it in the $StorageClassification variable.

The last command creates tiered file share named FileShare01. The command uses values created in previous commands.

Example 3: Create a tiered storage file share on an S2D system

PS C:\> $FileServer = Get-SCStorageFileServer -Name "FileServer01.Contoso.com"
PS C:\> $StoragePool = Get-SCStoragePool -Name "S2DPool01"
PS C:\> New-SCStorageTier -StorageTierFriendlyName "Performance" -StorageTierSizeInMB 1024 -RunAsynchronously -JobGroup "2e42beba-fb19-4c15-94e6-64a54012dce3"
PS C:\> New-SCStorageTier -StorageTierFriendlyName "Capacity" -StorageTierSizeInMB 1024 -RunAsynchronously -JobGroup "2e42beba-fb19-4c15-94e6-64a54012dce3"
PS C:\> $StorageClassification = Get-SCStorageClassification -Name "Gold"
PS C:\> $StorageFileShare = New-SCStorageFileShare -StorageFileServer $FileServer -StoragePool $StoragePool -Name "FileShare01" -Description "storage spaces direct config" -RunAsynchronously -JobGroup "2e42beba-fb19-4c15-94e664a54012dce3" -FileSystem "CSVFS_ReFS" -StorageClassification $StorageClassification"

The first command gets the storage file server object named FileServer01, and then stores it in the $FileServer variable.

The second command gets the storage pool named S2DPool01, and then stores it in the $StoragePool variable. This is a storage spaces direct pool.

The third and fourth commands create storage tiers.

The fifth command gets the storage classification named Gold, and then stores it in the $StorageClassification variable.

The last command creates tiered file share named FileShare01. The command uses values created in previous commands.

Parameters

-AllocationUnitSizeKB

Specifies the allocation size of a volume, in kilobytes.

Type:UInt32
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ContinuouslyAvailable

Indicates whether the file share is available on a continuous basis.

Type:Boolean
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DedupMode

Apply deduplication on the volume or file share based on the workload. The acceptable values for this parameter are:

- 0 - Disabled

  • 1 - GeneralPurpose
  • 2 - Hyper-V
  • 3 - Backup

Type:DedupMode
Parameter Sets:Disabled, GeneralPurpose, HyperV, Backup, NotAvailable
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Description

Specifies a description for the storage file share.

Type:String
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-FileSystem

Specifies the file system of a storage volume. The acceptable values for this parameter are:

- CSVFS_NTFS

  • CSVFS_ReFS

Type:String
Parameter Sets:CSVFS_NTFS, CSVFS_ReFS
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-HostedStoragePool

Specifies a hosted storage pool.

Type:String
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-JobGroup

Specifies an identifier for a series of commands that will run as a set just before the final command that includes the same job group identifier runs.

Type:Guid
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-JobVariable

Specifies that job progress is tracked and stored in the variable named by this parameter.

Type:String
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-LocalPath

Specifies a local path for a storage file share.

Type:String
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-MediaType

Specifies an array of storage physical disk media type objects.

Type:StoragePhysicalDiskMediaType[]
Parameter Sets:Unknown, HDD, SSD
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Name

Specifies the name of a VMM object.

Type:String
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-NumberOfColumns

Specifies the number of columns for a virtual disk.

Type:UInt16
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

Type:Guid
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PhysicalDiskRedundancy

Specifies the number of physical disk failures a virtual disk can sustain.

Type:UInt16
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ReadCacheSizeMB
Type:UInt64
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResiliencySettingName

Specifies the resiliency setting for a virtual disk. The acceptable values for this parameter are:

- Simple

  • Mirror
  • Parity

Type:String
Parameter Sets:Simple, Mirror, Parity
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SizeMB

Specifies the size, in megabytes, of a storage file share.

Type:UInt64
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-StorageClassification

Specifies a storage classification object.

Type:StorageClassification
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-StorageFileServer

Specifies a storage file server object.

Type:StorageFileServer
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-StoragePool

Specifies a storage pool object.

Type:StoragePool
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-StorageTierSizeMB

Specifies, in MB, the storage tier size.

Type:UInt64[]
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-StorageVolume

Specifies a storage volume object on a specific virtual machine host.

Type:StorageVolume
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-VMMServer

Specifies a VMM server object.

Type:ServerConnection
Required:False
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False