Skip to content

Commit a8671f0

Browse files
committed
Merge branch 'release-6.0.0' of github.com:Azure/azure-powershell into resources-improvements
# Conflicts: # tools/StaticAnalysis/Exceptions/BreakingChangeIssues.csv # tools/StaticAnalysis/Exceptions/SignatureIssues.csv
2 parents 661bdf0 + 34687a1 commit a8671f0

File tree

575 files changed

+120143
-143523
lines changed

Some content is hidden

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

575 files changed

+120143
-143523
lines changed

src/Common/Commands.Common/AzurePSCmdlet.cs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,50 @@ protected string PSVersion
137137

138138
protected abstract string DataCollectionWarning { get; }
139139

140+
private SessionState _sessionState;
141+
142+
public new SessionState SessionState
143+
{
144+
get
145+
{
146+
return _sessionState;
147+
}
148+
set
149+
{
150+
_sessionState = value;
151+
}
152+
}
153+
154+
private RuntimeDefinedParameterDictionary _asJobDynamicParameters;
155+
156+
public RuntimeDefinedParameterDictionary AsJobDynamicParameters
157+
{
158+
get
159+
{
160+
if (_asJobDynamicParameters == null)
161+
{
162+
_asJobDynamicParameters = new RuntimeDefinedParameterDictionary();
163+
}
164+
return _asJobDynamicParameters;
165+
}
166+
set
167+
{
168+
_asJobDynamicParameters = value;
169+
}
170+
}
171+
140172
/// <summary>
141173
/// Initializes AzurePSCmdlet properties.
142174
/// </summary>
143175
public AzurePSCmdlet()
144176
{
145177
DebugMessages = new ConcurrentQueue<string>();
178+
}
146179

180+
// Register Dynamic Parameters for use in long running jobs
181+
public void RegisterDynamicParameters(RuntimeDefinedParameterDictionary parameters)
182+
{
183+
this.AsJobDynamicParameters = parameters;
147184
}
148185

149186

@@ -252,6 +289,7 @@ protected virtual void TearDownHttpClientPipeline()
252289
/// </summary>
253290
protected override void BeginProcessing()
254291
{
292+
SessionState = base.SessionState;
255293
var profile = _dataCollectionProfile;
256294
//TODO: Inject from CI server
257295
lock (lockObject)

src/ResourceManager/Aks/Commands.Aks/help/AzureRM.Aks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
Module Name: AzureRM.Aks
33
Module Guid: a97e0c3e-e389-46a6-b73d-2b9bd6909bdb
4-
Download Help Link: {{Please enter FwLink manually}}
5-
Help Version: {{Please enter version of help manually (X.X.X.X) format}}
4+
Download Help Link: https://docs.microsoft.com/en-us/powershell/module/azurerm.aks
5+
Help Version: 0.0.1.0
66
Locale: en-US
77
---
88

src/ResourceManager/AnalysisServices/Commands.AnalysisServices.Dataplane/help/Azure.AnalysisServices.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
Module Name: Azure.AnalysisServices
33
Module Guid: c717b5a4-1f1b-4a2f-8aa1-bfd09934626e
4-
Download Help Link: {{Please enter FwLink manually}}
5-
Help Version: {{Please enter version of help manually (X.X.X.X) format}}
4+
Download Help Link: https://docs.microsoft.com/en-us/powershell/module/azure.analysisservices
5+
Help Version: 0.5.0.0
66
Locale: en-US
77
---
88

src/ResourceManager/AnalysisServices/Commands.AnalysisServices/help/AzureRM.AnalysisServices.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
Module Name: AzureRM.AnalysisServices
33
Module Guid: acace26c-1775-4100-85c0-20c4d71eaa21
4-
Download Help Link: None_Azure
4+
Download Help Link: https://docs.microsoft.com/en-us/powershell/module/azurerm.analysisservices
55
Help Version: 0.0.1.0
66
Locale: en-US
77
---

src/ResourceManager/ApiManagement/Commands.ApiManagement/help/AzureRM.ApiManagement.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
Module Name: AzureRM.ApiManagement
33
Module Guid: f875725d-8ce4-423f-a6af-ea880bc63f13
4-
Download Help Link: None
4+
Download Help Link: https://docs.microsoft.com/en-us/powershell/module/azurerm.apimanagement
55
Help Version: 4.0.0.0
66
Locale: en-US
77
---

src/ResourceManager/ApplicationInsights/Commands.ApplicationInsights/help/AzureRM.ApplicationInsights.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
Module Name: AzureRM.ApplicationInsights
33
Module Guid: da67eaa7-4cb1-4bfa-a194-8bf3faae8ac6
4-
Download Help Link: None
5-
Help Version: 0.1.2
4+
Download Help Link: https://docs.microsoft.com/en-us/powershell/module/azurerm.applicationinsights
5+
Help Version: 0.1.2.0
66
Locale: en-US
77
---
88

src/ResourceManager/Automation/Commands.Automation/help/AzureRM.Automation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
Module Name: AzureRM.Automation
33
Module Guid: bcea1c70-a32b-48c3-a05c-323e1c02f4d3
4-
Download Help Link: None_Azure
4+
Download Help Link: https://docs.microsoft.com/en-us/powershell/module/azurerm.automation
55
Help Version: 4.0.0.0
66
Locale: en-US
77
---

src/ResourceManager/AzureBackup/Commands.AzureBackup/help/AzureRM.Backup.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
Module Name: AzureRM.Backup
33
Module Guid: 0b1d76f5-a928-4b8f-9c83-df26947568d4
4-
Download Help Link: {{Please enter FwLink manually}}
5-
Help Version: {{Please enter version of help manually (X.X.X.X) format}}
4+
Download Help Link: https://docs.microsoft.com/en-us/powershell/module/azurerm.backup
5+
Help Version: 4.0.4.0
66
Locale: en-US
77
---
88

src/ResourceManager/AzureBatch/Commands.Batch/help/AzureRM.Batch.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
Module Name: AzureRM.Batch
33
Module Guid: a8f00f40-1c1a-49b5-9db3-24076b75c3cf
4-
Download Help Link: http://go.microsoft.com/fwlink/?linkid=390762
4+
Download Help Link: https://docs.microsoft.com/en-us/powershell/module/azurerm.batch
55
Help Version: 4.0.0.0
66
Locale: en-US
77
---

src/ResourceManager/Billing/Commands.Billing/help/AzureRM.Billing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
Module Name: AzureRM.Billing
33
Module Guid: a1f34ce9-bf46-4180-b36c-be232a1f8f63
4-
Download Help Link:
4+
Download Help Link: https://docs.microsoft.com/en-us/powershell/module/azurerm.billing
55
Help Version: 2.0.0.0
66
Locale: en-US
77
---

src/ResourceManager/Cdn/Commands.Cdn/help/AzureRM.Cdn.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
Module Name: AzureRM.Cdn
33
Module Guid: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
4-
Download Help Link: {{Please enter FwLink manually}}
5-
Help Version: {{Please enter version of help manually (X.X.X.X) format}}
4+
Download Help Link: https://docs.microsoft.com/en-us/powershell/module/azurerm.cdn
5+
Help Version: 4.2.2.0
66
Locale: en-US
77
---
88

src/ResourceManager/CognitiveServices/Commands.Management.CognitiveServices/help/AzureRM.CognitiveServices.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
Module Name: AzureRM.CognitiveServices
33
Module Guid: 66c566b4-950c-4a2b-9f3b-199d92f0df1a
4-
Download Help Link: {{Please enter FwLink manually}}
5-
Help Version: {{Please enter version of help manually (X.X.X.X) format}}
4+
Download Help Link: https://docs.microsoft.com/en-us/powershell/module/azurerm.cognitiveservices
5+
Help Version: 0.9.4.0
66
Locale: en-US
77
---
88

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Threading.Tasks;
4+
using Microsoft.Rest;
5+
using Xunit;
6+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
7+
using System.Threading;
8+
9+
namespace Microsoft.Azure.Commands.Common.Strategies.UnitTest
10+
{
11+
public class AsyncCmdletExtensionsTest
12+
{
13+
class Client : IClient
14+
{
15+
public T GetClient<T>() where T : ServiceClient<T>
16+
=> null;
17+
}
18+
19+
class RG { }
20+
21+
class Parameters : IParameters<RG>
22+
{
23+
public string DefaultLocation => "eastus";
24+
25+
public string Location
26+
{
27+
get
28+
{
29+
return "somelocation";
30+
}
31+
32+
set
33+
{
34+
}
35+
}
36+
37+
public async Task<ResourceConfig<RG>> CreateConfigAsync()
38+
=> new ResourceConfig<RG>(
39+
new ResourceStrategy<RG>(
40+
null,
41+
async (c, p) => new RG(),
42+
null,
43+
null,
44+
null,
45+
false),
46+
null,
47+
null,
48+
null,
49+
null);
50+
}
51+
52+
class AsyncCmdlet : IAsyncCmdlet
53+
{
54+
public CancellationToken CancellationToken { get; }
55+
= new CancellationToken();
56+
57+
public IEnumerable<KeyValuePair<string, object>> Parameters
58+
{
59+
get
60+
{
61+
yield return new KeyValuePair<string, object>("Str", "str");
62+
}
63+
}
64+
65+
public string VerbsNew
66+
{
67+
get
68+
{
69+
throw new NotImplementedException();
70+
}
71+
}
72+
73+
public void ReportTaskProgress(ITaskProgress taskProgress)
74+
{
75+
throw new NotImplementedException();
76+
}
77+
78+
public Task<bool> ShouldProcessAsync(string target, string action)
79+
{
80+
throw new NotImplementedException();
81+
}
82+
83+
public void WriteObject(object value)
84+
{
85+
throw new NotImplementedException();
86+
}
87+
88+
public void WriteVerbose(string message)
89+
{
90+
Assert.Equal("Str = \"str\"", message);
91+
}
92+
}
93+
94+
[Fact]
95+
[Trait(Category.AcceptanceType, Category.CheckIn)]
96+
public async Task TestVerboseStream()
97+
{
98+
var client = new Client();
99+
var parameters = new Parameters();
100+
var asyncCmdlet = new AsyncCmdlet();
101+
102+
await client.RunAsync("subscriptionId", parameters, asyncCmdlet);
103+
}
104+
}
105+
}

src/ResourceManager/Common/Commands.Common.Strategies.UnitTest/Commands.Common.Strategies.UnitTest.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
</Reference>
6565
</ItemGroup>
6666
<ItemGroup>
67+
<Compile Include="AsyncCmdletExtensionsTest.cs" />
6768
<Compile Include="Compute\ImageVersionTest.cs" />
6869
<Compile Include="Properties\AssemblyInfo.cs" />
6970
<Compile Include="TargetStateTest.cs" />

0 commit comments

Comments
 (0)