Skip to content

Commit e660ee6

Browse files
committed
Move DesktopVirtualization 2.0 from generation to master.
1 parent db2bb13 commit e660ee6

File tree

473 files changed

+27867
-5321
lines changed

Some content is hidden

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

473 files changed

+27867
-5321
lines changed

src/DesktopVirtualization/Az.DesktopVirtualization.format.ps1xml

Lines changed: 612 additions & 88 deletions
Large diffs are not rendered by default.

src/DesktopVirtualization/Az.DesktopVirtualization.psd1

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Microsoft Corporation
55
#
6-
# Generated on: 2020-07-16
6+
# Generated on: 2020-11-10
77
#
88

99
@{
@@ -69,21 +69,24 @@ FormatsToProcess = './Az.DesktopVirtualization.format.ps1xml'
6969
# NestedModules = @()
7070

7171
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
72-
FunctionsToExport = 'Disconnect-AzWvdUserSession', 'Get-AzWvdApplication',
73-
'Get-AzWvdApplicationGroup', 'Get-AzWvdDesktop', 'Get-AzWvdHostPool',
72+
FunctionsToExport = 'Disconnect-AzWvdUserSession', 'Expand-AzWvdMsixImage',
73+
'Get-AzWvdApplication', 'Get-AzWvdApplicationGroup',
74+
'Get-AzWvdDesktop', 'Get-AzWvdHostPool', 'Get-AzWvdMsixPackage',
7475
'Get-AzWvdRegistrationInfo', 'Get-AzWvdSessionHost',
7576
'Get-AzWvdStartMenuItem', 'Get-AzWvdUserSession',
7677
'Get-AzWvdWorkspace', 'New-AzWvdApplication',
7778
'New-AzWvdApplicationGroup', 'New-AzWvdHostPool',
78-
'New-AzWvdRegistrationInfo', 'New-AzWvdWorkspace',
79-
'Register-AzWvdApplicationGroup', 'Remove-AzWvdApplication',
80-
'Remove-AzWvdApplicationGroup', 'Remove-AzWvdHostPool',
79+
'New-AzWvdMsixPackage', 'New-AzWvdRegistrationInfo',
80+
'New-AzWvdWorkspace', 'Register-AzWvdApplicationGroup',
81+
'Remove-AzWvdApplication', 'Remove-AzWvdApplicationGroup',
82+
'Remove-AzWvdHostPool', 'Remove-AzWvdMsixPackage',
8183
'Remove-AzWvdRegistrationInfo', 'Remove-AzWvdSessionHost',
8284
'Remove-AzWvdUserSession', 'Remove-AzWvdWorkspace',
8385
'Send-AzWvdUserSessionMessage', 'Unregister-AzWvdApplicationGroup',
8486
'Update-AzWvdApplication', 'Update-AzWvdApplicationGroup',
8587
'Update-AzWvdDesktop', 'Update-AzWvdHostPool',
86-
'Update-AzWvdSessionHost', 'Update-AzWvdWorkspace'
88+
'Update-AzWvdMsixPackage', 'Update-AzWvdSessionHost',
89+
'Update-AzWvdWorkspace'
8790

8891
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
8992
CmdletsToExport = @()
@@ -121,10 +124,7 @@ PrivateData = @{
121124
# IconUri = ''
122125

123126
# ReleaseNotes of this module
124-
ReleaseNotes = '* Require Location property for creating top level arm objects.
125-
* Made `ApplicationGroupType` required for `New-AzWvdApplicationGroup`.
126-
* Made `HostPoolArmPath` required for `New-AzWvdApplicationGroup`.
127-
* Added `PreferredAppGroupType` for `New-AzWvdHostPool`.'
127+
# ReleaseNotes = ''
128128

129129
# Prerelease string of this module
130130
# Prerelease = ''

src/DesktopVirtualization/Az.DesktopVirtualization.psm1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@
2424
}
2525
}
2626
if(-not $accountsModule) {
27-
$hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'1.7.4' } | Measure-Object).Count -gt 0
27+
$hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'1.8.1' } | Measure-Object).Count -gt 0
2828
if($hasAdequateVersion) {
29-
$accountsModule = Import-Module -Name $accountsName -MinimumVersion 1.7.4 -Scope Global -PassThru
29+
$accountsModule = Import-Module -Name $accountsName -MinimumVersion 1.8.1 -Scope Global -PassThru
3030
}
3131
}
3232
}
3333

3434
if(-not $accountsModule) {
35-
Write-Error "`nThis module requires $accountsName version 1.7.4 or greater. For installation instructions, please see: https://docs.microsoft.com/en-us/powershell/azure/install-az-ps" -ErrorAction Stop
36-
} elseif (($accountsModule.Version -lt [System.Version]'1.7.4') -and (-not $localAccounts)) {
37-
Write-Error "`nThis module requires $accountsName version 1.7.4 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to remove '.PSSharedModules' in your home directory. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
35+
Write-Error "`nThis module requires $accountsName version 1.8.1 or greater. For installation instructions, please see: https://docs.microsoft.com/en-us/powershell/azure/install-az-ps" -ErrorAction Stop
36+
} elseif (($accountsModule.Version -lt [System.Version]'1.8.1') -and (-not $localAccounts)) {
37+
Write-Error "`nThis module requires $accountsName version 1.8.1 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to remove '.PSSharedModules' in your home directory. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
3838
}
3939
Write-Information "Loaded Module '$($accountsModule.Name)'"
4040

src/DesktopVirtualization/check-dependencies.ps1

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@ if(-not $Isolated) {
2121
return
2222
}
2323

24-
function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum) {
24+
function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum, [string]$requiredVersion) {
2525
if($predicate) {
2626
$module = Get-Module -ListAvailable -Name $moduleName
2727
if((-not $module) -or ($versionMinimum -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -ge [System.Version]$versionMinimum } | Measure-Object).Count -eq 0)) {
2828
$null = New-Item -ItemType Directory -Force -Path $path
2929
Write-Host -ForegroundColor Green "Installing local $moduleName module into '$path'..."
30-
if($versionMinimum) {
30+
if ($requiredVersion) {
31+
Find-Module -Name $moduleName -RequiredVersion $requiredVersion -Repository PSGallery | Save-Module -Path $path
32+
}elseif($versionMinimum) {
3133
Find-Module -Name $moduleName -MinimumVersion $versionMinimum -Repository PSGallery | Save-Module -Path $path
3234
} else {
3335
Find-Module -Name $moduleName -Repository PSGallery | Save-Module -Path $path
@@ -44,8 +46,8 @@ if(Test-Path -Path $localModulesPath) {
4446
$env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath"
4547
}
4648

47-
DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '1.7.4'
48-
DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -versionMinimum ''
49+
DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '1.8.1'
50+
DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -requiredVersion '4.10.1'
4951

5052
$tools = Join-Path $PSScriptRoot 'tools'
5153
$resourceDir = Join-Path $tools 'Resources'

src/DesktopVirtualization/custom/Get-AzWvdRegistrationInfo.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Get the Windows virtual desktop registration info.
2020
Get the Windows virtual desktop registration info.
2121
#>
2222
function Get-AzWvdRegistrationInfo {
23-
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20191210Preview.RegistrationInfo')]
23+
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20201019Preview.RegistrationInfo')]
2424
[CmdletBinding(PositionalBinding=$false)]
2525
param(
2626
[Parameter()]
@@ -89,7 +89,7 @@ function Get-AzWvdRegistrationInfo {
8989

9090
process {
9191
$hostpool = Az.DesktopVirtualization\Get-AzWvdHostPool @PSBoundParameters
92-
New-Object -TypeName 'Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20191210Preview.RegistrationInfo' `
92+
New-Object -TypeName 'Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20201019Preview.RegistrationInfo' `
9393
-Property @{ `
9494
ExpirationTime = $hostpool.RegistrationInfoExpirationTime; `
9595
RegistrationTokenOperation = $hostpool.RegistrationInfoRegistrationTokenOperation; `
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
function New-AzWvdMsixPackage_PackageAlias {
2+
3+
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20201019Preview.IMsixPackage')]
4+
[CmdletBinding( PositionalBinding = $false, ConfirmImpact = 'Medium')]
5+
param(
6+
[Parameter()]
7+
[Alias('AzureRMContext', 'AzureCredential')]
8+
[ValidateNotNull()]
9+
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Category('Azure')]
10+
[System.Management.Automation.PSObject]
11+
# The credentials, account, tenant, and subscription used for communication with Azure.
12+
${DefaultProfile},
13+
14+
[Parameter(DontShow)]
15+
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Category('Runtime')]
16+
[System.Management.Automation.SwitchParameter]
17+
# Wait for .NET debugger to attach
18+
${Break},
19+
20+
[Parameter(DontShow)]
21+
[ValidateNotNull()]
22+
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Category('Runtime')]
23+
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.SendAsyncStep[]]
24+
# SendAsync Pipeline Steps to be appended to the front of the pipeline
25+
${HttpPipelineAppend},
26+
27+
[Parameter(DontShow)]
28+
[ValidateNotNull()]
29+
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Category('Runtime')]
30+
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.SendAsyncStep[]]
31+
# SendAsync Pipeline Steps to be prepended to the front of the pipeline
32+
${HttpPipelinePrepend},
33+
34+
[Parameter(DontShow)]
35+
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Category('Runtime')]
36+
[System.Uri]
37+
# The URI for the proxy server to use
38+
${Proxy},
39+
40+
[Parameter(DontShow)]
41+
[ValidateNotNull()]
42+
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Category('Runtime')]
43+
[System.Management.Automation.PSCredential]
44+
# Credentials for a proxy server to use for the remote call
45+
${ProxyCredential},
46+
47+
[Parameter(DontShow)]
48+
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Category('Runtime')]
49+
[System.Management.Automation.SwitchParameter]
50+
# Use the default credentials for the proxy
51+
${ProxyUseDefaultCredentials},
52+
53+
# Required to run the command with a specified alias
54+
[Parameter(Mandatory, HelpMessage = 'Subscription Id')]
55+
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Category('Path')]
56+
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.DefaultInfo(Script = '(Get-AzContext).Subscription.Id')]
57+
[System.String]
58+
${SubscriptionId},
59+
60+
[Parameter(Mandatory, HelpMessage = 'Resource Group Name')]
61+
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Category('Path')]
62+
[System.String]
63+
${ResourceGroupName},
64+
65+
[Parameter(Mandatory, HelpMessage = 'HostPool Name')]
66+
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Category('Path')]
67+
[System.String]
68+
${HostPoolName},
69+
70+
[Parameter(Mandatory, HelpMessage = 'Package Alias from extract MSIX Image')]
71+
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Category('Path')]
72+
[System.String]
73+
${PackageAlias},
74+
75+
[Parameter(HelpMessage = 'Is Active')]
76+
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Category('Path')]
77+
[System.Management.Automation.SwitchParameter]
78+
${IsActive},
79+
80+
[Parameter(HelpMessage = 'Is Regular Registration')]
81+
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Category('Path')]
82+
[System.Management.Automation.SwitchParameter]
83+
${IsRegularRegistration},
84+
85+
[Parameter(HelpMessage = 'Package Display Name')]
86+
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Category('Path')]
87+
[System.String]
88+
${DisplayName},
89+
90+
# needed to run Expand MSIX Image
91+
[Parameter(HelpMessage = 'Image Path to CIM/VHD')]
92+
[Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Category('Path')]
93+
[System.String]
94+
${ImagePath}
95+
)
96+
97+
process {
98+
$saveHostPoolName = $null
99+
if ($PSBoundParameters.ContainsKey("HostPoolName")) {
100+
$saveHostPoolName = $PSBoundParameters["HostPoolName"]
101+
}
102+
$saveResourceGroupName = $null
103+
if ($PSBoundParameters.ContainsKey("ResourceGroupName")) {
104+
$saveResourceGroupName = $PSBoundParameters["ResourceGroupName"]
105+
}
106+
$saveSubscriptionId = $null
107+
if ($PSBoundParameters.ContainsKey("SubscriptionId")) {
108+
$saveSubscriptionId = $PSBoundParameters["SubscriptionId"]
109+
}
110+
$savePackageAlias = $null
111+
if ($PSBoundParameters.ContainsKey("PackageAlias")) {
112+
$savePackageAlias = $PSBoundParameters["PackageAlias"]
113+
}
114+
$saveImagePath = $null
115+
if ($PSBoundParameters.ContainsKey("ImagePath")) {
116+
$saveImagePath = $PSBoundParameters["ImagePath"]
117+
}
118+
119+
$saveDisplayName = $null
120+
if ($PSBoundParameters.ContainsKey("DisplayName")) {
121+
$saveDisplayName = $PSBoundParameters["DisplayName"]
122+
}
123+
124+
# clear
125+
$null = $PSBoundParameters.Remove("HostPoolName")
126+
$null = $PSBoundParameters.Remove("ResourceGroupName")
127+
$null = $PSBoundParameters.Remove("SubscriptionId")
128+
$null = $PSBoundParameters.Remove("ImagePath")
129+
$null = $PSBoundParameters.Remove("PackageAlias")
130+
$null = $PSBoundParameters.Remove("DisplayName")
131+
$null = $PSBoundParameters.Remove("IsActive")
132+
$null = $PSBoundParameters.Remove("IsRegularRegistration")
133+
134+
$extractPackage = Az.DesktopVirtualization\Expand-AzWvdMsixImage @PSBoundParameters -HostPoolName $saveHostPoolName `
135+
-ResourceGroupName $saveResourceGroupName `
136+
-SubscriptionId $saveSubscriptionId `
137+
-Uri $saveImagePath `
138+
| Where-Object { $_.PackageAlias -eq $savePackageAlias }
139+
140+
$null = $PSBoundParameters.Add("ResourceGroupName", $saveResourceGroupName)
141+
$null = $PSBoundParameters.Add("SubscriptionId", $saveSubscriptionId)
142+
$null = $PSBoundParameters.Add('FullName', $extractPackage.PackageFullName)
143+
$null = $PSBoundParameters.Add("IsActive", $IsActive)
144+
$null = $PSBoundParameters.Add("IsRegularRegistration", $IsRegularRegistration)
145+
146+
$package = New-AzWvdMsixPackage @PSBoundParameters -HostPoolName $saveHostPoolName `
147+
-ImagePath $extractPackage.ImagePath `
148+
-PackageName $extractPackage.PackageName `
149+
-PackageFamilyName $extractPackage.PackageFamilyName `
150+
-PackageRelativePath $extractPackage.PackageRelativePath `
151+
-PackageDependency $extractPackage.PackageDependencies `
152+
-Version $extractPackage.Version `
153+
-LastUpdated $extractPackage.LastUpdated `
154+
-PackageApplication $extractPackage.PackageApplication `
155+
-DisplayName $saveDisplayName `
156+
157+
}
158+
}

src/DesktopVirtualization/custom/New-AzWvdRegistrationInfo.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Create Windows virtual desktop registration info.
2020
Create Windows virtual desktop registration info.
2121
#>
2222
function New-AzWvdRegistrationInfo {
23-
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20191210Preview.IRegistrationInfo')]
23+
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20201019Preview.IRegistrationInfo')]
2424
[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
2525
param(
2626
[Parameter()]
@@ -111,7 +111,7 @@ function New-AzWvdRegistrationInfo {
111111
-Ring $hostpool.Ring `
112112
-ValidationEnvironment:$hostpool.ValidationEnvironment `
113113
-PreferredAppGroupType $hostpool.PreferredAppGroupType
114-
New-Object -TypeName 'Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20191210Preview.RegistrationInfo' `
114+
New-Object -TypeName 'Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20201019Preview.RegistrationInfo' `
115115
-Property @{ `
116116
ExpirationTime = $hostpool.RegistrationInfoExpirationTime; `
117117
RegistrationTokenOperation = $hostpool.RegistrationInfoRegistrationTokenOperation; `
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
### Example 1: Expands specified Image Path and retrieves Package metadata found in AppxManifest.xml
2+
```powershell
3+
PS C:\> Expand-AzWvdMsixImage -HostPoolName HostPoolName `
4+
-ResourceGroupName resourceGroupName `
5+
-SubscriptionId SubscriptionId `
6+
-Uri ImagePathURI
7+
8+
Name Type
9+
---- ----
10+
HostPoolName/extractmsiximage Microsoft.DesktopVirtualization/hostpools/extractmsiximage
11+
```
12+
13+
This command returns Metadata of MSIX Package found in the given Image Path.
14+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
### Example 1: Get a MSIX Package by Name
2+
```powershell
3+
PS C:\> Get-AzWvdMsixPackage -HostPoolName HostPoolName -ResourceGroupName ResourceGroupName -SubscriptionId SubscriptionId -FullName PackageFullName
4+
5+
Name Type
6+
---- ----
7+
HostPoolName/MSIXPackage_FullName Microsoft.DesktopVirtualization/hostpools/msixpackages
8+
```
9+
10+
This command gets a MSIX Package in a HostPool.
11+
12+
### Example 2: List MSIX Packages
13+
```powershell
14+
PS C:\> Get-AzWvdMsixPackage -HostPoolName HostPoolName -ResourceGroupName ResourceGroupName -SubscriptionId SubscriptionId
15+
16+
Name Type
17+
---- ----
18+
HostPoolName/MSIXPackage_FullName1 Microsoft.DesktopVirtualization/hostpools/msixpackages
19+
HostPoolName/MSIXPackage_FullName2 Microsoft.DesktopVirtualization/hostpools/msixpackages
20+
HostPoolName/MSIXPackage_FullName3 Microsoft.DesktopVirtualization/hostpools/msixpackages
21+
```
22+
23+
This command Lists MSIX Packages in a HostPool.
24+

src/DesktopVirtualization/examples/Get-AzWvdWorkspace.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
### Example 1: Get a Windows Virtual Desktop Worksapce by name
1+
### Example 1: Get a Windows Virtual Desktop Workspace by name
22
```powershell
3-
PS C:\> Get-AzWvdWorksapce -ResourceGroupName ResourceGroupName -Name WorkspaceName
3+
PS C:\> Get-AzWvdWorkspace -ResourceGroupName ResourceGroupName -Name WorkspaceName
44
55
Location Name Type
66
-------- ---- ----
@@ -11,7 +11,7 @@ This command gets a Windows Virtual Desktop Workspace in a Resource Group.
1111

1212
### Example 2: List Windows Virtual Desktop Workspaces
1313
```powershell
14-
PS C:\> Get-AzWvdWorksapce -ResourceGroupName ResourceGroupName
14+
PS C:\> Get-AzWvdWorkspace -ResourceGroupName ResourceGroupName
1515
1616
Location Name Type
1717
-------- ---- ----

0 commit comments

Comments
 (0)