Skip to content

Commit 6f20bae

Browse files
authored
Merge pull request #4480 from Azure/release-4.3.1
[Release 4.3.1] Merge release --> master
2 parents 99d490a + aa50349 commit 6f20bae

File tree

279 files changed

+1120
-1252
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

279 files changed

+1120
-1252
lines changed

ChangeLog.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
## 2017.08.07 - Version 4.3.0
1+
## 2017.08.10 - Version 4.3.1
2+
* Update to fix assembly signing issue
3+
4+
## 2017.08.07 - Version 4.3.0
25
* AnalysisServices
36
* Fixed bug in Set-AzureRmAnalysisServciesServer
47
- When admin was not provided, the admin will be removed.

setup/azurecmd.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<?define sourceDir="$(var.SolutionDir)..\src\Package\$(var.Configuration)" ?>
66
<?define caSourceDir="$(var.SolutionDir)setup\bin\$(var.Configuration)" ?>
77

8-
<?define version="4.3.0" ?>
8+
<?define version="4.3.1" ?>
99

1010
<Product Id="*"
1111
Name="$(var.productName)"

setup/azurecmdfiles.wxi

Lines changed: 39 additions & 47 deletions
Large diffs are not rendered by default.

src/Common/Commands.Common.Authorization/Commands.Common.Authorization.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<ProjectGuid>{24508E26-154D-47F1-80EE-439BF0710996}</ProjectGuid>
88
<OutputType>Library</OutputType>
99
<AppDesignerFolder>Properties</AppDesignerFolder>
10-
<RootNamespace>Commands.Common.Authorization</RootNamespace>
11-
<AssemblyName>Commands.Common.Authorization</AssemblyName>
10+
<RootNamespace>Microsoft.Azure.Commands.Common.Authorization</RootNamespace>
11+
<AssemblyName>Microsoft.Azure.Commands.Common.Authorization</AssemblyName>
1212
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
1414
<TargetFrameworkProfile />

src/Common/Commands.Common.Graph.RBAC/ActiveDirectory/ActiveDirectoryBaseCmdlet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
using System;
1818
using System.Management.Automation;
1919
using System.Net;
20-
using ProjectResources = Commands.Common.Graph.RBAC.Properties.Resources;
20+
using ProjectResources = Microsoft.Azure.Commands.Common.Graph.RBAC.Properties.Resources;
2121

2222
namespace Microsoft.Azure.Graph.RBAC.Version1_6.ActiveDirectory
2323
{

src/Common/Commands.Common.Graph.RBAC/ActiveDirectory/ActiveDirectoryClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
using System.Linq;
2626
using System.Net;
2727
using System.Net.Http;
28-
using ProjectResources = Commands.Common.Graph.RBAC.Properties.Resources;
28+
using ProjectResources = Microsoft.Azure.Commands.Common.Graph.RBAC.Properties.Resources;
2929

3030
namespace Microsoft.Azure.Graph.RBAC.Version1_6.ActiveDirectory
3131
{

src/Common/Commands.Common.Graph.RBAC/Commands.Common.Graph.RBAC.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<ProjectGuid>{269ACF73-0A34-42DC-AB9C-4B15931A489D}</ProjectGuid>
88
<OutputType>Library</OutputType>
99
<AppDesignerFolder>Properties</AppDesignerFolder>
10-
<RootNamespace>Commands.Common.Graph.RBAC</RootNamespace>
11-
<AssemblyName>Commands.Common.Graph.RBAC</AssemblyName>
10+
<RootNamespace>Microsoft.Azure.Commands.Common.Graph.RBAC</RootNamespace>
11+
<AssemblyName>Microsoft.Azure.Commands.Common.Graph.RBAC</AssemblyName>
1212
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
1414
<TargetFrameworkProfile />

src/Common/Commands.Common.Graph.RBAC/Properties/Resources.Designer.cs

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

src/Common/Commands.Common.Network/Commands.Common.Network.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<ProjectGuid>{1338F7AE-7111-4ED3-8916-2D0FECC876F4}</ProjectGuid>
88
<OutputType>Library</OutputType>
99
<AppDesignerFolder>Properties</AppDesignerFolder>
10-
<RootNamespace>Commands.Common.Network</RootNamespace>
11-
<AssemblyName>Commands.Common.Network</AssemblyName>
10+
<RootNamespace>Microsoft.Azure.Commands.Common.Network</RootNamespace>
11+
<AssemblyName>Microsoft.Azure.Commands.Common.Network</AssemblyName>
1212
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
1414
<TargetFrameworkProfile />

src/Common/Commands.Common/AzureDataCmdlet.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,21 @@ protected override void SaveDataCollectionProfile()
102102
}
103103

104104
string fileFullPath = Path.Combine(AzureSession.Instance.ProfileDirectory, AzurePSDataCollectionProfile.DefaultFileName);
105-
var contents = JsonConvert.SerializeObject(_dataCollectionProfile);
106-
if (!AzureSession.Instance.DataStore.DirectoryExists(AzureSession.Instance.ProfileDirectory))
105+
try
107106
{
108-
AzureSession.Instance.DataStore.CreateDirectory(AzureSession.Instance.ProfileDirectory);
107+
var contents = JsonConvert.SerializeObject(_dataCollectionProfile);
108+
if (!AzureSession.Instance.DataStore.DirectoryExists(AzureSession.Instance.ProfileDirectory))
109+
{
110+
AzureSession.Instance.DataStore.CreateDirectory(AzureSession.Instance.ProfileDirectory);
111+
}
112+
113+
AzureSession.Instance.DataStore.WriteFile(fileFullPath, contents);
114+
WriteWarning(string.Format(Resources.DataCollectionSaveFileInformation, fileFullPath));
115+
}
116+
catch
117+
{
118+
// do not throw if the profile cannot be written
109119
}
110-
AzureSession.Instance.DataStore.WriteFile(fileFullPath, contents);
111-
WriteWarning(string.Format(Resources.DataCollectionSaveFileInformation, fileFullPath));
112120
}
113121

114122
protected override void SetDataCollectionProfileIfNotExists()

src/Common/Commands.Common/AzurePSCmdlet.cs

Lines changed: 56 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ protected string PSVersion
7373
get
7474
{
7575
if (string.IsNullOrEmpty(_psVersion))
76-
{
77-
if(this.Host != null)
76+
{
77+
if (this.Host != null)
7878
{
7979
_psVersion = this.Host.Version.ToString();
8080
}
@@ -153,19 +153,33 @@ protected static void InitializeDataCollectionProfile()
153153
// If it exists, remove the old AzureDataCollectionProfile.json file
154154
string oldFileFullPath = Path.Combine(AzurePowerShell.ProfileDirectory,
155155
AzurePSDataCollectionProfile.OldDefaultFileName);
156-
if (AzureSession.Instance.DataStore.FileExists(oldFileFullPath))
156+
try
157+
{
158+
if (AzureSession.Instance.DataStore.FileExists(oldFileFullPath))
159+
{
160+
AzureSession.Instance.DataStore.DeleteFile(oldFileFullPath);
161+
}
162+
}
163+
catch
157164
{
158-
AzureSession.Instance.DataStore.DeleteFile(oldFileFullPath);
165+
// do not throw if the old file cannot be deleted
159166
}
160167

161168
// Try and read from the new AzurePSDataCollectionProfile.json file
162169
string fileFullPath = Path.Combine(AzurePowerShell.ProfileDirectory,
163170
AzurePSDataCollectionProfile.DefaultFileName);
164-
if (AzureSession.Instance.DataStore.FileExists(fileFullPath))
171+
try
172+
{
173+
if (AzureSession.Instance.DataStore.FileExists(fileFullPath))
174+
{
175+
string contents = AzureSession.Instance.DataStore.ReadFileAsText(fileFullPath);
176+
_dataCollectionProfile =
177+
JsonConvert.DeserializeObject<AzurePSDataCollectionProfile>(contents);
178+
}
179+
}
180+
catch
165181
{
166-
string contents = AzureSession.Instance.DataStore.ReadFileAsText(fileFullPath);
167-
_dataCollectionProfile =
168-
JsonConvert.DeserializeObject<AzurePSDataCollectionProfile>(contents);
182+
// do not throw if the data collection profile cannot be serialized
169183
}
170184
}
171185

@@ -284,7 +298,7 @@ protected virtual void TearDownDebuggingTraces()
284298

285299
protected virtual void SetupHttpClientPipeline()
286300
{
287-
AzureSession.Instance.ClientFactory.UserAgents.Add(new ProductInfoHeaderValue(ModuleName, string.Format("v{0}", ModuleVersion)));
301+
AzureSession.Instance.ClientFactory.UserAgents.Add(new ProductInfoHeaderValue(ModuleName, string.Format("v{0}", ModuleVersion)));
288302
AzureSession.Instance.ClientFactory.UserAgents.Add(new ProductInfoHeaderValue(PSVERSION, string.Format("v{0}", PSVersion)));
289303

290304
AzureSession.Instance.ClientFactory.AddHandler(
@@ -472,41 +486,48 @@ private void FlushDebugMessages(bool record = false)
472486

473487
private void RecordDebugMessages()
474488
{
475-
// Create 'ErrorRecords' folder under profile directory, if not exists
476-
if (string.IsNullOrEmpty(_errorRecordFolderPath)
477-
|| !Directory.Exists(_errorRecordFolderPath))
489+
try
478490
{
479-
_errorRecordFolderPath = Path.Combine(AzurePowerShell.ProfileDirectory,
480-
"ErrorRecords");
481-
Directory.CreateDirectory(_errorRecordFolderPath);
482-
}
491+
// Create 'ErrorRecords' folder under profile directory, if not exists
492+
if (string.IsNullOrEmpty(_errorRecordFolderPath)
493+
|| !Directory.Exists(_errorRecordFolderPath))
494+
{
495+
_errorRecordFolderPath = Path.Combine(AzurePowerShell.ProfileDirectory,
496+
"ErrorRecords");
497+
Directory.CreateDirectory(_errorRecordFolderPath);
498+
}
483499

484-
CommandInfo cmd = this.MyInvocation.MyCommand;
500+
CommandInfo cmd = this.MyInvocation.MyCommand;
485501

486-
string filePrefix = cmd.Name;
487-
string timeSampSuffix = DateTime.Now.ToString(_fileTimeStampSuffixFormat);
488-
string fileName = filePrefix + "_" + timeSampSuffix + ".log";
489-
string filePath = Path.Combine(_errorRecordFolderPath, fileName);
502+
string filePrefix = cmd.Name;
503+
string timeSampSuffix = DateTime.Now.ToString(_fileTimeStampSuffixFormat);
504+
string fileName = filePrefix + "_" + timeSampSuffix + ".log";
505+
string filePath = Path.Combine(_errorRecordFolderPath, fileName);
490506

491-
StringBuilder sb = new StringBuilder();
492-
sb.Append("Module : ").AppendLine(cmd.ModuleName);
493-
sb.Append("Cmdlet : ").AppendLine(cmd.Name);
507+
StringBuilder sb = new StringBuilder();
508+
sb.Append("Module : ").AppendLine(cmd.ModuleName);
509+
sb.Append("Cmdlet : ").AppendLine(cmd.Name);
494510

495-
sb.AppendLine("Parameters");
496-
foreach (var item in this.MyInvocation.BoundParameters)
497-
{
498-
sb.Append(" -").Append(item.Key).Append(" : ");
499-
sb.AppendLine(item.Value == null ? "null" : item.Value.ToString());
500-
}
511+
sb.AppendLine("Parameters");
512+
foreach (var item in this.MyInvocation.BoundParameters)
513+
{
514+
sb.Append(" -").Append(item.Key).Append(" : ");
515+
sb.AppendLine(item.Value == null ? "null" : item.Value.ToString());
516+
}
517+
518+
sb.AppendLine();
501519

502-
sb.AppendLine();
520+
foreach (var content in DebugMessages)
521+
{
522+
sb.AppendLine(content);
523+
}
503524

504-
foreach (var content in DebugMessages)
525+
AzureSession.Instance.DataStore.WriteFile(filePath, sb.ToString());
526+
}
527+
catch
505528
{
506-
sb.AppendLine(content);
529+
// do not throw an error if recording debug messages fails
507530
}
508-
509-
AzureSession.Instance.DataStore.WriteFile(filePath, sb.ToString());
510531
}
511532

512533
/// <summary>

src/Common/Commands.Common/AzurePowerShell.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ public class AzurePowerShell
2626

2727
public const string AssemblyCopyright = "Copyright © Microsoft";
2828

29-
public const string AssemblyVersion = "4.3.0";
29+
public const string AssemblyVersion = "4.3.1";
3030

31-
public const string AssemblyFileVersion = "4.3.0";
31+
public const string AssemblyFileVersion = "4.3.1";
3232

3333
public const string ProfileFile = "AzureProfile.json";
3434

src/Common/Commands.Common/Commands.Common.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
<Compile Include="Serialization\LegacyAzureSubscription.cs" />
129129
<Compile Include="Serialization\ModelConversionExtensions.cs" />
130130
<Compile Include="Utilities\FileUtilities.cs" />
131+
<Compile Include="Utilities\INetworkHelper.cs" />
131132
<Compile Include="Utilities\JsonUtilities.cs" />
132133
<Compile Include="AzureDataCmdlet.cs" />
133134
<Compile Include="AzurePSCmdlet.cs" />
@@ -148,6 +149,7 @@
148149
<Compile Include="Utilities\ConversionUtilities.cs" />
149150
<Compile Include="DebugStreamTraceListener.cs" />
150151
<Compile Include="Utilities\GeneralUtilities.cs" />
152+
<Compile Include="Utilities\NetworkHelper.cs" />
151153
<Compile Include="Utilities\PowerShellUtilities.cs" />
152154
<Compile Include="RecordingTracingInterceptor.cs" />
153155
<Compile Include="ClientCreatedArgs.cs" />

0 commit comments

Comments
 (0)