Azure / template-specs

MIT License
31 stars 4 forks source link

Get-AzTemplateSpec throws back multiple object types #32

Closed jannickoeben closed 3 years ago

jannickoeben commented 4 years ago

The commandlet Get-AzTemplateSpec does not return a TS version when no version is specified. It even returns a different object. When a version is specified an object of type 'PSTemplateSpecSingleVersion' is returned, with a property called 'version'. When a version is not specified an object of type 'PSTemplateSpecMultiVersion' with a property called 'versions'. Not sure, but I don't think it is appropriate/recommended a commandlet can give back different type of objects. Could be very confusing. One object of type 'PSTemplateSpec' would suffice, if you throw back the latest version by default for example.

Nonetheless, I would like to get the latest version by default when no version is specified, as with AzKeyvaultSecret. Or at least build in a 'latest' switch.

ChristopherGLewis commented 4 years ago

Same issue as https://github.com/Azure/template-specs/issues/27 . Completely agree that this is not proper form for Powershell - for example, Get-AzVirtualNetwork doesn't return different objects if there are 0, 1 or 2+ subnets.

jannickoeben commented 4 years ago

You are right. Overlooked #27. My last comment in OP still applies though

ChristopherGLewis commented 4 years ago

You are right. Overlooked #27. My last comment in OP still applies though

Agreed. Make it work like existing functionality.

stuartko commented 3 years ago

Closing this issue as it has been addressed by the latest release: v0.1.8