Up 4 Down 0

Silent update Microsoft Remote Desktop

Feed: https://rdweb.wvd.microsoft.com/api/arm/feeddiscovery

Uninstall:

cmd /c "wmic product where name='Extern bureaublad' call uninstall"

Remote Desktop app:
$ProgressPreference = "SilentlyContinue"
$Link = "https://aka.ms/wvd/clients/windows"
$Path = "C:\Users\Public\Downloads"
$File = "RemoteDesktop.msi"
Invoke-WebRequest -Uri $Link -OutFile $Path\$File -UseBasicParsing
Start-Process -FilePath "msiexec.exe" -ArgumentList "/i $Path\$File /qn ALLUSERS=1 /L*v $Path\install.log" -Wait

Oneliner cmd:
powershell -Command "$ProgressPreference = 'SilentlyContinue'; $Link = 'https://aka.ms/wvd/clients/windows'; $Path = 'C:\Users\Public\Downloads'; $File = 'RemoteDesktop.msi'; Invoke-WebRequest -Uri $Link -OutFile $Path\$File -UseBasicParsing; Start-Process -FilePath 'msiexec.exe' -ArgumentList '/i $Path\$File /qn ALLUSERS=1 /L*v $Path\install.log' -Wait"

Windows app:
$ProgressPreference = "SilentlyContinue"
$Link = "https://go.microsoft.com/fwlink/?linkid=2262633"
$Path = "C:\Users\Public\Downloads"
$File = "WindowsApp_x64.msix"
Invoke-WebRequest -Uri $Link -OutFile $Path\$File -UseBasicParsing
Add-AppxPackage -Path "$Path\$File" -ForceApplicationShutdown

Shortcuts:
$Shell = New-Object -ComObject WScript.Shell
$Location1 = "C:\Users\public\Desktop"
$Location2 = "C:\ProgramData\Microsoft\Windows\Start Menu\Programs"
$Application = "Remote Desktop.lnk"
$TargetPath = "C:\Program Files\Remote Desktop\msrdcw.exe"
$IconLocation = "C:\Program Files\Remote Desktop\msrdcw.exe"
$Description = "Microsoft Remote Desktop Client"
$WorkingDirectory = "C:\Program Files\Remote Desktop\"
if (-Not (Test-Path $Location1\$Application)) {
$Shortcut = $shell.CreateShortcut("$Location1\$Application")
$Shortcut.TargetPath = "$TargetPath"
$Shortcut.IconLocation = "$IconLocation"
$Shortcut.Description = "$Description"
$Shortcut.WorkingDirectory = "$WorkingDirectory"
$Shortcut.Save()
}
if (-Not (Test-Path $Location2\$Application)) {
$Shortcut = $shell.CreateShortcut("$Location2\$Application")
$Shortcut.TargetPath = "$TargetPath"
$Shortcut.IconLocation = "$IconLocation"
$Shortcut.Description = "$Description"
$Shortcut.WorkingDirectory = "$WorkingDirectory"
$Shortcut.Save()
}

Complete:
cmd /c "wmic product where name='Extern bureaublad' call uninstall"
$ProgressPreference = "SilentlyContinue"
$Link = "https://aka.ms/wvd/clients/windows"
$Path = "C:\Users\Public\Downloads"
$File = "RemoteDesktop.msi"
Invoke-WebRequest -Uri $Link -OutFile $Path\$File -UseBasicParsing
Start-Process -FilePath "msiexec.exe" -ArgumentList "/i $Path\$File /qn ALLUSERS=1 /L*v $Path\install.log" -Wait
$Shell = New-Object -ComObject WScript.Shell
$Location1 = "C:\Users\public\Desktop"
$Location2 = "C:\ProgramData\Microsoft\Windows\Start Menu\Programs"
$Application = "Remote Desktop.lnk"
$TargetPath = "C:\Program Files\Remote Desktop\msrdcw.exe"
$IconLocation = "C:\Program Files\Remote Desktop\msrdcw.exe"
$Description = "Microsoft Remote Desktop Client"
$WorkingDirectory = "C:\Program Files\Remote Desktop\"
if (-Not (Test-Path $Location1\$Application)) {
$Shortcut = $shell.CreateShortcut("$Location1\$Application")
$Shortcut.TargetPath = "$TargetPath"
$Shortcut.IconLocation = "$IconLocation"
$Shortcut.Description = "$Description"
$Shortcut.WorkingDirectory = "$WorkingDirectory"
$Shortcut.Save()
}
if (-Not (Test-Path $Location2\$Application)) {
$Shortcut = $shell.CreateShortcut("$Location2\$Application")
$Shortcut.TargetPath = "$TargetPath"
$Shortcut.IconLocation = "$IconLocation"
$Shortcut.Description = "$Description"
$Shortcut.WorkingDirectory = "$WorkingDirectory"
$Shortcut.Save()
}