Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.14k stars 3.77k forks source link

[Az.DesktopVirtualization] Get-AzWvdApplication Has a version number in the type #21303

Open JimMoyle opened 1 year ago

JimMoyle commented 1 year ago

Description

The type for the avd application contains a version, if this changes it is a breaking change for any customer scripting which relies on pipelines.

There is a hostpool example below, but it's the same issue for this cmdlet

Issue script & Debug output

function Get-AvdImage {
    [CmdletBinding()]

    Param (
        [Parameter(
            ValuefromPipeline = $true,
            Mandatory = $true
        )]
        [Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20210712.HostPool]$HostPool
        #[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20200712.HostPool]$HostPool #APIVersion change
    )

    begin {
        Set-StrictMode -Version Latest
    } # begin
    process {
        $output = [PSCustomObject]@{
            Name = $HostPool.Name
            Image = $HostPool.VMTemplate | ConvertFrom-Json | Select-Object -ExpandProperty galleryImageOffer
        }

        Write-Output $output

    } # process
    end {} # end
}  #function GetAvdImage

Get-AzWvdHostPool | Get-AvdImage

Environment data

Name                           Value
----                           -----
PSVersion                      7.3.3
PSEdition                      Core
GitCommitId                    7.3.3
OS                             Microsoft Windows 10.0.22621
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module versions

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     2.12.1                Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Script     3.1.1                 Az.DesktopVirtualization            {Disconnect-AzWvdUserSession, Expand-AzWvdMsixImage, Get-AzWvdApplication, Get-AzWvdApplicationGroup…}

Error output

N/A
isra-fel commented 1 year ago

cc @dolauli

isra-fel commented 1 year ago

Thanks for reporting! We agree that this design may cause breaking changes to those customers who use the underlying types directly. We are working on a long term solution to remove api version from the namespace.