Skip to content

Commit 60b964d

Browse files
committed
Merge pull request #12 from wastoresh/dev
Fix 4 P1 bugs for Sprint42
2 parents 9080531 + 8ed741e commit 60b964d

9 files changed

+48
-13
lines changed

src/ServiceManagement/Storage/Commands.Storage/Common/Cmdlet/NewAzureStorageContext.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using System;
16+
using System.Globalization;
1617
using System.Management.Automation;
1718
using System.Security.Permissions;
1819
using Microsoft.WindowsAzure.Commands.Common;
@@ -346,7 +347,14 @@ internal CloudStorageAccount GetStorageAccountWithAzureEnvironment(StorageCreden
346347
}
347348
else
348349
{
349-
azureEnvironment = DefaultProfileClient.GetEnvironmentOrDefault(azureEnvironmentName);
350+
try
351+
{
352+
azureEnvironment = DefaultProfileClient.GetEnvironmentOrDefault(azureEnvironmentName);
353+
}
354+
catch (ArgumentException e)
355+
{
356+
throw new ArgumentException(e.Message + " " + string.Format(CultureInfo.CurrentCulture, Resources.ValidEnvironmentName, EnvironmentName.AzureCloud, EnvironmentName.AzureChinaCloud));
357+
}
350358
}
351359

352360
Uri blobEndPoint = azureEnvironment.GetStorageBlobEndpoint(storageAccountName, useHttps);

src/ServiceManagement/Storage/Commands.Storage/File/Cmdlet/NewAzureStorageDirectory.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public class NewAzureStorageDirectory : AzureStorageFileCmdletBase
5050
[Parameter(
5151
Position = 1,
5252
Mandatory = true,
53+
ValueFromPipeline = true,
5354
HelpMessage = "Path of the directory to be created.")]
5455
[ValidateNotNullOrEmpty]
5556
public string Path { get; set; }

src/ServiceManagement/Storage/Commands.Storage/File/Cmdlet/NewAzureStorageShare.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public class NewAzureStorageShare : AzureStorageFileCmdletBase
2222
[Parameter(
2323
Position = 0,
2424
Mandatory = true,
25+
ValueFromPipeline = true,
2526
HelpMessage = "Name of the file share to be created.")]
2627
[ValidateNotNullOrEmpty]
2728
public string Name { get; set; }

src/ServiceManagement/Storage/Commands.Storage/File/Cmdlet/RemoveAzureStorageDirectory.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public class RemoveAzureStorageDirectory : AzureStorageFileCmdletBase
6464
HelpMessage = "Path to the directory to be removed.")]
6565
[Parameter(
6666
Position = 1,
67+
ValueFromPipeline = true,
6768
ParameterSetName = Constants.DirectoryParameterSetName,
6869
HelpMessage = "Path to the directory to be removed.")]
6970
[ValidateNotNullOrEmpty]

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public class RemoveAzureStorageShare : AzureStorageFileCmdletBase
2929
[Parameter(
3030
Position = 0,
3131
Mandatory = true,
32+
ValueFromPipeline = true,
3233
ParameterSetName = Constants.ShareNameParameterSetName,
3334
HelpMessage = "Name of the file share to be removed.")]
3435
[ValidateNotNullOrEmpty]

src/ServiceManagement/Storage/Commands.Storage/File/Cmdlet/SetAzureStorageFileContent.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,11 @@ public class SetAzureStorageFileContent : StorageFileDataManagementCmdletBase
5252
[ValidateNotNull]
5353
public CloudFileDirectory Directory { get; set; }
5454

55+
[Alias("FullName")]
5556
[Parameter(
5657
Position = 1,
5758
Mandatory = true,
59+
ValueFromPipelineByPropertyName = true,
5860
HelpMessage = "Path to the local file to be uploaded.")]
5961
[ValidateNotNullOrEmpty]
6062
public string Source { get; set; }

src/ServiceManagement/Storage/Commands.Storage/Microsoft.WindowsAzure.Commands.Storage.dll-Help.xml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2643,7 +2643,7 @@ echo &quot;Total $total containers&quot;</dev:code>
26432643
<maml:introduction>
26442644
<maml:para></maml:para>
26452645
</maml:introduction>
2646-
<dev:code>PS C:\&gt; Get-AzureStorageFileContent -FileShareName sample -FilePath sampledir/samplefile</dev:code>
2646+
<dev:code>PS C:\&gt; Get-AzureStorageFileContent -ShareName sample -FilePath sampledir/samplefile</dev:code>
26472647
<dev:remarks>
26482648
<maml:para>This example downloads the file whose path is sampledir/samplefile in the sample file share.</maml:para>
26492649
</dev:remarks>
@@ -3039,6 +3039,9 @@ echo &quot;Total $total containers&quot;</dev:code>
30393039
</command:example>
30403040
</command:examples>
30413041
<maml:relatedLinks>
3042+
<maml:navigationLink>
3043+
<maml:uri>http://msdn.microsoft.com/en-us/library/dn806375.aspx</maml:uri>
3044+
</maml:navigationLink>
30423045
</maml:relatedLinks>
30433046
</command:command>
30443047
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
@@ -3209,6 +3212,9 @@ echo &quot;Total $total containers&quot;</dev:code>
32093212
</command:example>
32103213
</command:examples>
32113214
<maml:relatedLinks>
3215+
<maml:navigationLink>
3216+
<maml:uri>http://msdn.microsoft.com/en-us/library/dn806390.aspx</maml:uri>
3217+
</maml:navigationLink>
32123218
</maml:relatedLinks>
32133219
</command:command>
32143220
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
@@ -4125,8 +4131,7 @@ New-AzureStorageBlobSASToken -Container cname -Blob bname -Permission rwd -Start
41254131
</command:examples>
41264132
<maml:relatedLinks>
41274133
<maml:navigationLink>
4128-
<maml:linkText>http://msdn.microsoft.com/en-us/library/windowsazure/dn140255.aspx</maml:linkText>
4129-
<maml:uri></maml:uri>
4134+
<maml:uri>http://msdn.microsoft.com/en-us/library/dn806412.aspx</maml:uri>
41304135
</maml:navigationLink>
41314136
</maml:relatedLinks>
41324137
</command:command>
@@ -4649,8 +4654,7 @@ New-AzureStorageBlobSASToken -Container cname -Blob bname -Permission rwd -Start
46494654
</command:examples>
46504655
<maml:relatedLinks>
46514656
<maml:navigationLink>
4652-
<maml:linkText>http://msdn.microsoft.com/en-us/library/windowsazure/dn140255.aspx</maml:linkText>
4653-
<maml:uri></maml:uri>
4657+
<maml:uri>http://msdn.microsoft.com/en-us/library/dn806416.aspx</maml:uri>
46544658
</maml:navigationLink>
46554659
</maml:relatedLinks>
46564660
</command:command>
@@ -4956,7 +4960,7 @@ New-AzureStorageBlobSASToken -Container cname -Blob bname -Permission rwd -Start
49564960
<maml:name>String</maml:name>
49574961
<maml:uri/>
49584962
</dev:type>
4959-
<dev:defaultValue></dev:defaultValue>
4963+
<dev:defaultValue>AzureCloud | AzureChinaCloud</dev:defaultValue>
49604964
</command:parameter>
49614965
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named">
49624966
<maml:name>ConnectionString</maml:name>
@@ -6041,8 +6045,7 @@ $context | Get-AzureStorageBlob -Container abc</dev:code>
60416045
</command:examples>
60426046
<maml:relatedLinks>
60436047
<maml:navigationLink>
6044-
<maml:linkText>http://msdn.microsoft.com/en-us/library/windowsazure/dn140255.aspx</maml:linkText>
6045-
<maml:uri></maml:uri>
6048+
<maml:uri>http://msdn.microsoft.com/en-us/library/dn806410.aspx</maml:uri>
60466049
</maml:navigationLink>
60476050
</maml:relatedLinks>
60486051
</command:command>
@@ -6893,8 +6896,7 @@ $context | Get-AzureStorageBlob -Container abc</dev:code>
68936896
</command:examples>
68946897
<maml:relatedLinks>
68956898
<maml:navigationLink>
6896-
<maml:linkText>http://msdn.microsoft.com/en-us/library/windowsazure/dn140255.aspx</maml:linkText>
6897-
<maml:uri></maml:uri>
6899+
<maml:uri>http://msdn.microsoft.com/en-us/library/dn806400.aspx</maml:uri>
68986900
</maml:navigationLink>
68996901
</maml:relatedLinks>
69006902
</command:command>
@@ -9482,7 +9484,7 @@ $context | Get-AzureStorageBlob -Container abc</dev:code>
94829484
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="0">
94839485
<maml:name>Name</maml:name>
94849486
<maml:description>
9485-
<maml:para></maml:para>
9487+
<maml:para>The name of the table to be removed.</maml:para>
94869488
</maml:description>
94879489
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
94889490
</command:parameter>
@@ -9527,7 +9529,7 @@ $context | Get-AzureStorageBlob -Container abc</dev:code>
95279529
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="0">
95289530
<maml:name>Name</maml:name>
95299531
<maml:description>
9530-
<maml:para></maml:para>
9532+
<maml:para>The name of the table to be removed.</maml:para>
95319533
</maml:description>
95329534
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
95339535
<dev:type>
@@ -11368,6 +11370,9 @@ Set-AzureStorageBlobContent -File filename -Container containername -Metadata $m
1136811370
</command:example>
1136911371
</command:examples>
1137011372
<maml:relatedLinks>
11373+
<maml:navigationLink>
11374+
<maml:uri>http://msdn.microsoft.com/en-us/library/dn806397.aspx</maml:uri>
11375+
</maml:navigationLink>
1137111376
</maml:relatedLinks>
1137211377
</command:command>
1137311378
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
@@ -11614,6 +11619,9 @@ Set-AzureStorageBlobContent -File filename -Container containername -Metadata $m
1161411619
</command:example>
1161511620
</command:examples>
1161611621
<maml:relatedLinks>
11622+
<maml:navigationLink>
11623+
<maml:uri>http://msdn.microsoft.com/en-us/library/dn806391.aspx</maml:uri>
11624+
</maml:navigationLink>
1161711625
</maml:relatedLinks>
1161811626
</command:command>
1161911627
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">

src/ServiceManagement/Storage/Commands.Storage/Resources.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ServiceManagement/Storage/Commands.Storage/Resources.resx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,4 +661,8 @@ Failed: {2}.</value>
661661
<data name="TransmitCancelled" xml:space="preserve">
662662
<value>Transmit cancelled by user.</value>
663663
</data>
664+
<data name="ValidEnvironmentName" xml:space="preserve">
665+
<value>Valid environment names are: '{0}' and '{1}'</value>
666+
<comment>0 and 1 are for the correct Environment names</comment>
667+
</data>
664668
</root>

0 commit comments

Comments
 (0)