Skip to content

Commit b59f699

Browse files
author
Hovsep Mkrtchyan
committed
Addressed review feedbacks
1 parent 24a6f55 commit b59f699

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/ServiceManagement/Profile/Commands.Profile/Microsoft.WindowsAzure.Commands.Profile.format.ps1xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@
7676
<PropertyName>TenantId</PropertyName>
7777
</ListItem>
7878
<ListItem>
79-
<PropertyName>CurrentStorageAccountName</PropertyName>
79+
<Label>CurrentStorageAccountName</Label>
80+
<ScriptBlock>$_.GetAccountName()</ScriptBlock>
8081
</ListItem>
8182
</ListItems>
8283
</ListEntry>

src/ServiceManagement/Profile/Commands.Profile/Models/PsAzureSubscription.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public PSAzureSubscription(AzureSubscription subscription, AzureSMProfile profil
3434
Accounts = profile.Accounts.Values.Where(a => a.HasSubscription(subscription.Id)).ToArray();
3535
IsDefault = subscription.IsPropertySet(AzureSubscription.Property.Default);
3636
IsCurrent = profile.Context != null && profile.Context.Subscription.Id == subscription.Id;
37-
CurrentStorageAccountName = GetAccountName(subscription.GetProperty(AzureSubscription.Property.StorageAccount));
37+
CurrentStorageAccountName = subscription.GetProperty(AzureSubscription.Property.StorageAccount);
3838
TenantId = subscription.GetPropertyAsArray(AzureSubscription.Property.Tenants).FirstOrDefault();
3939
}
4040

@@ -56,13 +56,13 @@ public PSAzureSubscription(AzureSubscription subscription, AzureSMProfile profil
5656

5757
public string TenantId { get; set; }
5858

59-
public string GetAccountName(string storageAccount)
59+
public string GetAccountName()
6060
{
6161
string accountName = null;
6262

63-
if (!string.IsNullOrWhiteSpace(storageAccount))
63+
if (!string.IsNullOrWhiteSpace(this.CurrentStorageAccountName))
6464
{
65-
accountName = storageAccount.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries)
65+
accountName = this.CurrentStorageAccountName.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries)
6666
.Where(s => s.StartsWith("accountname", StringComparison.OrdinalIgnoreCase))
6767
.Select( s => s.Split(new[] { '=' }, StringSplitOptions.RemoveEmptyEntries).Last())
6868
.FirstOrDefault();

0 commit comments

Comments
 (0)