Delen via


New-SCStorageFileShare

Creates a storage file share in VMM.

Syntax

NewShareOnWindowsServer

New-SCStorageFileShare
    -StorageFileServer <StorageFileServer>
    -Name <String>
    -LocalPath <String>
    [-VMMServer <ServerConnection>]
    [-Description <String>]
    [-ContinuouslyAvailable <Boolean>]
    [-StorageClassification <StorageClassification>]
    [-RunAsynchronously]
    [-PROTipID <Guid>]
    [-JobVariable <String>]
    [<CommonParameters>]

NewShareFromPoolTiered

New-SCStorageFileShare
    -StorageFileServer <StorageFileServer>
    -Name <String>
    -StoragePool <StoragePool>
    -JobGroup <Guid>
    [-VMMServer <ServerConnection>]
    [-Description <String>]
    [-FileSystem <String>]
    [-DedupMode <DedupMode>]
    [-AllocationUnitSizeKB <UInt32>]
    [-StorageClassification <StorageClassification>]
    [-ReadCacheSizeMB <UInt64>]
    [-RunAsynchronously]
    [-PROTipID <Guid>]
    [-JobVariable <String>]
    [<CommonParameters>]

NewShareOnNASFromPool

New-SCStorageFileShare
    -StorageFileServer <StorageFileServer>
    -Name <String>
    -StoragePool <StoragePool>
    -SizeMB <UInt64>
    [-VMMServer <ServerConnection>]
    [-Description <String>]
    [-FileSystem <String>]
    [-ResiliencySettingName <String>]
    [-NumberOfColumns <UInt16>]
    [-PhysicalDiskRedundancy <UInt16>]
    [-DedupMode <DedupMode>]
    [-AllocationUnitSizeKB <UInt32>]
    [-StorageClassification <StorageClassification>]
    [-RunAsynchronously]
    [-PROTipID <Guid>]
    [-JobVariable <String>]
    [<CommonParameters>]

NewShareFromTieredPool

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

NewShareFromStorageVolume

New-SCStorageFileShare
    -StorageFileServer <StorageFileServer>
    -Name <String>
    -StorageVolume <StorageVolume>
    [-VMMServer <ServerConnection>]
    [-Description <String>]
    [-StorageClassification <StorageClassification>]
    [-RunAsynchronously]
    [-PROTipID <Guid>]
    [-JobVariable <String>]
    [<CommonParameters>]

NewShareOnNASFromHostedPool

New-SCStorageFileShare
    -StorageFileServer <StorageFileServer>
    -Name <String>
    -HostedStoragePool <String>
    -SizeMB <UInt64>
    [-VMMServer <ServerConnection>]
    [-Description <String>]
    [-StorageClassification <StorageClassification>]
    [-RunAsynchronously]
    [-PROTipID <Guid>]
    [-JobVariable <String>]
    [<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.

Parameter properties

Type:UInt32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NewShareFromPoolTiered
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
NewShareOnNASFromPool
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
NewShareFromTieredPool
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ContinuouslyAvailable

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

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NewShareOnWindowsServer
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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

Parameter properties

Type:DedupMode
Default value:None
Accepted values:Disabled, GeneralPurpose, HyperV, Backup, NotAvailable
Supports wildcards:False
DontShow:False

Parameter sets

NewShareFromPoolTiered
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
NewShareOnNASFromPool
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
NewShareFromTieredPool
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Description

Specifies a description for the storage file share.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-FileSystem

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

  • CSVFS_NTFS
  • CSVFS_ReFS

Parameter properties

Type:String
Default value:None
Accepted values:CSVFS_NTFS, CSVFS_ReFS
Supports wildcards:False
DontShow:False

Parameter sets

NewShareFromPoolTiered
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
NewShareOnNASFromPool
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
NewShareFromTieredPool
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-HostedStoragePool

Specifies a hosted storage pool.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NewShareOnNASFromHostedPool
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:Guid
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NewShareFromPoolTiered
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-JobVariable

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-LocalPath

Specifies a local path for a storage file share.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NewShareOnWindowsServer
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-MediaType

Specifies an array of storage physical disk media type objects.

Parameter properties

Type:

StoragePhysicalDiskMediaType[]

Default value:None
Accepted values:Unknown, HDD, SSD
Supports wildcards:False
DontShow:False

Parameter sets

NewShareFromTieredPool
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specifies the name of a VMM object.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NumberOfColumns

Specifies the number of columns for a virtual disk.

Parameter properties

Type:UInt16
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NewShareOnNASFromPool
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
NewShareFromTieredPool
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PhysicalDiskRedundancy

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

Parameter properties

Type:UInt16
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NewShareOnNASFromPool
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
NewShareFromTieredPool
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:Guid
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ReadCacheSizeMB

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

Parameter properties

Type:UInt64
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NewShareFromPoolTiered
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResiliencySettingName

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

  • Simple
  • Mirror
  • Parity

Parameter properties

Type:String
Default value:None
Accepted values:Simple, Mirror, Parity
Supports wildcards:False
DontShow:False

Parameter sets

NewShareOnNASFromPool
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
NewShareFromTieredPool
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RunAsynchronously

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SizeMB

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

Parameter properties

Type:UInt64
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NewShareOnNASFromPool
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
NewShareOnNASFromHostedPool
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-StorageClassification

Specifies a storage classification object.

Parameter properties

Type:StorageClassification
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-StorageFileServer

Specifies a storage file server object.

Parameter properties

Type:StorageFileServer
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-StoragePool

Specifies a storage pool object.

Parameter properties

Type:StoragePool
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NewShareFromPoolTiered
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
NewShareOnNASFromPool
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
NewShareFromTieredPool
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-StorageTierSizeMB

Specifies, in MB, the storage tier size.

Parameter properties

Type:

UInt64[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NewShareFromTieredPool
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-StorageVolume

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

Parameter properties

Type:StorageVolume
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NewShareFromStorageVolume
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-VMMServer

Specifies a VMM server object.

Parameter properties

Type:ServerConnection
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.