Skip to content

Commit 561f754

Browse files
committed
Update for File Share Snapshot feature per feedback
1 parent f224c14 commit 561f754

File tree

7 files changed

+14
-18
lines changed

7 files changed

+14
-18
lines changed

src/Storage/ChangeLog.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
-->
2020
## Current Release
2121
* Upgrade to Azure Storage Client Library 8.5.0 and Azure Storage DataMovement Library 0.6.3
22-
* Add File Share Snapshot Support
23-
- Get-AzureStorageShare
24-
- Remove-AzureStorageShare
22+
* Add File Share Snapshot Support Feature
23+
- Add 'SnapshotTime' parameter to Get-AzureStorageShare
24+
- Add 'IncludeAllSnapshot' parameter to Remove-AzureStorageShare
2525

2626
## Version 3.4.1
2727

src/Storage/Commands.Storage/Commands.Storage.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
<Reference Include="Microsoft.WindowsAzure.Storage.DataMovement, Version=0.6.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6767
<HintPath>..\..\packages\Microsoft.Azure.Storage.DataMovement.0.6.3\lib\net45\Microsoft.WindowsAzure.Storage.DataMovement.dll</HintPath>
6868
</Reference>
69-
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL" />
7069
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7170
<SpecificVersion>False</SpecificVersion>
7271
</Reference>
@@ -242,7 +241,9 @@
242241
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
243242
</None>
244243
<None Include="MSSharedLibKey.snk" />
245-
<None Include="packages.config" />
244+
<None Include="packages.config">
245+
<SubType>Designer</SubType>
246+
</None>
246247
</ItemGroup>
247248
<ItemGroup>
248249
<EmbeddedResource Include="Resources.resx">

src/Storage/Commands.Storage/File/Cmdlet/GetAzureStorageShare.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class GetAzureStorageShare : AzureStorageFileCmdletBase
2929
Position = 0,
3030
Mandatory = true,
3131
ParameterSetName = Constants.SpecificParameterSetName,
32-
HelpMessage = "Name of the file share to be gotten.")]
32+
HelpMessage = "Name of the file share to be received.")]
3333
[ValidateNotNullOrEmpty]
3434
public string Name { get; set; }
3535

@@ -43,7 +43,7 @@ public class GetAzureStorageShare : AzureStorageFileCmdletBase
4343
Position = 1,
4444
Mandatory = false,
4545
ParameterSetName = Constants.SpecificParameterSetName,
46-
HelpMessage = "Snapshot Time of the file share snapshot to be gotten.")]
46+
HelpMessage = "SnapshotTime of the file share snapshot to be received.")]
4747
[ValidateNotNullOrEmpty]
4848
public DateTimeOffset? SnapshotTime { get; set; }
4949

src/Storage/Commands.Storage/File/Cmdlet/RemoveAzureStorageShare.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,27 +119,23 @@ public override void ExecuteCmdlet()
119119
}
120120
catch (StorageException e)
121121
{
122-
if (e.IsConflictException() && retryDeleteSnapshot)
123-
{
124-
//If x-ms-delete-snapshots is not specified on the request and the share has associated snapshots, the File service returns status code 409 (Conflict).
125-
retryDeleteSnapshot = true;
126-
}
127-
else
122+
//If x-ms-delete-snapshots is not specified on the request and the share has associated snapshots, the File service returns status code 409 (Conflict).
123+
if (!(e.IsConflictException() && retryDeleteSnapshot))
128124
{
129125
throw;
130126
}
131127
}
132128

133129
if (retryDeleteSnapshot)
134130
{
135-
if (force || await OutputStream.ConfirmAsync(string.Format("This share might has snapshots, Remove the share and all snapshots?: {0}", share.Name)).ConfigureAwait(false))
131+
if (force || await OutputStream.ConfirmAsync(string.Format("This share might have snapshots, remove the share and all snapshots?: {0}", share.Name)).ConfigureAwait(false))
136132
{
137133
deleteShareSnapshotsOption = DeleteShareSnapshotsOption.IncludeSnapshots;
138134
await this.Channel.DeleteShareAsync(share, deleteShareSnapshotsOption, null, this.RequestOptions, this.OperationContext, this.CmdletCancellationToken).ConfigureAwait(false);
139135
}
140136
else
141137
{
142-
string result = string.Format("The remove operation of share '{0}' is cancelled.", share.Name);
138+
string result = string.Format("The remove operation of share '{0}' has been cancelled.", share.Name);
143139
OutputStream.WriteVerbose(taskId, result);
144140
}
145141
}

src/Storage/Commands.Storage/help/Get-AzureStorageShare.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ Accept wildcard characters: False
163163
```
164164
165165
### -SnapshotTime
166-
Snapshot Time of the file share snapshot to be gotten.
166+
SnapshotTime of the file share snapshot to be received.
167167
168168
```yaml
169169
Type: DateTimeOffset

src/Storage/Commands.Storage/help/Remove-AzureStorageShare.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ This command removes the file share named ContosoShare06.
4040

4141
### Example 2: Remove a file share and all its snapshots
4242
```
43-
PS C:\>Remove-AzureStorageShare -Name "ContosoShare06" -IncludeSnapshot
43+
PS C:\>Remove-AzureStorageShare -Name "ContosoShare06" -IncludeAllSnapshot
4444
```
4545

4646
This command removes the file share named ContosoShare06 and all its snapshots.

src/Storage/Commands.Storage/packages.config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<package id="Microsoft.Data.OData" version="5.8.2" targetFramework="net452" />
77
<package id="Microsoft.Data.Services.Client" version="5.8.2" targetFramework="net452" />
88
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="1.8.0.0" targetFramework="net452" />
9-
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net452" />
109
<package id="System.ComponentModel.EventBasedAsync" version="4.0.11" targetFramework="net452" />
1110
<package id="System.Dynamic.Runtime" version="4.0.0" targetFramework="net452" />
1211
<package id="System.Linq.Queryable" version="4.0.0" targetFramework="net452" />

0 commit comments

Comments
 (0)