Download latest version of SumatraPDF and install it for all Users with PDF preview in Explorer:
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Internet Explorer\Main" -Name "DisableFirstRunCustomize" -Value 2
$ProgressPreference = "SilentlyContinue"
$url = "https://www.sumatrapdfreader.org/download-free-pdf-viewer"
$html = Invoke-WebRequest -Uri $url
$pattern = 'SumatraPDF-(\d+(\.\d+)+)-64-install\.exe'
$matches = $html.AllElements | Where-Object { $_.tagName -eq "a" -and $_.innerText -match $pattern } | ForEach-Object { $_.innerText }
$latestVersion = $matches | Sort-Object -Descending | Select-Object -First 1
$latestVersion -match 'SumatraPDF-(\d+(\.\d+)+)-64-install\.exe'
$SumatraVersion = $matches[1]
$Link = "https://www.sumatrapdfreader.org/dl/rel/$SumatraVersion/$latestVersion"
$Path = "C:\Users\Public\Downloads"
$File = "SumatraPDF-latest-64-install.exe"
Invoke-WebRequest -Uri $Link -OutFile "$Path\$File" -UseBasicParsing
Start-Process -FilePath "$Path\$File" -ArgumentList "-s -all-users -with-preview" -Wait
reg add "HKCU\Software\Microsoft\Print\UnifiedPrintDialog" /v "PreferLegacyPrintDialog" /d 1 /t REG_DWORD /f
Remove-Item "C:\Users\Public\Desktop\SumatraPDF.lnk"
Remove-Item "C:\ProgramData\Microsoft\Windows\Start Menu\SumatraPDF.lnk"