Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
82c4a31
Update Get-AVDW365Gateways.ps1
DonnaRyanMicrosoft Feb 26, 2025
3eff28f
Merge branch 'main' of https://github.com/microsoft/Windows365-PSScripts
DonnaRyanMicrosoft Mar 26, 2025
49a3c24
Squashed commit of the following:
DonnaRyanMicrosoft Jun 23, 2025
d3cb566
Merge branch 'main' of https://github.com/microsoft/Windows365-PSScripts
DonnaRyanMicrosoft Aug 8, 2025
c6091ea
Merge branch 'main' of https://github.com/microsoft/Windows365-PSScripts
DonnaRyanMicrosoft Oct 8, 2025
ab86ceb
Initial Commit
DonnaRyanMicrosoft Oct 8, 2025
91594b9
Changed MSRDC uninstall order
DonnaRyanMicrosoft Oct 8, 2025
73506a1
DisableAutoUpdate reg key support
DonnaRyanMicrosoft Oct 9, 2025
56fb1e1
Updated outputs
DonnaRyanMicrosoft Oct 10, 2025
bc1c21f
Added logging for install processes
DonnaRyanMicrosoft Oct 10, 2025
50193be
Fixed ID10T error
DonnaRyanMicrosoft Oct 10, 2025
9a3a4b1
added comments
DonnaRyanMicrosoft Oct 10, 2025
49e2336
Added Param Block
DonnaRyanMicrosoft Oct 10, 2025
cf28d46
Formatting
DonnaRyanMicrosoft Oct 10, 2025
5e63bb1
Logging enabled + error handling
DonnaRyanMicrosoft Oct 13, 2025
b01247c
Added Readme.Md instructions
DonnaRyanMicrosoft Oct 14, 2025
eecec02
Changed MSRDC Uninstall Parameter
DonnaRyanMicrosoft Oct 21, 2025
9a138d9
Updated Readme.md
DonnaRyanMicrosoft Oct 21, 2025
f1fd3c2
Formatting and Copyright
DonnaRyanMicrosoft Oct 29, 2025
f49ec5f
Changed name of file to new name
DonnaRyanMicrosoft Oct 29, 2025
01a86c0
Changed Folder Name
DonnaRyanMicrosoft Oct 29, 2025
ce814f4
Updated Documentation
DonnaRyanMicrosoft Nov 3, 2025
40da2a6
Added WAIT to msiexec command, fixed RD query
DonnaRyanMicrosoft Dec 3, 2025
243c8c7
Merge branch 'main' into Windows-App-Installer-MultiTool
DonnaRyanMicrosoft Dec 3, 2025
97714f0
New Version - 1.1
DonnaRyanMicrosoft Dec 10, 2025
facf8d4
update readme
DonnaRyanMicrosoft Dec 10, 2025
49456be
GUID
DonnaRyanMicrosoft Dec 11, 2025
859aca4
Updated Readme.md
DonnaRyanMicrosoft Dec 15, 2025
b19ad5a
update to package uninstall method
DonnaRyanMicrosoft Dec 15, 2025
dc23ab3
Updated deployment instructions
DonnaRyanMicrosoft Dec 19, 2025
338dbbf
Merge branch 'main' into Windows-App-Installer-MultiTool
DonnaRyanMicrosoft Dec 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@ See LICENSE in the project root for license information.
#>

#Microsoft Remote Desktop Client Migration Script
#Version 1.0
#Version 1.2
#For more info, visit: https://github.com/microsoft/Windows365-PSScripts

Param(
[parameter(mandatory = $false, HelpMessage = "Where to source installer payload")]
[ValidateSet('Store','WinGet','MSIX')]
[string]$source = "Store",
[parameter(mandatory = $false, HelpMessage = "Value to set auto update reg key")]
[ValidateSet(0,1,2,3)]
[int]$DisableAutoUpdate = 0,
Expand Down Expand Up @@ -87,12 +84,11 @@ function uninstall-MSRDC{
}
catch
{
Update-Log -data $_.Exception.Message -Class Error -Output Both
Update-Log -data $_.Exception.Message -Class Information -Output Both
}

if ($MSRDC.name -eq "Remote Desktop"){
update-log -Data "Remote Desktop Install Found" -Class Information -Output Both
#update-log -Data "Version: " $MSRDC.Version
update-log -Data "Uninstalling Remote Desktop" -Class Information -Output Both
try{
Uninstall-Package -Name "Remote Desktop" -force -ErrorAction Stop| Out-Null
Expand All @@ -111,51 +107,41 @@ function uninstall-MSRDC{
}
}

#function to install Windows App from MS Store - write install process log to $env:windir\temp\WindowsAppStoreInstall.log
function install-windowsappstore{
update-log -Data "Writing install process log to $env:windir\temp\WindowsAppStoreInstall.log" -Class Information -Output Both
try{
invoke-command -ScriptBlock { winget install 9N1F85V9T8BN --accept-package-agreements --accept-source-agreements} | Out-File -FilePath $env:windir\temp\WindowsAppStoreInstall.log -Append #MS Store Install
}
catch
{
Update-Log -data $_.Exception.Message -Class Error -Output Both
Exit 1
}
}

#Function to install Windows App from Winget CDN - write install process log to $env:windir\temp\WindowsAppWinGetInstall.log
function install-windowsappwinget{
update-log -Data "Writing install process log to $env:windir\temp\WindowsAppWinGetInstall.log" -Class Information -Output Both
try{
invoke-command -ScriptBlock {winget install Microsoft.WindowsApp --accept-package-agreements --accept-source-agreements} | Out-File -FilePath $env:windir\temp\WindowsAppWinGetInstall.log -Append #Winget Install
}
catch
{
Update-Log -data $_.Exception.Message -Class Error -Output Both
Exit 1
}
}

#Function to install Windows App from MSIX direct download
function install-windowsappMSIX{

$guid = New-Guid
try{
if ((test-path -Path $env:windir\Temp\WindowsApp.msix) -eq $true){Remove-Item -Path $env:windir\Temp\WindowsApp.msix -Force -ErrorAction Stop}
update-log -data "Downloading payload" -Class Information -Output Both
#if ((test-path -Path $env:windir\Temp\WindowsApp.msix) -eq $true){Remove-Item -Path $env:windir\Temp\WindowsApp.msix -Force -ErrorAction Stop}

$Payload = Invoke-WebRequest -uri "https://go.microsoft.com/fwlink/?linkid=2262633" -UseBasicParsing -OutFile $env:windir\Temp\WindowsApp.msix -PassThru -ErrorAction Stop
new-item -Path $env:windir\temp -Name $guid.guid -ItemType Directory -Force -ErrorAction Stop | Out-Null
$path = $env:windir + "\temp\" + $guid.guid

$Payload = Invoke-WebRequest -uri "https://go.microsoft.com/fwlink/?linkid=2262633" -UseBasicParsing -OutFile $path\WindowsApp.msix -PassThru -ErrorAction Stop
$filename = ($Payload.BaseResponse.ResponseUri.AbsolutePath -replace ".*/")

if ((test-path -Path $env:windir\Temp\$filename) -eq $true){Remove-Item -Path $env:windir\Temp\$filename -Force -ErrorAction Stop}
#if ((test-path -Path $env:windir\Temp\$filename) -eq $true){Remove-Item -Path $env:windir\Temp\$filename -Force -ErrorAction Stop}

Rename-Item -Path $env:windir\Temp\WindowsApp.msix -NewName $filename -Force -ErrorAction Stop
update-log -Data "Downloaded $filename to $env:windir\temp" -Class Information -Output Both
Rename-Item -Path $path\WindowsApp.msix -NewName $filename -Force -ErrorAction Stop
update-log -Data "Downloaded $filename to $path" -Class Information -Output Both

}
catch{
Update-Log -data $_.Exception.Message -Class Error -Output Both
}
try{
Add-AppxPackage -Path $env:windir\temp\$filename -ErrorAction Stop
#Add-AppxPackage -Path $env:windir\temp\$filename -ErrorAction Stop
update-log -data "Installing Windows App MSIX package..." -Class Information -Output Both
add-appxprovisionedpackage -PackagePath $path\$filename -online -SkipLicense -ErrorAction Stop | Out-Null
}
catch{
Update-Log -data $_.Exception.Message -Class Error -Output Both
}

try{
update-log -data "Cleaning up temp folder and files..." -Class Information -Output Both
remove-item -Path $path -Recurse -Force -ErrorAction Stop | Out-Null

}
catch{
Update-Log -data $_.Exception.Message -Class Error -Output Both
Expand All @@ -164,13 +150,18 @@ function install-windowsappMSIX{

#Function to check if Windows App is installed
function invoke-WAInstallCheck{
if ((($testWA = get-appxpackage -name MicrosoftCorporationII.Windows365).name) -eq "MicrosoftCorporationII.Windows365" ){
update-log -Data "Windows App Installation found." -Class Information -Output Both

$WAappx = (Get-AppxProvisionedPackage -online | Where-Object {$_.DisplayName -eq "MicrosoftCorporationII.Windows365"})

if ($WAappx.DisplayName -eq "MicrosoftCorporationII.Windows365"){
update-log -Data "Windows App Provisioning Package installation found." -Class Information -Output Both
update-log -data $WAappx.displayname -Class Information -Output Both
update-log -data $WAappx.version -Class Information -Output Both
Return 0
}
else
{
update-log -Data "Windows App installation not found." -Class Information -Output Both
update-log -Data "Windows App Provisioning Package installation not found." -Class Information -Output Both
Return 1
}
}
Expand All @@ -190,24 +181,19 @@ function invoke-disableautoupdate($num){
}
}



#check if Windows App is installed. If so, skip installation. Else, install
if ((invoke-WAInstallCheck) -eq 0){
update-log -Data "Skipping Windows App Installation" -Class Information -Output Both
}
else
{
if ($source -eq "Store"){
update-log -Data "Starting Windows App installation from Microsoft Store" -Class Information -Output Both
install-windowsappstore
}
if ($source -eq "WinGet"){
update-log -Data "Starting Windows App installation from WinGet" -Class Information -Output Both
install-windowsappwinget
}
if ($source -eq "MSIX"){

#if ($source -eq "MSIX"){
update-log -Data "Starting Windows App installation from MSIX download" -Class Information -Output Both
install-windowsappMSIX
}
# }
}

#verify if Windows App has now been installed. If so, move to uninstalling MSRDC. Else, fail.
Expand Down
Loading