Skip to content

Commit 0ea27fa

Browse files
author
Maddie Clayton
authored
Merge pull request #6562 from Azure/release-2018-06-29
[6.4.0] Merge release --> master
2 parents 90eecf1 + 53e0edb commit 0ea27fa

File tree

3,111 files changed

+577618
-251812
lines changed

Some content is hidden

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

3,111 files changed

+577618
-251812
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ app.config
2626
*.userprefs
2727
*.sln.docstates
2828
.vscode
29+
*.userosscache
2930

3031
# Build results
3132
[Dd]ebug/
@@ -217,6 +218,8 @@ pingme.txt
217218
groupMapping*.json
218219
/tools/index.json
219220
/Package/index.json
221+
/tools/outputtypes.json
222+
/Package/outputtypes.json
220223

221224
*.msi
222225
*.wixpdb

ChangeLog.md

Lines changed: 216 additions & 141 deletions
Large diffs are not rendered by default.

ModuleMappings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@
7070
],
7171
"src/ResourceManager/DeviceProvisioningServices/": [
7272
"AzureRM.DeviceProvisioningServices"
73+
],
74+
"src/ResourceManager/DevSpaces/": [
75+
"AzureRM.DevSpaces"
7376
],
7477
"src/ResourceManager/DevTestLabs/": [
7578
"AzureRM.DevTestLabs"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ If there is a feature you would like to see in Azure PowerShell, please use the
156156

157157
If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft Azure Projects Contribution Guidelines](https://azure.github.io/guidelines/).
158158

159-
More information about contributing to this repo can be found in [CONTRIBUTING md](https://github.com/Azure/azure-powershell/blob/preview/CONTRIBUTING.md) and the [Azure PowerShell Developer Guide](https://github.com/Azure/azure-powershell/wiki/Azure-Powershell-Developer-Guide) folder.
159+
More information about contributing to this repo can be found in [CONTRIBUTING md](https://github.com/Azure/azure-powershell/blob/preview/CONTRIBUTING.md) and the [Azure PowerShell Developer Guide](https://github.com/Azure/azure-powershell/blob/preview/documentation/development-docs/azure-powershell-developer-guide.md) folder.
160160

161161
## Learn More
162162

TestMappings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@
7676
"src/ResourceManager/DeviceProvisioningServices/": [
7777
".\\src\\ResourceManager\\DeviceProvisioningServices\\Commands.DeviceProvisioningServices.Test\\bin\\Debug\\Microsoft.Azure.Commands.DeviceProvisioningServices.dll"
7878
],
79+
"src/ResourceManager/DevSpaces/": [
80+
".\\src\\ResourceManager\\DevSpaces\\Commands.DevSpaces.Test\\bin\\Debug\\Microsoft.Azure.Commands.DevSpaces.Test.dll"
81+
],
7982
"src/ResourceManager/DevTestLabs/": [],
8083
"src/ResourceManager/Dns/": [
8184
".\\src\\ResourceManager\\Dns\\Commands.Dns.Test\\bin\\Debug\\Microsoft.Azure.Commands.Dns.Test.dll"

build.proj

Lines changed: 259 additions & 155 deletions
Large diffs are not rendered by default.

documentation/Debugging-StaticAnalysis-Errors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ _Note_: Sometimes the error listed in the .csv file can be a false positive (for
4242
We take breaking changes very seriously, so please be mindful about the violations that you suppress in our repo.
4343

4444
### Signature Issues
45-
Signature issues occur when your cmdlets do not follow PowerShell standards. Please check [this page](https://github.com/Azure/azure-powershell/wiki/PowerShell-Cmdlet-Design-Guidelines) to ensure you are following PowerShell guidelines. Issues with severity 0 or 1 must be addressed, while issues with severity 2 are advisory. If you have an issue with severity 0 or 1 that has been approved by the Azure PowerShell team, you can suppress them following these steps:
45+
Signature issues occur when your cmdlets do not follow PowerShell standards. Please check [this page](https://github.com/Azure/azure-powershell/blob/preview/documentation/development-docs/azure-powershell-design-guidelines.md) to ensure you are following PowerShell guidelines. Issues with severity 0 or 1 must be addressed, while issues with severity 2 are advisory. If you have an issue with severity 0 or 1 that has been approved by the Azure PowerShell team, you can suppress them following these steps:
4646

4747
- Download the `SignatureIssues.csv` file from the Jenkins build
4848
- Open the file using a text editor (such as VS Code) and copy each of the errors you'd like to suppress

documentation/breaking-changes/breaking-changes-attribute-help.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ Breaking changes in the cmdlet : Get-SomeObjectA
237237

238238
#### The output return type is changing
239239
```cs
240-
[CmdletOutputBreakingChange(typeof(List<Foo>), ReplacementCmdletOutputTypeName = "Dictionary<String, Foo>")]
241-
[Cmdlet(VerbsCommon.Get, "SomeObjectA"), OutputType(typeof(List<Foo>))]
240+
[CmdletOutputBreakingChange(typeof(Foo), ReplacementCmdletOutputTypeName = "Dictionary<String, Foo>")]
241+
[Cmdlet(VerbsCommon.Get, "SomeObjectA"), OutputType(typeof(Foo))]
242242
public class GetSomeObjectA : AzureRMCmdlet
243243
{
244244
protected override void BeginProcessing()

documentation/breaking-changes/breaking-changes-tool-help.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ When the type of the output is a generic, and one of the arguments of the generi
300300
For example, if we had a cmdlet `Get-SomeObject` that returned a list of `Foo` objects
301301

302302
```cs
303-
[Cmdlet(VerbsCommon.Get, "SomeObject"), OutputType(typeof(List<Foo>))]
303+
[Cmdlet(VerbsCommon.Get, "SomeObject"), OutputType(typeof(Foo))]
304304
public class GetSomeObject : Cmdlet
305305
{
306306
protected override void BeginProcessing()
@@ -313,7 +313,7 @@ public class GetSomeObject : Cmdlet
313313
but it now returns a list of `Bar` objects
314314

315315
```cs
316-
[Cmdlet(VerbsCommon.Get, "SomeObject"), OutputType(typeof(List<Bar>))]
316+
[Cmdlet(VerbsCommon.Get, "SomeObject"), OutputType(typeof(Bar))]
317317
```
318318

319319
the following script will no longer work since we are accessing properties of the `Foo` object that may not be a part of the `Bar` object

documentation/development-docs/generate-format.ps1xml-file.md

Lines changed: 92 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,20 @@ namespace Microsoft.WindowsAzure.Commands.Common.Attributes
136136
All = Table | List,
137137
}
138138

139-
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
139+
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true)]
140140
public sealed class Ps1XmlAttribute : Attribute
141141
{
142142
public string Label { get; set; }
143143

144144
public ViewControl Target { get; set; } = ViewControl.Table;
145+
146+
public string ScriptBlock { get; set; }
147+
148+
public bool GroupByThis { get; set; }
149+
150+
public uint TableColumnWidth { get; set; }
151+
152+
public uint Position { get; set; } = Ps1XmlConstants.DefaultPosition;
145153
}
146154
}
147155

@@ -151,6 +159,8 @@ With the attribute you can specify for a public property (or field) a target vie
151159

152160
# Ps1XmlAttribute attribute usage.
153161

162+
## Properties of primitive types.
163+
154164
Let's say for our example we want to only show these parameters in the output:
155165
* Id
156166
* Name
@@ -215,6 +225,87 @@ namespace Microsoft.Azure.Commands.Profile.Models
215225

216226
* Since the **Ps1Xml attribute** definition is located in the [Commands.Common](https://github.com/Azure/azure-powershell/tree/preview/src/Common/Commands.Common) project and the Command.Common project is likely referenced from your project - to make the attribute visible - you only need to add ```using Microsoft.WindowsAzure.Commands.Common.Attributes;``` statement.
217227
228+
## Properties of complex types.
229+
230+
If you have a property of a complex type, for example, Account of type IAzureAccount:
231+
```Cs
232+
public class PSAzureContext : IAzureContext
233+
{
234+
// code omitted for brevity
235+
236+
public IAzureAccount Account { get; set; }
237+
238+
// code omitted for brevity
239+
}
240+
241+
```
242+
where the IAzureAccount type has its own properties :
243+
244+
```Cs
245+
public interface IAzureAccount : IExtensibleModel
246+
{
247+
string Id { get; set; }
248+
249+
string Credential { get; set; }
250+
251+
string Type { get; set; }
252+
253+
IDictionary<string, string> TenantMap { get; }
254+
}
255+
```
256+
257+
To specify what goes into the table view - use the **ScriptBlock** attribute property. You can use as many attributes as you need to specify all desired complex type properties:
258+
```Cs
259+
public class PSAzureContext : IAzureContext
260+
{
261+
// code omitted for brevity
262+
263+
[Ps1Xml(Label = "Account Id", Target = ViewControl.Table, ScriptBlock = "$_.Account.Id")]
264+
[Ps1Xml(Label = "Account Type", Target = ViewControl.Table, ScriptBlock = "$_.Account.Type")]
265+
public IAzureAccount Account { get; set; }
266+
267+
// code omitted for brevity
268+
}
269+
270+
```
271+
Note: **$_** symbol in PowerShell means the same as **this** key word means in C#.
272+
273+
These two attribute will result in 2 column in the table view:
274+
```Ps
275+
Account Id Account Type
276+
========== ============
277+
```
278+
## GroupBy a property.
279+
280+
If you need to group by a property - use the **GroupByThis** attribute property like this:
281+
```Cs
282+
public class PSAzureSubscription : IAzureSubscription
283+
{
284+
285+
// code omitted for brevity
286+
287+
[Ps1Xml(Label = "Subscription Id", Target = ViewControl.Table, GroupByThis = true)]
288+
public string Id { get; set; }
289+
290+
// code omitted for brevity
291+
```
292+
## Column order.
293+
294+
The column order in the output table will be the same as the order of the properties in the class. If you need to change this behavior - use the **Position** (zero-based) attribute property like this:
295+
```Cs
296+
public class PSAzureSubscription : IAzureSubscription
297+
{
298+
299+
// code omitted for brevity
300+
301+
[Ps1Xml(Label = "Subscription Name", Target = ViewControl.Table, Position = 0)]
302+
public string Name { get; set; }
303+
304+
// code omitted for brevity
305+
```
306+
307+
This will place the column at the very beginning of the table.
308+
218309

219310
# How to generate format.ps1xml file.
220311

0 commit comments

Comments
 (0)