New-AzStorageFileHardLink
Creates a hard link to a file in same share. Only works in NFS file share.
Syntax
ShareName (Default)
New-AzStorageFileHardLink
[-ShareName] <String>
[-Path] <String>
[-TargetFile] <String>
[-TargetFileLeaseId <String>]
[-Context <IStorageContext>]
[-ServerTimeoutPerRequest <Int32>]
[-ClientTimeoutPerRequest <Int32>]
[-DefaultProfile <IAzureContextContainer>]
[-ConcurrentTaskCount <Int32>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Share
New-AzStorageFileHardLink
[-ShareClient] <ShareClient>
[-Path] <String>
[-TargetFile] <String>
[-TargetFileLeaseId <String>]
[-Context <IStorageContext>]
[-ServerTimeoutPerRequest <Int32>]
[-ClientTimeoutPerRequest <Int32>]
[-DefaultProfile <IAzureContextContainer>]
[-ConcurrentTaskCount <Int32>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Directory
New-AzStorageFileHardLink
[-ShareDirectoryClient] <ShareDirectoryClient>
[-Path] <String>
[-TargetFile] <String>
[-TargetFileLeaseId <String>]
[-Context <IStorageContext>]
[-ServerTimeoutPerRequest <Int32>]
[-ClientTimeoutPerRequest <Int32>]
[-DefaultProfile <IAzureContextContainer>]
[-ConcurrentTaskCount <Int32>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The New-AzStorageFileHardLink cmdlet creates a hard link to a file in same share. Only works in NFS file share.
Examples
Example 1: Create a hardlink to a file in same share
New-AzStorageFileHardLink -ShareName "fileshare1" -Path "folder1/link1" -TargetFile "folder2/folder3/file1"
This command creates a hard link with path "folder1/link1" to a file with path "folder2/folder3/file1" in same share.
The new created hardlink will show Length as 0 in Powershell. If you get its properties with Get-AzStorageFile , will get the length of the target file.
Parameters
-ClientTimeoutPerRequest
The client side maximum execution time for each request in seconds.
Parameter properties
Type: Nullable<T> [ Int32 ]
Default value: None
Supports wildcards: False
DontShow: False
Aliases: ClientTimeoutPerRequestInSeconds
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ConcurrentTaskCount
The total amount of concurrent async tasks.
The default value is 10.
Parameter properties
Type: Nullable<T> [ Int32 ]
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
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: cf
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Context
Azure Storage Context Object
Parameter properties
Type: IStorageContext
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: True
Value from remaining arguments: False
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Parameter properties
Type: IAzureContextContainer
Default value: None
Supports wildcards: False
DontShow: False
Aliases: AzureRmContext, AzureCredential
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Path
Path of the hard link to be created.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: 1
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: True
Value from remaining arguments: False
-ServerTimeoutPerRequest
The server time out for each request in seconds.
Parameter properties
Type: Nullable<T> [ Int32 ]
Default value: None
Supports wildcards: False
DontShow: False
Aliases: ServerTimeoutPerRequestInSeconds
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ShareClient
ShareClient object indicated the share where the files/directories would be listed.
Parameter properties
Type: ShareClient
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
Share
Position: 0
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: True
Value from remaining arguments: False
-ShareDirectoryClient
ShareDirectoryClient object indicated the base folder where the files/directories would be listed.
Parameter properties
Parameter sets
Directory
Position: 0
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: True
Value from remaining arguments: False
-ShareName
Name of the file share where the directory would be created.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ShareName
Position: 0
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-TargetFile
Path of the file to create the hard link to, not including the share.
For example:"targetDirectory/targetSubDirectory/.../targetFile".
The target file must be in the same share and hence the same storage account.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: 2
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-TargetFileLeaseId
If the target file has an active lease, specify the lease ID of the target file with 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
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: wi
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
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 .
Outputs