Skip to content

Commit d6daaa6

Browse files
committed
Resolve conflicts
2 parents c3eb2d0 + 8be69fa commit d6daaa6

File tree

847 files changed

+1109287
-69010
lines changed

Some content is hidden

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

847 files changed

+1109287
-69010
lines changed

build.proj

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,16 @@
7979
<UsingTask TaskName="VerifyAuthenticodeSignatureTask" AssemblyFile="$(BuildTasksPath)\Microsoft.Azure.Build.Tasks.dll" />
8080
<UsingTask TaskName="SmartTestingTask" AssemblyFile="$(BuildTasksPath)\Microsoft.Azure.Build.Tasks.dll" />
8181
<UsingTask TaskName="SetEnvVar" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll" >
82-
<ParameterGroup>
83-
<EnvName ParameterType="System.String" Required="true" />
84-
<EnvValue ParameterType="System.String" Required="true" />
82+
<ParameterGroup>
83+
<EnvName ParameterType="System.String" Required="true" />
84+
<EnvValue ParameterType="System.String" Required="true" />
8585
</ParameterGroup>
8686
<Task>
87-
<Using Namespace="System"/>
88-
<Code Type="Fragment" Language="cs">
89-
<![CDATA[System.Environment.SetEnvironmentVariable(EnvName, EnvValue);]]>
90-
</Code>
91-
</Task>
87+
<Using Namespace="System"/>
88+
<Code Type="Fragment" Language="cs">
89+
<![CDATA[System.Environment.SetEnvironmentVariable(EnvName, EnvValue);]]>
90+
</Code>
91+
</Task>
9292
</UsingTask> <!--
9393
CI build related
9494
-->
@@ -196,17 +196,17 @@
196196
<MakeDir Directories="$(PackageDirectory)" />
197197
<Exec ContinueOnError="false"
198198
Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot; . $(LibraryToolsFolder)\CreateMappings.ps1 -RootPath $(LibrarySourceFolder) -OutputFile $(PackageDirectory)\groupMapping.json -WarningFile $(PackageDirectory)\groupMappingWarnings.json -RulesFile $(LibraryToolsFolder)\CreateMappings_rules.json &quot;" Condition="'$(Latest)' == 'true'"/>
199-
199+
200200
<MSBuild
201201
Projects="@(CmdletSolutionsToBuild)"
202202
Targets="Build"
203203
Properties="Configuration=$(Configuration);Platform=Any CPU"
204204
BuildInParallel="$(BuildInParallel)"
205205
ContinueOnError="false" />
206206

207-
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\GenerateHelp.ps1 -ValidateMarkdownHelp -GenerateMamlHelp -BuildConfig $(Configuration) &quot;"
208-
ContinueOnError="false"
209-
Condition=" '$(SkipHelp)' == 'false' and '$(Latest)' == 'true'"/>
207+
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;$ProgressPreference = 'SilentlyContinue';. $(LibraryToolsFolder)\GenerateHelp.ps1 -ValidateMarkdownHelp -GenerateMamlHelp -BuildConfig $(Configuration) &quot;"
208+
ContinueOnError="false"
209+
Condition=" '$(SkipHelp)' == 'false' and '$(Latest)' == 'true'"/>
210210
<CallTarget Targets="BuildSetupTest"/>
211211
<!-- moved copy tasks -->
212212

@@ -234,7 +234,7 @@
234234
DestinationFolder="$(LibrarySourceFolder)\Package\$(Configuration)"
235235
Condition=" '$(CodeSign)' == 'true' "/>
236236

237-
<CallTarget Targets="CodeSignBinaries" Condition=" '$(CodeSign)' == 'true' " />
237+
<CallTarget Targets="CodeSignBinaries" Condition=" '$(CodeSign)' == 'true' " />
238238

239239

240240
<Copy SourceFiles="$(LibrarySourceFolder)\Package\$(Configuration)\AzureRM.psd1"
@@ -535,4 +535,4 @@
535535
<Message Importance="high" Text="Running live tests..." />
536536
<CallTarget Targets="LiveTests"/>
537537
</Target>
538-
</Project>
538+
</Project>

setup/azurecmd.wxs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
33

4-
<?define productName="Microsoft Azure PowerShell - October 2017" ?>
4+
<?define productName="Microsoft Azure PowerShell - November 2017" ?>
55
<?define sourceDir="$(var.SolutionDir)..\src\Package\$(var.Configuration)" ?>
66
<?define caSourceDir="$(var.SolutionDir)setup\bin\$(var.Configuration)" ?>
77

8-
<?define version="4.4.1" ?>
8+
<?define version="5.0.0" ?>
99

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

setup/azurecmdfiles.wxi

Lines changed: 29 additions & 3834 deletions
Large diffs are not rendered by default.

src/Common/Commands.Common.Authentication.Abstractions/AzureEnvironment.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public class AzureEnvironment : IAzureEnvironment
7777
AzureKeyVaultServiceEndpointResourceId = AzureEnvironmentConstants.ChinaKeyVaultServiceEndpointResourceId,
7878
AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix = null,
7979
AzureDataLakeStoreFileSystemEndpointSuffix = null,
80+
DataLakeEndpointResourceId = null,
8081
GraphEndpointResourceId = AzureEnvironmentConstants.ChinaGraphEndpoint,
8182
BatchEndpointResourceId = AzureEnvironmentConstants.ChinaBatchEndpointResourceId,
8283
AdTenant = "Common"
@@ -102,6 +103,7 @@ public class AzureEnvironment : IAzureEnvironment
102103
AzureKeyVaultServiceEndpointResourceId = AzureEnvironmentConstants.USGovernmentKeyVaultServiceEndpointResourceId,
103104
AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix = null,
104105
AzureDataLakeStoreFileSystemEndpointSuffix = null,
106+
DataLakeEndpointResourceId = null,
105107
GraphEndpointResourceId = AzureEnvironmentConstants.USGovernmentGraphEndpoint,
106108
BatchEndpointResourceId = AzureEnvironmentConstants.USGovernmentBatchEndpointResourceId,
107109
AdTenant = "Common"
@@ -127,6 +129,7 @@ public class AzureEnvironment : IAzureEnvironment
127129
AzureKeyVaultServiceEndpointResourceId = AzureEnvironmentConstants.GermanAzureKeyVaultServiceEndpointResourceId,
128130
AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix = null,
129131
AzureDataLakeStoreFileSystemEndpointSuffix = null,
132+
DataLakeEndpointResourceId = null,
130133
GraphEndpointResourceId = AzureEnvironmentConstants.GermanGraphEndpoint,
131134
BatchEndpointResourceId = AzureEnvironmentConstants.GermanBatchEndpointResourceId,
132135
AdTenant = "Common"

src/Common/Commands.Common/AzurePSDataCollectionProfile.cs renamed to src/Common/Commands.Common.Authentication.Abstractions/AzurePSDataCollectionProfile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
using Newtonsoft.Json;
1616
using System;
1717

18-
namespace Microsoft.WindowsAzure.Commands.Common
18+
namespace Microsoft.Azure.Commands.Common.Authentication.Abstractions
1919
{
2020
public class AzurePSDataCollectionProfile
2121
{

src/Common/Commands.Common.Authentication.Abstractions/Commands.Common.Authentication.Abstractions.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,12 @@
101101
<Compile Include="AuthenticationStore.cs" />
102102
<Compile Include="Authentication\AadAuthenticationException.cs" />
103103
<Compile Include="AzureAccount.cs" />
104+
<Compile Include="AzurePSDataCollectionProfile.cs" />
104105
<Compile Include="AzureRmProfileProvider.cs" />
105106
<Compile Include="AzureSMProfileProvider.cs" />
106107
<Compile Include="ContextSaveMode.cs" />
108+
<Compile Include="DataCollectionController.cs" />
109+
<Compile Include="DiskDataStore.cs" />
107110
<Compile Include="Extensions\AzureAccountExtensions.cs" />
108111
<Compile Include="AzureEnvironmentConstants.cs" />
109112
<Compile Include="Extensions\AzureContextExtensions.cs" />
@@ -157,6 +160,7 @@
157160
<Compile Include="Settings\UserAgentSettings.cs" />
158161
<Compile Include="Settings\HandlerSettings.cs" />
159162
<Compile Include="Properties\AssemblyInfo.cs" />
163+
<Compile Include="Utilities\FileUtilities.cs" />
160164
</ItemGroup>
161165
<ItemGroup>
162166
<None Include="packages.config" />

src/Common/Commands.Common/DataCollectionController.cs renamed to src/Common/Commands.Common.Authentication.Abstractions/DataCollectionController.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
2-
using Microsoft.WindowsAzure.Commands.Common.Properties;
3-
using Newtonsoft.Json;
4-
using System;
5-
using System.IO;
6-
// ----------------------------------------------------------------------------------
1+
// ----------------------------------------------------------------------------------
72
//
83
// Copyright Microsoft Corporation
94
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,7 +12,11 @@
1712
// limitations under the License.
1813
// ----------------------------------------------------------------------------------
1914

20-
namespace Microsoft.WindowsAzure.Commands.Common
15+
using Newtonsoft.Json;
16+
using System;
17+
using System.IO;
18+
19+
namespace Microsoft.Azure.Commands.Common.Authentication.Abstractions
2120
{
2221
public abstract class DataCollectionController
2322
{

src/Common/Commands.Common/DiskDataStore.cs renamed to src/Common/Commands.Common.Authentication.Abstractions/DiskDataStore.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
using Microsoft.Azure.Commands.Common.Authentication;
15+
using Microsoft.Azure.Commands.Common.Authentication.Abstractions.Properties;
1616
using System;
1717
using System.IO;
1818
using System.Security.Cryptography.X509Certificates;
1919
using System.Text;
20-
using Microsoft.WindowsAzure.Commands.Common.Properties;
2120

22-
namespace Microsoft.WindowsAzure.Commands.Common
21+
namespace Microsoft.Azure.Commands.Common.Authentication.Abstractions
2322
{
2423
/// <summary>
2524
/// A ddata store based on the managed windows file system functions (System.IO)
@@ -192,7 +191,11 @@ public X509Certificate2 GetCertificate(string thumbprint)
192191
}
193192
else
194193
{
195-
Validate.ValidateStringIsNullOrEmpty(thumbprint, "certificate thumbprint");
194+
if (string.IsNullOrEmpty(thumbprint))
195+
{
196+
throw new ArgumentException(string.Format(Resources.InvalidOrEmptyArgumentMessage, "certificate thumbprint"));
197+
}
198+
196199
X509Certificate2Collection certificates;
197200
if (TryFindCertificatesInStore(thumbprint, StoreLocation.CurrentUser, out certificates) ||
198201
TryFindCertificatesInStore(thumbprint, StoreLocation.LocalMachine, out certificates))
@@ -212,7 +215,11 @@ public X509Certificate2 GetCertificate(string thumbprint)
212215
/// <param name="cert">The certificate to add</param>
213216
public void AddCertificate(X509Certificate2 certificate)
214217
{
215-
Validate.ValidateNullArgument(certificate, Resources.InvalidCertificate);
218+
if (certificate == null)
219+
{
220+
throw new ArgumentException(Resources.InvalidCertificate);
221+
}
222+
216223
X509StoreWrapper(StoreName.My, StoreLocation.CurrentUser, (store) =>
217224
{
218225
store.Open(OpenFlags.ReadWrite);

src/Common/Commands.Common.Authentication.Abstractions/Extensions/AzureEnvironmentExtensions.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ public static bool TryGetEndpointString(this IAzureEnvironment environment, stri
120120
case AzureEnvironment.Endpoint.AzureDataLakeStoreFileSystemEndpointSuffix:
121121
propertyValue = environment.AzureDataLakeStoreFileSystemEndpointSuffix;
122122
break;
123+
case AzureEnvironment.Endpoint.DataLakeEndpointResourceId:
124+
propertyValue = environment.DataLakeEndpointResourceId;
125+
break;
123126
case AzureEnvironment.Endpoint.ActiveDirectory:
124127
propertyValue = environment.ActiveDirectoryAuthority;
125128
break;
@@ -444,6 +447,10 @@ public static void CopyFrom(this IAzureEnvironment environment, IAzureEnvironmen
444447
environment.AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix =
445448
other.AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix;
446449
}
450+
if (other.IsEndpointSet(AzureEnvironment.Endpoint.DataLakeEndpointResourceId))
451+
{
452+
environment.DataLakeEndpointResourceId = other.DataLakeEndpointResourceId;
453+
}
447454
if (other.IsEndpointSet(AzureEnvironment.Endpoint.AzureKeyVaultServiceEndpointResourceId))
448455
{
449456
environment.AzureKeyVaultServiceEndpointResourceId =
@@ -540,6 +547,10 @@ public static void Update(this IAzureEnvironment environment, IAzureEnvironment
540547
environment.AzureKeyVaultServiceEndpointResourceId =
541548
other.AzureKeyVaultServiceEndpointResourceId;
542549
}
550+
if (other.IsEndpointSet(AzureEnvironment.Endpoint.DataLakeEndpointResourceId))
551+
{
552+
environment.DataLakeEndpointResourceId = other.DataLakeEndpointResourceId;
553+
}
543554

544555
foreach (var profile in other.VersionProfiles)
545556
{

src/Common/Commands.Common.Authentication.Abstractions/Properties/Resources.Designer.cs

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

src/Common/Commands.Common.Authentication.Abstractions/Properties/Resources.resx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,15 @@
129129
<data name="InvalidDnsName" xml:space="preserve">
130130
<value>"{0}" is an invalid DNS name for {1}</value>
131131
</data>
132+
<data name="InvalidOrEmptyArgumentMessage" xml:space="preserve">
133+
<value>{0} is invalid or empty.</value>
134+
</data>
132135
<data name="NoInternetConnection" xml:space="preserve">
133136
<value>Please connect to internet before executing this cmdlet</value>
134137
</data>
138+
<data name="PathDoesNotExist" xml:space="preserve">
139+
<value>Path {0} doesn't exist.</value>
140+
</data>
135141
<data name="ProfileLockReadDisposed" xml:space="preserve">
136142
<value>Attempted to read from the Azure PowerShell context after it was disposed. Please reload the module and try this operation again.</value>
137143
</data>
@@ -180,4 +186,7 @@
180186
<data name="SessionNotInitialized" xml:space="preserve">
181187
<value>The Azure PowerShell session has not been properly initialized. Please import the module and try again.</value>
182188
</data>
189+
<data name="x86InProgramFiles" xml:space="preserve">
190+
<value>(x86)</value>
191+
</data>
183192
</root>

src/Common/Commands.Common/Utilities/FileUtilities.cs renamed to src/Common/Commands.Common.Authentication.Abstractions/Utilities/FileUtilities.cs

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,15 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
using Microsoft.Azure.Commands.Common.Authentication;
16-
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
17-
using Microsoft.Azure.Commands.Common.Authentication.Models;
18-
using Microsoft.WindowsAzure.Commands.Common.Properties;
15+
using Microsoft.Azure.Commands.Common.Authentication.Abstractions.Properties;
1916
using System;
2017
using System.Diagnostics;
2118
using System.IO;
2219
using System.Linq;
2320
using System.Reflection;
2421
using System.Text;
2522

26-
namespace Microsoft.WindowsAzure.Commands.Common
23+
namespace Microsoft.Azure.Commands.Common.Authentication.Abstractions
2724
{
2825
/// <summary>
2926
/// File utilities using the data store
@@ -111,7 +108,7 @@ public static string GetWithProgramFilesPath(string directoryName, bool throwIfN
111108
programFilesPath += Resources.x86InProgramFiles;
112109
if (throwIfNotFound)
113110
{
114-
Validate.ValidateDirectoryExists(Path.Combine(programFilesPath, directoryName));
111+
ValidateDirectoryExists(Path.Combine(programFilesPath, directoryName));
115112
}
116113
return Path.Combine(programFilesPath, directoryName);
117114
}
@@ -120,7 +117,7 @@ public static string GetWithProgramFilesPath(string directoryName, bool throwIfN
120117
programFilesPath = programFilesPath.Replace(Resources.x86InProgramFiles, String.Empty);
121118
if (throwIfNotFound)
122119
{
123-
Validate.ValidateDirectoryExists(Path.Combine(programFilesPath, directoryName));
120+
ValidateDirectoryExists(Path.Combine(programFilesPath, directoryName));
124121
}
125122
return Path.Combine(programFilesPath, directoryName);
126123
}
@@ -167,7 +164,7 @@ public static void DirectoryCopy(string sourceDirName, string destDirName, bool
167164
/// <param name="pathName">The path to the file that will be created</param>
168165
public static void EnsureDirectoryExists(string pathName)
169166
{
170-
Validate.ValidateStringIsNullOrEmpty(pathName, "Settings directory");
167+
ValidateStringIsNullOrEmpty(pathName, "Settings directory");
171168
string directoryPath = Path.GetDirectoryName(pathName);
172169
if (!DataStore.DirectoryExists(directoryPath))
173170
{
@@ -368,5 +365,34 @@ public static string GetModuleFolderName(AzureModule module)
368365
{
369366
return module.ToString().Replace("Azure", "");
370367
}
368+
369+
private static void ValidateDirectoryExists(string directory, string exceptionMessage = null)
370+
{
371+
string msg = string.Format(Resources.PathDoesNotExist, directory);
372+
if (!DataStore.DirectoryExists(directory))
373+
{
374+
if (!string.IsNullOrEmpty(exceptionMessage))
375+
{
376+
msg = exceptionMessage;
377+
}
378+
379+
throw new FileNotFoundException(msg);
380+
}
381+
}
382+
383+
private static void ValidateStringIsNullOrEmpty(string data, string messageData, bool useDefaultMessage = true)
384+
{
385+
if (string.IsNullOrEmpty(data))
386+
{
387+
if (useDefaultMessage)
388+
{
389+
throw new ArgumentException(string.Format(Resources.InvalidOrEmptyArgumentMessage, messageData));
390+
}
391+
else
392+
{
393+
throw new ArgumentException(messageData);
394+
}
395+
}
396+
}
371397
}
372398
}

src/Common/Commands.Common.Authentication/Authentication/KeyStoreApplicationCredentialProvider.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
using Microsoft.IdentityModel.Clients.ActiveDirectory;
1616
using Microsoft.Rest.Azure.Authentication;
17-
using Microsoft.WindowsAzure.Commands.Common;
1817
using System.Security;
1918
using System.Threading.Tasks;
2019

0 commit comments

Comments
 (0)