Skip to content

Commit

Permalink
Update MicrosoftWvd apps
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronparker committed Oct 10, 2023
1 parent e0878d9 commit fb3b498
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 29 deletions.
13 changes: 5 additions & 8 deletions Evergreen/Apps/Get-MicrosoftWvdBootloader.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Function Get-MicrosoftWvdBootLoader {
function Get-MicrosoftWvdBootLoader {
<#
.SYNOPSIS
Get the current version and download URL for the Microsoft Remote Desktop Boot Loader.
Expand All @@ -9,9 +9,9 @@ Function Get-MicrosoftWvdBootLoader {
Twitter: @stealthpuppy
#>
[OutputType([System.Management.Automation.PSObject])]
[CmdletBinding(SupportsShouldProcess = $False)]
[CmdletBinding(SupportsShouldProcess = $false)]
param (
[Parameter(Mandatory = $False, Position = 0)]
[Parameter(Mandatory = $false, Position = 0)]
[ValidateNotNull()]
[System.Management.Automation.PSObject]
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
Expand All @@ -24,14 +24,14 @@ Function Get-MicrosoftWvdBootLoader {
ReturnObject = "Headers"
}
$Headers = Invoke-WebRequestWrapper @params
if ($null -ne $Headers) {

If ($Null -ne $Headers) {
# Match filename
$Filename = [RegEx]::Match($Headers['Content-Disposition'], $res.Get.Download.MatchFilename).Captures.Groups[1].Value

# Match version
$Version = [RegEx]::Match($Headers['Content-Disposition'], $res.Get.Download.MatchVersion).Captures.Value
If ($Version.Length -eq 0) { $Version = "Unknown" }
if ($Version.Length -eq 0) { $Version = "Unknown" }

# Construct the output; Return the custom object to the pipeline
$PSObject = [PSCustomObject] @{
Expand All @@ -44,7 +44,4 @@ Function Get-MicrosoftWvdBootLoader {
}
Write-Output -InputObject $PSObject
}
Else {
Throw "$($MyInvocation.MyCommand): Failed to return a header from $($res.Get.Download.Uri)."
}
}
7 changes: 3 additions & 4 deletions Evergreen/Apps/Get-MicrosoftWvdInfraAgent.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ function Get-MicrosoftWvdInfraAgent {
Twitter: @stealthpuppy
#>
[OutputType([System.Management.Automation.PSObject])]
[CmdletBinding(SupportsShouldProcess = $False)]
[CmdletBinding(SupportsShouldProcess = $false)]
param (
[Parameter(Mandatory = $False, Position = 0)]
[Parameter(Mandatory = $false, Position = 0)]
[ValidateNotNull()]
[System.Management.Automation.PSObject]
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
Expand All @@ -23,7 +23,6 @@ function Get-MicrosoftWvdInfraAgent {
ReturnObject = "Headers"
}
$Content = Invoke-WebRequestWrapper @params

if ($null -ne $Content) {

# Match filename
Expand All @@ -32,8 +31,8 @@ function Get-MicrosoftWvdInfraAgent {
# Construct the output; Return the custom object to the pipeline
$PSObject = [PSCustomObject] @{
Version = [RegEx]::Match($Content.'Content-Disposition', $res.Get.Download.MatchVersion).Captures.Value
Architecture = Get-Architecture -String $Filename
Date = $Content.'Last-Modified'[0]
Architecture = Get-Architecture -String $Filename
Filename = $Filename
URI = $res.Get.Download.Uri
}
Expand Down
4 changes: 2 additions & 2 deletions Evergreen/Apps/Get-MicrosoftWvdMultimediaRedirection.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ function Get-MicrosoftWvdMultimediaRedirection {
ReturnObject = "Headers"
}
$Content = Invoke-WebRequestWrapper @params

if ($null -ne $Content) {

try {
# Match filename
$Filename = [RegEx]::Match($Content.'Content-Disposition', $res.Get.Download.MatchFilename).Captures.Groups[1].Value
Expand All @@ -48,8 +48,8 @@ function Get-MicrosoftWvdMultimediaRedirection {
# Construct the output; Return the custom object to the pipeline
$PSObject = [PSCustomObject] @{
Version = $Version
Architecture = Get-Architecture -String $Filename
Date = $Content.'Last-Modified'[0]
Architecture = Get-Architecture -String $Filename
Filename = $Filename
URI = $res.Get.Download.Uri
}
Expand Down
12 changes: 6 additions & 6 deletions Evergreen/Apps/Get-MicrosoftWvdRemoteDesktop.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Function Get-MicrosoftWvdRemoteDesktop {
Twitter: @stealthpuppy
#>
[OutputType([System.Management.Automation.PSObject])]
[CmdletBinding(SupportsShouldProcess = $False)]
[CmdletBinding(SupportsShouldProcess = $false)]
param (
[Parameter(Mandatory = $False, Position = 0)]
[Parameter(Mandatory = $false, Position = 0)]
[ValidateNotNull()]
[System.Management.Automation.PSObject]
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
Expand All @@ -23,23 +23,23 @@ Function Get-MicrosoftWvdRemoteDesktop {
foreach ($architecture in $res.Get.Update.Uri.$channel.Keys) {
Write-Verbose -Message "$($MyInvocation.MyCommand): Querying for architecture: $architecture."
$Redirect = Resolve-SystemNetWebRequest -Uri $res.Get.Update.Uri.$channel[$architecture]

if ($null -ne $Redirect) {
$Update = Invoke-RestMethodWrapper -Uri $Redirect.ResponseUri.AbsoluteUri

$Update = Invoke-RestMethodWrapper -Uri $Redirect.ResponseUri.AbsoluteUri
if ($null -ne $Update) {

Write-Verbose -Message "$($MyInvocation.MyCommand): Found version: $($Update.version)"
$Date = ConvertTo-DateTime -DateTime $($Redirect.Headers['Last-Modified'] | Select-Object -First 1) -Pattern $res.Get.Download.DatePattern
$FileName = $($Redirect.Headers['Content-Disposition'] -split $res.Get.Download.SplitText)[-1] -replace "\.json$", ".msi"

# Output the version object
$PSObject = [PSCustomObject] @{
Version = $Update.version
Architecture = $architecture
Channel = $channel
Date = $Date
Channel = $channel
MD5 = $Update.md5
Sha2 = $Update.sha2
Architecture = $architecture
Filename = $FileName
URI = $Update.url
}
Expand Down
16 changes: 8 additions & 8 deletions Evergreen/Apps/Get-MicrosoftWvdRtcService.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Function Get-MicrosoftWvdRtcService {
function Get-MicrosoftWvdRtcService {
<#
.SYNOPSIS
Get the current version and download URL for the Microsoft Remote Desktop WebRTC Redirector service.
Expand All @@ -9,10 +9,10 @@ Function Get-MicrosoftWvdRtcService {
Twitter: @stealthpuppy
#>
[OutputType([System.Management.Automation.PSObject])]
[CmdletBinding(SupportsShouldProcess = $False)]
[CmdletBinding(SupportsShouldProcess = $false)]
param (
[Parameter(Mandatory = $False, Position = 0)]
[ValidateNotNull()]
[Parameter(Mandatory = $false, Position = 0)]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSObject]
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
)
Expand All @@ -24,17 +24,17 @@ Function Get-MicrosoftWvdRtcService {
ReturnObject = "Headers"
}
$Headers = Invoke-WebRequestWrapper @params
if ($null -ne $Headers) {

If ($Null -ne $Headers) {
# Match filename
$Filename = [RegEx]::Match($Headers['Content-Disposition'], $res.Get.Download.MatchFilename).Captures.Groups[1].Value
$Filename = [Regex]::Match($Headers['Content-Disposition'], $res.Get.Download.MatchFilename).Captures.Groups[1].Value

# Construct the output; Return the custom object to the pipeline
$PSObject = [PSCustomObject] @{
Version = [RegEx]::Match($Headers['Content-Disposition'], $res.Get.Download.MatchVersion).Captures.Value
Architecture = Get-Architecture -String $Filename
Version = [Regex]::Match($Headers['Content-Disposition'], $res.Get.Download.MatchVersion).Captures.Value
Date = $Headers['Last-Modified'] | Select-Object -First 1
Size = $Headers['Content-Length'] | Select-Object -First 1
Architecture = Get-Architecture -String $Filename
Filename = $Filename
URI = $res.Get.Download.Uri
}
Expand Down
2 changes: 1 addition & 1 deletion Evergreen/Manifests/MicrosoftWvdRtcService.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Name": "Microsoft Remote Desktop WebRTC Redirector Service",
"Source": "https://docs.microsoft.com/en-us/azure/virtual-desktop/teams-on-wvd",
"Source": "https://docs.microsoft.com/en-us/azure/virtual-desktop/teams-on-avd",
"Get": {
"Download": {
"Uri": "https://aka.ms/msrdcwebrtcsvc/msi",
Expand Down

0 comments on commit fb3b498

Please sign in to comment.