Skip to content

Commit be3831a

Browse files
unknownunknown
authored andcommitted
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
Conflicts: src/ServiceManagement/Compute/Commands.ServiceManagement/IaaS/Extensions/VMAccess/SetAzureVMAccessExtension.cs
2 parents f541414 + 8201cb3 commit be3831a

File tree

666 files changed

+143000
-39017
lines changed

Some content is hidden

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

666 files changed

+143000
-39017
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"/>

ChangeLog.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
2015.08.07 version 0.9.6
2+
* Azure Batch cmdlets
3+
* Cmdlets updated to use the general availability API. See http://blogs.technet.com/b/windowshpc/archive/2015/07/10/what-39-s-new-in-azure-batch-july-release-general-availability.aspx
4+
* Breaking changes to cmdlets resulting from API update:
5+
* Workitems have been removed.
6+
* If you were adding all tasks to a single job, use the New-AzureBatchJob cmdlet to directly create your job.
7+
* If you were managing workitems with a recurring schedule defined, use the AzureBatchJobSchedule cmdlets instead.
8+
* If you were using the AzureBatchVM cmdlets, use the AzureBatchComputeNode cmdlets instead.
9+
* The AzureBatchTaskFile and AzureBatchVMFile cmdlets have been consolidated into the AzureBatchNodeFile cmdlets.
10+
* The Name property on most entities has been replaced by an Id property.
11+
112
2015.07.17 version 0.9.5
213
* Azure SQL cmdlets
314
* Allowing to use of Storage V2 accounts in Auditing policies

setup/azurecmdfiles.wxi

Lines changed: 742 additions & 0 deletions
Large diffs are not rendered by default.

src/AzurePowershell.sln

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
22
# Visual Studio 2013
3-
VisualStudioVersion = 12.0.31101.0
3+
VisualStudioVersion = 12.0.30723.0
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8531411A-0137-4E27-9C5E-49E07C245048}"
66
ProjectSection(SolutionItems) = preProject
@@ -28,6 +28,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTest", "Co
2828
ProjectSection(ProjectDependencies) = postProject
2929
{CD5AA507-F5EF-473D-855B-84B91A1ABE54} = {CD5AA507-F5EF-473D-855B-84B91A1ABE54}
3030
{DDF5D225-C9C5-42B7-BDB5-2C3646E479AA} = {DDF5D225-C9C5-42B7-BDB5-2C3646E479AA}
31+
{E895BBDA-0B06-46AB-B909-9B97B3ECE47E} = {E895BBDA-0B06-46AB-B909-9B97B3ECE47E}
3132
EndProjectSection
3233
EndProject
3334
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ServiceManagement", "ServiceManagement\Compute\Commands.ServiceManagement\Commands.ServiceManagement.csproj", "{E1CA72BA-8374-45F6-904D-FD34ECDF5B6F}"
@@ -98,8 +99,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Automation.Test",
9899
EndProject
99100
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.TrafficManager.Test", "ServiceManagement\TrafficManager\Commands.TrafficManager.Test\Commands.TrafficManager.Test.csproj", "{84F99CBD-5B86-4428-B263-135B2F67F512}"
100101
EndProject
101-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.HDInsight", "ServiceManagement\HDInsight\Commands.HDInsight\Commands.HDInsight.csproj", "{137D404A-865A-43DB-930C-6DA67DA048DF}"
102-
EndProject
103102
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.HDInsight.Test", "ServiceManagement\HDInsight\Commands.HDInsight.Test\Commands.HDInsight.Test.csproj", "{7E8D2555-2DDD-4757-974F-D5FFD0647671}"
104103
EndProject
105104
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Tags", "ResourceManager\Tags\Commands.Tags\Commands.Tags.csproj", "{2493A8F7-1949-4F29-8D53-9D459046C3B8}"
@@ -230,6 +229,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.AzureBackup", "Res
230229
EndProject
231230
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.AzureBackup.Test", "ResourceManager\AzureBackup\Commands.AzureBackup.Test\Commands.AzureBackup.Test.csproj", "{678AE95D-2364-47D7-888C-3FFA6D412CC8}"
232231
EndProject
232+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HDInsight", "ServiceManagement\HDInsight\Commands.HDInsight\HDInsight.csproj", "{137D404A-865A-43DB-930C-6DA67DA048DF}"
233+
EndProject
234+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.HDInsight", "ResourceManager\HDInsight\Commands.HDInsight\Commands.HDInsight.csproj", "{6B7540C5-8AB3-4011-864B-0BE76F282F9E}"
235+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.SiteRecovery", "ResourceManager\SiteRecovery\Commands.SiteRecovery\Commands.SiteRecovery.csproj", "{7C879645-31EE-4A78-AD81-5512300FA104}"
236+
EndProject
237+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.SiteRecovery.Test", "ResourceManager\SiteRecovery\Commands.SiteRecovery.Test\Commands.SiteRecovery.Test.csproj", "{6C7D3D81-37AB-445E-8081-78A1FEC0A773}"
238+
EndProject
233239
Global
234240
GlobalSection(SolutionConfigurationPlatforms) = preSolution
235241
Debug|Any CPU = Debug|Any CPU
@@ -364,10 +370,6 @@ Global
364370
{84F99CBD-5B86-4428-B263-135B2F67F512}.Debug|Any CPU.Build.0 = Debug|Any CPU
365371
{84F99CBD-5B86-4428-B263-135B2F67F512}.Release|Any CPU.ActiveCfg = Release|Any CPU
366372
{84F99CBD-5B86-4428-B263-135B2F67F512}.Release|Any CPU.Build.0 = Release|Any CPU
367-
{137D404A-865A-43DB-930C-6DA67DA048DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
368-
{137D404A-865A-43DB-930C-6DA67DA048DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
369-
{137D404A-865A-43DB-930C-6DA67DA048DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
370-
{137D404A-865A-43DB-930C-6DA67DA048DF}.Release|Any CPU.Build.0 = Release|Any CPU
371373
{7E8D2555-2DDD-4757-974F-D5FFD0647671}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
372374
{7E8D2555-2DDD-4757-974F-D5FFD0647671}.Debug|Any CPU.Build.0 = Debug|Any CPU
373375
{7E8D2555-2DDD-4757-974F-D5FFD0647671}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -572,11 +574,28 @@ Global
572574
{678AE95D-2364-47D7-888C-3FFA6D412CC8}.Debug|Any CPU.Build.0 = Debug|Any CPU
573575
{678AE95D-2364-47D7-888C-3FFA6D412CC8}.Release|Any CPU.ActiveCfg = Release|Any CPU
574576
{678AE95D-2364-47D7-888C-3FFA6D412CC8}.Release|Any CPU.Build.0 = Release|Any CPU
577+
{137D404A-865A-43DB-930C-6DA67DA048DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
578+
{137D404A-865A-43DB-930C-6DA67DA048DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
579+
{137D404A-865A-43DB-930C-6DA67DA048DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
580+
{137D404A-865A-43DB-930C-6DA67DA048DF}.Release|Any CPU.Build.0 = Release|Any CPU
581+
{6B7540C5-8AB3-4011-864B-0BE76F282F9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
582+
{6B7540C5-8AB3-4011-864B-0BE76F282F9E}.Debug|Any CPU.Build.0 = Debug|Any CPU
583+
{6B7540C5-8AB3-4011-864B-0BE76F282F9E}.Release|Any CPU.ActiveCfg = Release|Any CPU
584+
{6B7540C5-8AB3-4011-864B-0BE76F282F9E}.Release|Any CPU.Build.0 = Release|Any CPU
585+
{7C879645-31EE-4A78-AD81-5512300FA104}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
586+
{7C879645-31EE-4A78-AD81-5512300FA104}.Debug|Any CPU.Build.0 = Debug|Any CPU
587+
{7C879645-31EE-4A78-AD81-5512300FA104}.Release|Any CPU.ActiveCfg = Release|Any CPU
588+
{7C879645-31EE-4A78-AD81-5512300FA104}.Release|Any CPU.Build.0 = Release|Any CPU
589+
{6C7D3D81-37AB-445E-8081-78A1FEC0A773}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
590+
{6C7D3D81-37AB-445E-8081-78A1FEC0A773}.Debug|Any CPU.Build.0 = Debug|Any CPU
591+
{6C7D3D81-37AB-445E-8081-78A1FEC0A773}.Release|Any CPU.ActiveCfg = Release|Any CPU
592+
{6C7D3D81-37AB-445E-8081-78A1FEC0A773}.Release|Any CPU.Build.0 = Release|Any CPU
575593
EndGlobalSection
576594
GlobalSection(SolutionProperties) = preSolution
577595
HideSolutionNode = FALSE
578596
EndGlobalSection
579597
GlobalSection(NestedProjects) = preSolution
598+
{B7FD03F6-98BC-4F54-9A14-0455E579FCD4} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
580599
{37455286-D8A7-4E0C-8B4D-C517D20C641A} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
581600
{D6F470A6-7395-4B8B-9D29-44DF0EC8F624} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
582601
{A3965B66-5A3E-4B8C-9574-28E5958D4828} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
@@ -587,7 +606,6 @@ Global
587606
{4BC0E3D3-6EDD-43AA-8F15-DCFED8ACC93D} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
588607
{9D5A40CA-5594-4F5C-8230-7ADF7CC0558E} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
589608
{3B48A77B-5956-4A62-9081-92BA04B02B27} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
590-
{B7FD03F6-98BC-4F54-9A14-0455E579FCD4} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
591609
{4C2FE49A-09E1-4979-AD46-CD64FD04C8F7} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
592610
{374D4000-DEDE-4995-9B63-E3B9FE0C4D29} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
593611
{127D0D51-FDEA-4E1A-8CD8-34DEB5C2F7F6} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
@@ -618,5 +636,6 @@ Global
618636
{F220C306-29A3-4511-8518-A58A55C60D07} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
619637
{6448E795-3D02-4BDD-B0C7-AD0A2AFE3C8B} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
620638
{678AE95D-2364-47D7-888C-3FFA6D412CC8} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
639+
{6C7D3D81-37AB-445E-8081-78A1FEC0A773} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
621640
EndGlobalSection
622641
EndGlobal

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

Lines changed: 15 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" />
@@ -159,6 +171,7 @@
159171
<Compile Include="AzurePSCmdlet.cs" />
160172
<Compile Include="CmdletExtensions.cs" />
161173
<Compile Include="ConfigurationConstants.cs" />
174+
<Compile Include="DiagnosticsHelper.cs" />
162175
<Compile Include="ErrorHelper.cs" />
163176
<Compile Include="IdnHelper.cs" />
164177
<Compile Include="ManagementOperationContext.cs" />
@@ -182,13 +195,15 @@
182195
<EmbeddedResource Include="Properties\Resources.resx">
183196
<Generator>PublicResXFileCodeGenerator</Generator>
184197
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
198+
<SubType>Designer</SubType>
185199
</EmbeddedResource>
186200
</ItemGroup>
187201
<ItemGroup>
188202
<None Include="packages.config">
189203
<SubType>Designer</SubType>
190204
</None>
191205
</ItemGroup>
206+
<ItemGroup />
192207
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
193208
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
194209
<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: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.WindowsAzure.Commands.Common.Properties;
16+
using System;
17+
using System.Collections;
18+
using System.IO;
19+
using System.Linq;
20+
using System.Text;
21+
using System.Xml;
22+
using Newtonsoft.Json;
23+
24+
namespace Microsoft.WindowsAzure.Commands.Utilities.Common
25+
{
26+
public static class DiagnosticsHelper
27+
{
28+
private static string XmlNamespace = "http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration";
29+
private static string EncodedXmlCfg = "xmlCfg";
30+
private static string StorageAccount = "storageAccount";
31+
private static string Path = "path";
32+
private static string ExpandResourceDirectory = "expandResourceDirectory";
33+
private static string LocalResourceDirectory = "localResourceDirectory";
34+
private static string StorageAccountNameTag = "storageAccountName";
35+
private static string StorageAccountKeyTag = "storageAccountKey";
36+
private static string StorageAccountEndPointTag = "storageAccountEndPoint";
37+
38+
public static string GetJsonSerializedPublicDiagnosticsConfigurationFromFile(string configurationPath,
39+
string storageAccountName)
40+
{
41+
return
42+
JsonConvert.SerializeObject(
43+
DiagnosticsHelper.GetPublicDiagnosticsConfigurationFromFile(configurationPath, storageAccountName));
44+
}
45+
46+
public static Hashtable GetPublicDiagnosticsConfigurationFromFile(string configurationPath, string storageAccountName)
47+
{
48+
using (StreamReader reader = new StreamReader(configurationPath))
49+
{
50+
return GetPublicDiagnosticsConfiguration(reader.ReadToEnd(), storageAccountName);
51+
}
52+
}
53+
54+
public static Hashtable GetPublicDiagnosticsConfiguration(string config, string storageAccountName)
55+
{
56+
// find the <WadCfg> element and extract it
57+
int wadCfgBeginIndex = config.IndexOf("<WadCfg>");
58+
if (wadCfgBeginIndex == -1)
59+
{
60+
throw new ArgumentException(Resources.IaasDiagnosticsBadConfigNoWadCfg);
61+
}
62+
63+
int wadCfgEndIndex = config.IndexOf("</WadCfg>");
64+
if (wadCfgEndIndex == -1)
65+
{
66+
throw new ArgumentException(Resources.IaasDiagnosticsBadConfigNoEndWadCfg);
67+
}
68+
69+
if (wadCfgEndIndex <= wadCfgBeginIndex)
70+
{
71+
throw new ArgumentException(Resources.IaasDiagnosticsBadConfigNoMatchingWadCfg);
72+
}
73+
74+
string encodedConfiguration = Convert.ToBase64String(
75+
Encoding.UTF8.GetBytes(
76+
config.Substring(
77+
wadCfgBeginIndex, wadCfgEndIndex + "</WadCfg>".Length - wadCfgBeginIndex).ToCharArray()));
78+
79+
// Now extract the local resource directory element
80+
XmlDocument doc = new XmlDocument();
81+
XmlNamespaceManager ns = new XmlNamespaceManager(doc.NameTable);
82+
ns.AddNamespace("ns", XmlNamespace);
83+
doc.LoadXml(config);
84+
var node = doc.SelectSingleNode("//ns:LocalResourceDirectory", ns);
85+
string localDirectory = (node != null && node.Attributes != null) ? node.Attributes[Path].Value : null;
86+
string localDirectoryExpand = (node != null && node.Attributes != null)
87+
? node.Attributes["expandEnvironment"].Value
88+
: null;
89+
if (localDirectoryExpand == "0")
90+
{
91+
localDirectoryExpand = "false";
92+
}
93+
if (localDirectoryExpand == "1")
94+
{
95+
localDirectoryExpand = "true";
96+
}
97+
98+
var hashTable = new Hashtable();
99+
hashTable.Add(EncodedXmlCfg, encodedConfiguration);
100+
hashTable.Add(StorageAccount, storageAccountName);
101+
if (!string.IsNullOrEmpty(localDirectory))
102+
{
103+
var localDirectoryHashTable = new Hashtable();
104+
localDirectoryHashTable.Add(Path, localDirectory);
105+
localDirectoryHashTable.Add(ExpandResourceDirectory, localDirectoryExpand);
106+
hashTable.Add(LocalResourceDirectory, localDirectoryHashTable);
107+
}
108+
109+
return hashTable;
110+
}
111+
112+
public static string GetJsonSerializedPrivateDiagnosticsConfiguration(string storageAccountName,
113+
string storageKey, string endpoint)
114+
{
115+
return JsonConvert.SerializeObject(GetPrivateDiagnosticsConfiguration( storageAccountName, storageKey, endpoint));
116+
}
117+
118+
public static Hashtable GetPrivateDiagnosticsConfiguration(string storageAccountName, string storageKey, string endpoint)
119+
{
120+
var hashTable = new Hashtable();
121+
hashTable.Add(StorageAccountNameTag, storageAccountName);
122+
hashTable.Add(StorageAccountKeyTag, storageKey);
123+
hashTable.Add(StorageAccountEndPointTag, endpoint);
124+
return hashTable;
125+
}
126+
}
127+
}
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+
}

0 commit comments

Comments
 (0)