|
| 1 | +--- |
| 2 | +external help file: Microsoft.Azure.PowerShell.Cmdlets.Storage.dll-Help.xml |
| 3 | +Module Name: Az.Storage |
| 4 | +online version: https://learn.microsoft.com/powershell/module/az.storage/rename-azstoragedirectory |
| 5 | +schema: 2.0.0 |
| 6 | +--- |
| 7 | + |
| 8 | +# Rename-AzStorageDirectory |
| 9 | + |
| 10 | +## SYNOPSIS |
| 11 | +Renames a directory. |
| 12 | + |
| 13 | +## SYNTAX |
| 14 | + |
| 15 | +### ShareName |
| 16 | +``` |
| 17 | +Rename-AzStorageDirectory [-ShareName] <String> [-SourcePath] <String> [[-DestinationPath] <String>] |
| 18 | + [-Permission <String>] [-Force] [-AsJob] [-Context <IStorageContext>] |
| 19 | + [-DefaultProfile <IAzureContextContainer>] [-IgnoreReadonly] [<CommonParameters>] |
| 20 | +``` |
| 21 | + |
| 22 | +### ShareObject |
| 23 | +``` |
| 24 | +Rename-AzStorageDirectory [-ShareClient] <ShareClient> [-SourcePath] <String> [[-DestinationPath] <String>] |
| 25 | + [-Permission <String>] [-Force] [-AsJob] [-Context <IStorageContext>] |
| 26 | + [-DefaultProfile <IAzureContextContainer>] [-IgnoreReadonly] [<CommonParameters>] |
| 27 | +``` |
| 28 | + |
| 29 | +### DirecotryObject |
| 30 | +``` |
| 31 | +Rename-AzStorageDirectory [-ShareDirectoryClient] <ShareDirectoryClient> [[-DestinationPath] <String>] |
| 32 | + [-Permission <String>] [-Force] [-AsJob] [-Context <IStorageContext>] |
| 33 | + [-DefaultProfile <IAzureContextContainer>] [-IgnoreReadonly] [<CommonParameters>] |
| 34 | +``` |
| 35 | + |
| 36 | +## DESCRIPTION |
| 37 | +The **Rename-AzStorageDirectory** cmdlet renames a directory from a file share. |
| 38 | + |
| 39 | +## EXAMPLES |
| 40 | + |
| 41 | +### Example 1 : Rename a directory |
| 42 | +```powershell |
| 43 | +Rename-AzStorageDirectory -ShareName myshare -SourcePath testdir1 -DestinationPath testdir2 |
| 44 | +``` |
| 45 | + |
| 46 | +```output |
| 47 | + Directory: https://myaccount.file.core.windows.net/myshare |
| 48 | +
|
| 49 | +Type Length Name |
| 50 | +---- ------ ---- |
| 51 | +Directory 1 testdir2 |
| 52 | +``` |
| 53 | + |
| 54 | +This command renames a directory from testdir1 to testdir2. |
| 55 | + |
| 56 | +### Example 2 : Rename a directory using pipeline |
| 57 | +```powershell |
| 58 | +Get-AzStorageFile -ShareName myshare -Path testdir1 | Rename-AzStorageDirectory -DestinationPath testdir2 |
| 59 | +``` |
| 60 | + |
| 61 | +```output |
| 62 | + Directory: https://myaccount.file.core.windows.net/myshare |
| 63 | +
|
| 64 | +Type Length Name |
| 65 | +---- ------ ---- |
| 66 | +Directory 1 testdir2 |
| 67 | +``` |
| 68 | + |
| 69 | +This command gets a directory from a file share first, and then rename the directory from testdir1 to testdir2 using pipeline. |
| 70 | + |
| 71 | +## PARAMETERS |
| 72 | + |
| 73 | +### -AsJob |
| 74 | +Run cmdlet in the background |
| 75 | + |
| 76 | +```yaml |
| 77 | +Type: System.Management.Automation.SwitchParameter |
| 78 | +Parameter Sets: (All) |
| 79 | +Aliases: |
| 80 | + |
| 81 | +Required: False |
| 82 | +Position: Named |
| 83 | +Default value: None |
| 84 | +Accept pipeline input: False |
| 85 | +Accept wildcard characters: False |
| 86 | +``` |
| 87 | +
|
| 88 | +### -Context |
| 89 | +Azure Storage Context Object |
| 90 | +
|
| 91 | +```yaml |
| 92 | +Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.IStorageContext |
| 93 | +Parameter Sets: (All) |
| 94 | +Aliases: |
| 95 | + |
| 96 | +Required: False |
| 97 | +Position: Named |
| 98 | +Default value: None |
| 99 | +Accept pipeline input: True (ByPropertyName, ByValue) |
| 100 | +Accept wildcard characters: False |
| 101 | +``` |
| 102 | +
|
| 103 | +### -DefaultProfile |
| 104 | +The credentials, account, tenant, and subscription used for communication with Azure. |
| 105 | +
|
| 106 | +```yaml |
| 107 | +Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer |
| 108 | +Parameter Sets: (All) |
| 109 | +Aliases: AzureRmContext, AzureCredential |
| 110 | + |
| 111 | +Required: False |
| 112 | +Position: Named |
| 113 | +Default value: None |
| 114 | +Accept pipeline input: False |
| 115 | +Accept wildcard characters: False |
| 116 | +``` |
| 117 | +
|
| 118 | +### -DestinationPath |
| 119 | +The destination path to rename the directory to. |
| 120 | +
|
| 121 | +```yaml |
| 122 | +Type: System.String |
| 123 | +Parameter Sets: (All) |
| 124 | +Aliases: |
| 125 | + |
| 126 | +Required: False |
| 127 | +Position: 2 |
| 128 | +Default value: None |
| 129 | +Accept pipeline input: False |
| 130 | +Accept wildcard characters: False |
| 131 | +``` |
| 132 | +
|
| 133 | +### -Force |
| 134 | +Force to overwrite the existing file. |
| 135 | +
|
| 136 | +```yaml |
| 137 | +Type: System.Management.Automation.SwitchParameter |
| 138 | +Parameter Sets: (All) |
| 139 | +Aliases: |
| 140 | + |
| 141 | +Required: False |
| 142 | +Position: Named |
| 143 | +Default value: None |
| 144 | +Accept pipeline input: False |
| 145 | +Accept wildcard characters: False |
| 146 | +``` |
| 147 | +
|
| 148 | +### -IgnoreReadonly |
| 149 | +Optional. |
| 150 | +Specifies whether the ReadOnly attribute on a preexisting destination file should be respected. |
| 151 | +If true, the rename will succeed, otherwise, a previous file at the destination with the ReadOnly attribute set will cause the rename to fail. |
| 152 | +
|
| 153 | +```yaml |
| 154 | +Type: System.Management.Automation.SwitchParameter |
| 155 | +Parameter Sets: (All) |
| 156 | +Aliases: |
| 157 | + |
| 158 | +Required: False |
| 159 | +Position: Named |
| 160 | +Default value: None |
| 161 | +Accept pipeline input: False |
| 162 | +Accept wildcard characters: False |
| 163 | +``` |
| 164 | +
|
| 165 | +### -Permission |
| 166 | +If specified the permission (security descriptor) shall be set for the directory/file. |
| 167 | +Default value: Inherit. |
| 168 | +If SDDL is specified as input, it must have owner, group and dacl. |
| 169 | +
|
| 170 | +```yaml |
| 171 | +Type: System.String |
| 172 | +Parameter Sets: (All) |
| 173 | +Aliases: |
| 174 | + |
| 175 | +Required: False |
| 176 | +Position: Named |
| 177 | +Default value: None |
| 178 | +Accept pipeline input: False |
| 179 | +Accept wildcard characters: False |
| 180 | +``` |
| 181 | +
|
| 182 | +### -ShareClient |
| 183 | +ShareClienr indicated the share where the directory would be listed. |
| 184 | +
|
| 185 | +```yaml |
| 186 | +Type: Azure.Storage.Files.Shares.ShareClient |
| 187 | +Parameter Sets: ShareObject |
| 188 | +Aliases: |
| 189 | + |
| 190 | +Required: True |
| 191 | +Position: 0 |
| 192 | +Default value: None |
| 193 | +Accept pipeline input: True (ByPropertyName, ByValue) |
| 194 | +Accept wildcard characters: False |
| 195 | +``` |
| 196 | +
|
| 197 | +### -ShareDirectoryClient |
| 198 | +Source directory instance |
| 199 | +
|
| 200 | +```yaml |
| 201 | +Type: Azure.Storage.Files.Shares.ShareDirectoryClient |
| 202 | +Parameter Sets: DirecotryObject |
| 203 | +Aliases: |
| 204 | + |
| 205 | +Required: True |
| 206 | +Position: 0 |
| 207 | +Default value: None |
| 208 | +Accept pipeline input: True (ByPropertyName, ByValue) |
| 209 | +Accept wildcard characters: False |
| 210 | +``` |
| 211 | +
|
| 212 | +### -ShareName |
| 213 | +Name of the file share where the directory would be listed. |
| 214 | +
|
| 215 | +```yaml |
| 216 | +Type: System.String |
| 217 | +Parameter Sets: ShareName |
| 218 | +Aliases: |
| 219 | + |
| 220 | +Required: True |
| 221 | +Position: 0 |
| 222 | +Default value: None |
| 223 | +Accept pipeline input: False |
| 224 | +Accept wildcard characters: False |
| 225 | +``` |
| 226 | +
|
| 227 | +### -SourcePath |
| 228 | +Path to an existing directory. |
| 229 | +
|
| 230 | +```yaml |
| 231 | +Type: System.String |
| 232 | +Parameter Sets: ShareName, ShareObject |
| 233 | +Aliases: |
| 234 | + |
| 235 | +Required: True |
| 236 | +Position: 1 |
| 237 | +Default value: None |
| 238 | +Accept pipeline input: False |
| 239 | +Accept wildcard characters: False |
| 240 | +``` |
| 241 | +
|
| 242 | +### CommonParameters |
| 243 | +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). |
| 244 | +
|
| 245 | +## INPUTS |
| 246 | +
|
| 247 | +### Azure.Storage.Files.Shares.ShareClient |
| 248 | +
|
| 249 | +### Azure.Storage.Files.Shares.ShareDirectoryClient |
| 250 | +
|
| 251 | +### Microsoft.Azure.Commands.Common.Authentication.Abstractions.IStorageContext |
| 252 | +
|
| 253 | +## OUTPUTS |
| 254 | +
|
| 255 | +### Microsoft.WindowsAzure.Commands.Common.Storage.ResourceModel.AzureStorageFileDirectory |
| 256 | +
|
| 257 | +## NOTES |
| 258 | +
|
| 259 | +## RELATED LINKS |
0 commit comments