你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Rename-AzStorageDirectory
重命名目录。
语法
Rename-AzStorageDirectory
[-ShareName] <String>
[-SourcePath] <String>
[[-DestinationPath] <String>]
[-Permission <String>]
[-DisAllowSourceTrailingDot]
[-DisAllowDestTrailingDot]
[-Force]
[-AsJob]
[-Context <IStorageContext>]
[-DefaultProfile <IAzureContextContainer>]
[-IgnoreReadonly]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Rename-AzStorageDirectory
[-ShareClient] <ShareClient>
[-SourcePath] <String>
[[-DestinationPath] <String>]
[-Permission <String>]
[-Force]
[-AsJob]
[-Context <IStorageContext>]
[-DefaultProfile <IAzureContextContainer>]
[-IgnoreReadonly]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Rename-AzStorageDirectory
[-ShareDirectoryClient] <ShareDirectoryClient>
[[-DestinationPath] <String>]
[-Permission <String>]
[-Force]
[-AsJob]
[-Context <IStorageContext>]
[-DefaultProfile <IAzureContextContainer>]
[-IgnoreReadonly]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
Rename-AzStorageDirectory cmdlet 从文件共享重命名目录。
示例
示例 1:重命名目录
Rename-AzStorageDirectory -ShareName myshare -SourcePath testdir1 -DestinationPath testdir2
AccountName: myaccount, ShareName: myshare
Type Length Name
---- ------ ----
Directory 1 testdir2
此命令将目录从 testdir1 重命名为 testdir2。
示例 2:使用管道重命名目录
Get-AzStorageFile -ShareName myshare -Path testdir1 | Rename-AzStorageDirectory -DestinationPath testdir2
AccountName: myaccount, ShareName: myshare
Type Length Name
---- ------ ----
Directory 1 testdir2
此命令首先从文件共享获取目录,然后使用管道将目录从 testdir1 重命名为 testdir2。
参数
-AsJob
在后台运行 cmdlet
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Confirm
在运行 cmdlet 之前,提示你进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Context
Azure 存储上下文对象
类型: | IStorageContext |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DestinationPath
要重命名目录的目标路径。
类型: | String |
Position: | 2 |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DisAllowDestTrailingDot
禁止尾随点 (.) 后缀目标目录和目标文件名。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DisAllowSourceTrailingDot
禁止尾随点 (.) 以后缀源目录和源文件名称。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Force
强制覆盖现有文件。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-IgnoreReadonly
自选。 指定是否应尊重预先存在的目标文件上的 ReadOnly 属性。 如果为 true,则重命名将成功,否则,目标上一个具有 ReadOnly 属性集的文件将导致重命名失败。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Permission
如果指定了权限(安全描述符),则应为目录/文件设置权限。 默认值:继承。 如果将 SDDL 指定为输入,则它必须具有所有者、组和 dacl。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ShareClient
ShareClienr 指示将列出目录的共享。
类型: | ShareClient |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-ShareDirectoryClient
源目录实例
类型: | ShareDirectoryClient |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-ShareName
要在其中列出目录的文件共享的名称。
类型: | String |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-SourcePath
现有目录的路径。
类型: | String |
Position: | 1 |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-WhatIf
显示 cmdlet 运行时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |