New-NfsShare

New-NfsShare

Creates an NFS file share.

Syntax

Parameter Set: CreateShare0
New-NfsShare [-Name] <String> [-Path] <String> [[-NetworkName] <String> ] [[-Authentication] <String[]> ] [[-AnonymousUid] <Int32> ] [[-AnonymousGid] <Int32> ] [[-LanguageEncoding] <String> ] [[-EnableAnonymousAccess] <Boolean> ] [[-EnableUnmappedAccess] <Boolean> ] [[-AllowRootAccess] <Boolean> ] [[-Permission] <String> ] [-AsJob] [-CimSession <CimSession[]> ] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The New-NfsShare cmdlet creates a Network File System (NFS) file share. To create a share, you must specify a name and a path. If you do not use the optional parameters for this cmdlet, New-NfsShare assigns default values for these share settings.

If you specify a path to a clustered disk for a new NFS share, this cmdlet creates a highly available clustered share. You can use the NetworkName parameter to scope a share to a specified network name. The network name must belong to the same resource group as the clustered disk. If you do not specify the network name, New-NfsShare assigns an arbitrary network name that is available in the same resource group to scope the share.

Parameters

-AllowRootAccess<Boolean>

Grants the UNIX root user access to a share.

Aliases

none

Required?

false

Position?

10

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-AnonymousGid<Int32>

Specifies the group identifier (GID) that Server for NFS uses for anonymous users who access an NFS share.

Aliases

none

Required?

false

Position?

6

Default Value

-2

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-AnonymousUid<Int32>

Specifies the user identifier (UID) that Server for NFS uses for anonymous users who access an NFS share.

Aliases

none

Required?

false

Position?

5

Default Value

-2

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-AsJob

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Authentication<String[]>

Specifies an array of authentication types that an NFS client can use to access NFS shares.

Valid values are:
-- Sys (AUTH_SYS authentication)
-- Krb5 (Kerberos v5 authentication)
-- Krb5i (Kerberos v5 authentication with integrity checking)
-- Krb5p (Kerberos v5 authentication with privacy)
-- All
-- Default

If you specify All, Server for NFS configures Sys, Krb, Krbi, and Krbp on the share. If you specify Default, Server for NFS configures Sys, Krb, and Krbi on the share.

Aliases

none

Required?

false

Position?

4

Default Value

default

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-CimSession<CimSession[]>

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-EnableAnonymousAccess<Boolean>

Configures an NFS share to allow anonymous users to access it.

Aliases

none

Required?

false

Position?

8

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-EnableUnmappedAccess<Boolean>

Configures an NFS share to allow unmapped UNIX users to access a share by using the UID or GID.

Aliases

none

Required?

false

Position?

9

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-LanguageEncoding<String>

Specifies language encoding to configure on an NFS share. You can use only one language on the share.

Valid values are:
-- Euc-jp (Japanese)
-- Euc-tw (Chinese)
-- Euc-kr (Korean)
-- Shift-jis (Japanese)
-- Big5 (Chinese)
-- Ksc5601 (Korean)
-- Gb2312-80 (Simplified Chinese)
-- Ansi

Aliases

none

Required?

false

Position?

7

Default Value

ansi

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Name<String>

Specifies the name of the NFS share to create.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-NetworkName<String>

Specifies the network name of a share.

For a local share, the network name is the host name. For a server cluster, the network name is the network name in the resource group to which the share is scoped.

This parameter is not required when you create a local share. In the case of a server cluster, specify the client access point. If you do not specify a network name, New-NfsShare assigns a network name that belongs to the same resource group by default.

Aliases

none

Required?

false

Position?

3

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Path<String>

Specifies the path of a new NFS share.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Permission<String>

Configures the type of global ("All Machines") permissions on the NFS share. The acceptable values for this parameter are:
-- Readwrite
-- Readonly
-- No-access

Aliases

none

Required?

false

Position?

11

Default Value

no-access

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ThrottleLimit<Int32>

Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Microsoft.Management.Infrastructure.CimInstance#root/Microsoft/Windows/NFS/MSFT_NfsShare

Examples

Example 1: Create an NFS share for a folder

This command creates an NFS share named NFSshare01 for sharing the folder C:\shares\NFSshare01.

PS C:\> New-NfsShare -Name "NFSshare01" -Path "C:\shares\NFSshare01"

Example 2: Create an NFS share that has unmapped access

This command creates an NFS share named NFSshare01 for sharing the folder C:\shares\ NFSshare01. This command enables unmapped access on the new share and configures Krb5 and Krb5i authentication on the share.

PS C:\> New-NfsShare -Name "NFSshare01" -Path "C:\shares\NFSshare01" -EnableUnmappedAccess $true -Authentication krb5,krb5i

Get-NfsShare

Remove-NfsShare

Set-NfsShare