Skip to content

Commit 57a8ff4

Browse files
committed
Merge pull request #59 from Azure/dev
.
2 parents e3c07ec + 6d8bbb3 commit 57a8ff4

File tree

153 files changed

+38943
-4190
lines changed

Some content is hidden

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

153 files changed

+38943
-4190
lines changed

AzurePowershell.Test.targets

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
<TestSettings_x64>.\src\Local.x64.testsettings</TestSettings_x64>
88
<ScenarioTestDebug>.\src\Common\Commands.ScenarioTest\bin\Debug\Microsoft.WindowsAzure.Commands.ScenarioTest.dll</ScenarioTestDebug>
99
<CommonTestDebug>.\src\Common\Commands.Common.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Common.Test.dll</CommonTestDebug>
10-
<BackupTestDebug>.\src\ResourceManager\AzureBackup\Commands.AzureBackup.Test\bin\Debug\Microsoft.Azure.Commands.AzureBackup.Test.dll</BackupTestDebug>
10+
<BackupTestDebug>.\src\ResourceManager\AzureBackup\Commands.AzureBackup.Test\bin\Debug\Microsoft.Azure.Commands.AzureBackup.Test.dll</BackupTestDebug>
11+
<SiteRecoveryTestDebug>.\src\ResourceManager\SiteRecovery\Commands.SiteRecovery.Test\bin\Debug\Microsoft.Azure.Commands.SiteRecovery.Test.dll</SiteRecoveryTestDebug>
1112
<SqlTestDebug>.\src\ResourceManager\Sql\Commands.Sql.Test\bin\Debug\Microsoft.Azure.Commands.Sql.Test.dll</SqlTestDebug>
1213
<ComputeDebug>.\src\ResourceManager\Compute\Commands.Compute.Test\bin\Debug\Microsoft.Azure.Commands.Compute.dll</ComputeDebug>
1314
<ComputeTestDebug>.\src\ResourceManager\Compute\Commands.Compute.Test\bin\Debug\Microsoft.Azure.Commands.Compute.Test.dll</ComputeTestDebug>
@@ -44,6 +45,7 @@
4445

4546
<ItemGroup>
4647
<XUnitTests Include=".\src\ResourceManager\AzureBackup\Commands.AzureBackup.Test\bin\Debug\Microsoft.Azure.Commands.AzureBackup.Test.dll"/>
48+
<XUnitTests Include=".\src\ResourceManager\SiteRecovery\Commands.SiteRecovery.Test\bin\Debug\Microsoft.Azure.Commands.SiteRecovery.Test.dll"/>
4749
<XUnitTests Include=".\src\Common\Commands.Common.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Common.Test.dll"/>
4850
<XUnitTests Include=".\src\ResourceManager\Sql\Commands.Sql.Test\bin\Debug\Microsoft.Azure.Commands.Sql.Test.dll"/>
4951
<XUnitTests Include=".\src\ServiceManagement\Services\Commands.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Test.dll"/>

setup/azurecmdfiles.wxi

Lines changed: 342 additions & 64 deletions
Large diffs are not rendered by default.

src/AzurePowershell.sln

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.AzureBackup", "Res
231231
EndProject
232232
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.AzureBackup.Test", "ResourceManager\AzureBackup\Commands.AzureBackup.Test\Commands.AzureBackup.Test.csproj", "{678AE95D-2364-47D7-888C-3FFA6D412CC8}"
233233
EndProject
234+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.SiteRecovery", "ResourceManager\SiteRecovery\Commands.SiteRecovery\Commands.SiteRecovery.csproj", "{7C879645-31EE-4A78-AD81-5512300FA104}"
235+
EndProject
236+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.SiteRecovery.Test", "ResourceManager\SiteRecovery\Commands.SiteRecovery.Test\Commands.SiteRecovery.Test.csproj", "{6C7D3D81-37AB-445E-8081-78A1FEC0A773}"
237+
EndProject
234238
Global
235239
GlobalSection(SolutionConfigurationPlatforms) = preSolution
236240
Debug|Any CPU = Debug|Any CPU
@@ -573,6 +577,14 @@ Global
573577
{678AE95D-2364-47D7-888C-3FFA6D412CC8}.Debug|Any CPU.Build.0 = Debug|Any CPU
574578
{678AE95D-2364-47D7-888C-3FFA6D412CC8}.Release|Any CPU.ActiveCfg = Release|Any CPU
575579
{678AE95D-2364-47D7-888C-3FFA6D412CC8}.Release|Any CPU.Build.0 = Release|Any CPU
580+
{7C879645-31EE-4A78-AD81-5512300FA104}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
581+
{7C879645-31EE-4A78-AD81-5512300FA104}.Debug|Any CPU.Build.0 = Debug|Any CPU
582+
{7C879645-31EE-4A78-AD81-5512300FA104}.Release|Any CPU.ActiveCfg = Release|Any CPU
583+
{7C879645-31EE-4A78-AD81-5512300FA104}.Release|Any CPU.Build.0 = Release|Any CPU
584+
{6C7D3D81-37AB-445E-8081-78A1FEC0A773}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
585+
{6C7D3D81-37AB-445E-8081-78A1FEC0A773}.Debug|Any CPU.Build.0 = Debug|Any CPU
586+
{6C7D3D81-37AB-445E-8081-78A1FEC0A773}.Release|Any CPU.ActiveCfg = Release|Any CPU
587+
{6C7D3D81-37AB-445E-8081-78A1FEC0A773}.Release|Any CPU.Build.0 = Release|Any CPU
576588
EndGlobalSection
577589
GlobalSection(SolutionProperties) = preSolution
578590
HideSolutionNode = FALSE
@@ -619,5 +631,6 @@ Global
619631
{F220C306-29A3-4511-8518-A58A55C60D07} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
620632
{6448E795-3D02-4BDD-B0C7-AD0A2AFE3C8B} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
621633
{678AE95D-2364-47D7-888C-3FFA6D412CC8} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
634+
{6C7D3D81-37AB-445E-8081-78A1FEC0A773} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
622635
EndGlobalSection
623636
EndGlobal

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,16 @@
103103
<SpecificVersion>False</SpecificVersion>
104104
<HintPath>..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath>
105105
</Reference>
106+
<Reference Include="Microsoft.WindowsAzure.Storage">
107+
<HintPath>..\..\packages\WindowsAzure.Storage.4.0.0\lib\net40\Microsoft.WindowsAzure.Storage.dll</HintPath>
108+
</Reference>
106109
<Reference Include="Newtonsoft.Json">
107110
<HintPath>..\..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
108111
<Private>True</Private>
109112
</Reference>
110113
<Reference Include="System" />
111114
<Reference Include="System.Core" />
115+
<Reference Include="System.IO.Compression.FileSystem" />
112116
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
113117
<Reference Include="System.Net" />
114118
<Reference Include="System.Net.Http" />
@@ -145,6 +149,14 @@
145149
<Compile Include="AzurePowerShell.cs" />
146150
<Compile Include="ComputeCloudException.cs" />
147151
<Compile Include="Constants.cs" />
152+
<Compile Include="Extensions\DSC\DscExtensionCmdletConstants.cs" />
153+
<Compile Include="Extensions\DSC\DscExtensionPrivateSettings.cs" />
154+
<Compile Include="Extensions\DSC\DscExtensionPublicSettings.cs" />
155+
<Compile Include="Extensions\DSC\DscExtensionSettingsSerializer.cs" />
156+
<Compile Include="Extensions\DSC\Exceptions\GetDscResourceException.cs" />
157+
<Compile Include="Extensions\DSC\Publish\ConfigurationParseResult.cs" />
158+
<Compile Include="Extensions\DSC\Publish\ConfigurationParsingHelper.cs" />
159+
<Compile Include="Extensions\DSC\Publish\DscExtensionPublishCmdletCommonBase.cs" />
148160
<Compile Include="SecureStringExtensions.cs" />
149161
<Compile Include="ConversionUtilities.cs" />
150162
<Compile Include="DebugStreamTraceListener.cs" />
@@ -182,13 +194,15 @@
182194
<EmbeddedResource Include="Properties\Resources.resx">
183195
<Generator>PublicResXFileCodeGenerator</Generator>
184196
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
197+
<SubType>Designer</SubType>
185198
</EmbeddedResource>
186199
</ItemGroup>
187200
<ItemGroup>
188201
<None Include="packages.config">
189202
<SubType>Designer</SubType>
190203
</None>
191204
</ItemGroup>
205+
<ItemGroup />
192206
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
193207
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
194208
<Import Project="..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" />
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System;
2+
using System.Collections.Generic;
3+
4+
namespace Microsoft.WindowsAzure.Commands.Common.Extensions.DSC
5+
{
6+
public static class DscExtensionCmdletConstants
7+
{
8+
//common extension constants
9+
internal static readonly string ExtensionPublishedNamespace = "Microsoft.Powershell";
10+
internal static readonly string ExtensionPublishedName = "DSC";
11+
internal const string DefaultContainerName = "windows-powershell-dsc";
12+
13+
internal const int MinMajorPowerShellVersion = 4;
14+
internal const string ZipFileExtension = ".zip";
15+
internal const string Ps1FileExtension = ".ps1";
16+
internal const string Psm1FileExtension = ".psm1";
17+
18+
19+
internal static readonly HashSet<String> UploadArchiveAllowedFileExtensions =
20+
new HashSet<String>(StringComparer.OrdinalIgnoreCase) { Ps1FileExtension, Psm1FileExtension, ZipFileExtension };
21+
internal static readonly HashSet<String> CreateArchiveAllowedFileExtensions =
22+
new HashSet<String>(StringComparer.OrdinalIgnoreCase) { Ps1FileExtension, Psm1FileExtension };
23+
}
24+
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
namespace Microsoft.Azure.Commands.Compute.Extension.DSC
15+
namespace Microsoft.WindowsAzure.Commands.Common.Extensions.DSC
1616
{
17-
1817
using System.Collections;
1918

2019
/// <summary>
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
using System.Collections;
1717
using System.Collections.Generic;
1818

19-
namespace Microsoft.Azure.Commands.Compute.Extension.DSC
19+
namespace Microsoft.WindowsAzure.Commands.Common.Extensions.DSC
2020
{
2121
/// <summary>
2222
/// Represents public settings. Serialized representation of this object stored as a plain text string on the VM.
@@ -40,21 +40,21 @@ internal class Version1
4040
/// <returns></returns>
4141
public DscExtensionPublicSettings ToCurrentVersion()
4242
{
43-
List<Property> properties = new List<Property>();
44-
foreach (DictionaryEntry p in this.Properties)
43+
var properties = new List<Property>();
44+
foreach (DictionaryEntry p in Properties)
4545
{
46-
properties.Add(new Property()
46+
properties.Add(new Property
4747
{
4848
Name = p.Key.ToString(),
4949
TypeName = p.Value.GetType().ToString(),
5050
Value = p.Value
5151
});
5252
}
53-
return new DscExtensionPublicSettings()
53+
return new DscExtensionPublicSettings
5454
{
55-
SasToken = this.SasToken,
56-
ModulesUrl = this.ModulesUrl,
57-
ConfigurationFunction = this.ConfigurationFunction,
55+
SasToken = SasToken,
56+
ModulesUrl = ModulesUrl,
57+
ConfigurationFunction = ConfigurationFunction,
5858
Properties = properties.ToArray(),
5959
ProtocolVersion = new Version(1, 0, 0, 0)
6060
};

src/ResourceManager/Compute/Commands.Compute/Extension/DSC/DscSettingsSerializer.cs renamed to src/Common/Commands.Common/Extensions/DSC/DscExtensionSettingsSerializer.cs

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

15-
15+
using Newtonsoft.Json;
1616
using System;
1717
using System.Collections;
1818
using System.Collections.Generic;
1919
using System.Globalization;
2020
using System.Management.Automation;
2121
using System.Runtime.InteropServices;
2222
using System.Security;
23-
using Newtonsoft.Json;
2423

25-
namespace Microsoft.Azure.Commands.Compute.Extension.DSC
24+
namespace Microsoft.WindowsAzure.Commands.Common.Extensions.DSC
2625
{
27-
public class DscSettingsSerializer
26+
public class DscExtensionSettingsSerializer
2827
{
2928
/// <summary>
30-
/// Serialize DscPublicSettings to string.
29+
/// Serialize DscExtensionPublicSettings to string.
3130
/// </summary>
32-
/// <param name="publicSettings"></param>
31+
/// <param name="extensionPublicSettings"></param>
3332
/// <returns></returns>
34-
public static string SerializePublicSettings(DscExtensionPublicSettings publicSettings)
33+
public static string SerializePublicSettings(DscExtensionPublicSettings extensionPublicSettings)
3534
{
36-
return JsonConvert.SerializeObject(publicSettings);
35+
return JsonConvert.SerializeObject(extensionPublicSettings);
3736
}
3837

3938
/// <summary>
@@ -48,10 +47,10 @@ public static string SerializePrivateSettings(DscExtensionPrivateSettings privat
4847

4948
public static DscExtensionPublicSettings DeserializePublicSettings(string publicSettingsString)
5049
{
51-
DscExtensionPublicSettings publicSettings;
50+
DscExtensionPublicSettings extensionPublicSettings;
5251
try
5352
{
54-
publicSettings = string.IsNullOrEmpty(publicSettingsString)
53+
extensionPublicSettings = string.IsNullOrEmpty(publicSettingsString)
5554
? null
5655
: JsonConvert.DeserializeObject<DscExtensionPublicSettings>(publicSettingsString);
5756
}
@@ -62,14 +61,14 @@ public static DscExtensionPublicSettings DeserializePublicSettings(string public
6261
{
6362
DscExtensionPublicSettings.Version1 publicSettingsV1 =
6463
JsonConvert.DeserializeObject<DscExtensionPublicSettings.Version1>(publicSettingsString);
65-
publicSettings = publicSettingsV1.ToCurrentVersion();
64+
extensionPublicSettings = publicSettingsV1.ToCurrentVersion();
6665
}
6766
catch (JsonException)
6867
{
6968
throw;
7069
}
7170
}
72-
return publicSettings;
71+
return extensionPublicSettings;
7372
}
7473

7574
/// <summary>

src/ResourceManager/Compute/Commands.Compute/Extension/DSC/GetDscResourceException.cs renamed to src/Common/Commands.Common/Extensions/DSC/Exceptions/GetDscResourceException.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
using System;
1616
using System.Globalization;
1717

18-
namespace Microsoft.Azure.Commands.Compute.Extension.DSC
18+
19+
namespace Microsoft.WindowsAzure.Commands.Common.Extensions.DSC.Exceptions
1920
{
2021
[Serializable]
2122
public class GetDscResourceException : UnauthorizedAccessException

src/ResourceManager/Compute/Commands.Compute/Extension/DSC/ConfigurationParseResult.cs renamed to src/Common/Commands.Common/Extensions/DSC/Publish/ConfigurationParseResult.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,16 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
using System;
1615
using System.Collections.Generic;
1716
using System.Management.Automation.Language;
1817

19-
namespace Microsoft.Azure.Commands.Compute.Extension.DSC
18+
namespace Microsoft.WindowsAzure.Commands.Common.Extensions.DSC.Publish
2019
{
2120
public class ConfigurationParseResult
2221
{
2322
public string Path { get; set; }
2423
public ParseError[] Errors { get; set; }
25-
public List<String> RequiredModules { get; set; }
24+
public Dictionary<string,string> RequiredModules { get; set; }
2625

2726
}
2827
}

0 commit comments

Comments
 (0)