Now that we can run Office 365 Pro Plus on Windows 2019 till October 2025 it’s time to make Office 2019 evergreen as well. It’s pretty similar to Office 365, but the XML file has some new and different options.
I’ve just played with it for a couple of days, but I really like that it doesn’t bugger me with the Office sign in to activate. This will certainly help in LoginVSI scenarios.
The XML doesn’t look nice in WordPress, but you can get from my Github.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
function Get-ODTUri { <# .NOTES Author: Bronson Magnan Twitter: @cit_bronson Modified by: Marco Hofmann Twitter: @xenadmin #> [CmdletBinding()] [OutputType([string])] param () $url = "https://www.microsoft.com/en-us/download/confirmation.aspx?id=49117" try { $response = Invoke-WebRequest -UseBasicParsing -Uri $url -ErrorAction SilentlyContinue } catch { Throw "Failed to connect to ODT: $url with error $_." Break } finally { $ODTUri = $response.links | Where-Object {$_.outerHTML -like "*click here to download manually*"} Write-Output $ODTUri.href } } # PowerShell Wrapper for MDT, Standalone and Chocolatey Installation - (C)2015 xenappblog.com # Example 1: Start-Process "XenDesktopServerSetup.exe" -ArgumentList $unattendedArgs -Wait -Passthru # Example 2 Powershell: Start-Process powershell.exe -ExecutionPolicy bypass -file $Destination # Example 3 EXE (Always use ' '): # $UnattendedArgs='/qn' # (Start-Process "$PackageName.$InstallerType" $UnattendedArgs -Wait -Passthru).ExitCode # Example 4 MSI (Always use " "): # $UnattendedArgs = "/i $PackageName.$InstallerType ALLUSERS=1 /qn /liewa $LogApp" # (Start-Process msiexec.exe -ArgumentList $UnattendedArgs -Wait -Passthru).ExitCode Write-Verbose "Setting Arguments" -Verbose $StartDTM = (Get-Date) $Vendor = "Microsoft" $Product = "Office 2019" $PackageName = "setup" $InstallerType = "exe" $LogPS = "${env:SystemRoot}" + "\Temp\$Vendor $Product $Version PS Wrapper.log" $LogApp = "${env:SystemRoot}" + "\Temp\$PackageName.log" $Destination = "${env:ChocoRepository}" + "\$Vendor\$Product\$Version\$packageName.$installerType" $UnattendedArgs = '/configure RDSH.xml' $UnattendedArgs2 = '/download RDSH.xml' $URL = $(Get-ODTUri) $ProgressPreference = 'SilentlyContinue' Start-Transcript $LogPS Invoke-WebRequest -UseBasicParsing -Uri $url -OutFile .\officedeploymenttool.exe $Version = (Get-Command .\officedeploymenttool.exe).FileVersionInfo.FileVersion if( -Not (Test-Path -Path $Version ) ) { New-Item -ItemType directory -Path $Version Copy-item .\RDSH.xml -Destination $Version -Force $Dir = Get-Location $Path = "$Dir" + "\$Version" .\officedeploymenttool.exe /quiet /extract:.\$Version start-sleep -s 5 } CD $Version Write-Verbose "Downloading $Vendor $Product $Version" -Verbose If (!(Test-Path -Path $PSScriptRoot\$Version\Office\Data\v32.cab)) { (Start-Process "Setup.exe" -ArgumentList $unattendedArgs2 -Wait -Passthru).ExitCode } Else { Write-Verbose "File exists. Skipping Download." -Verbose } Write-Verbose "Starting Installation of $Vendor $Product $Version" -Verbose (Start-Process "$PackageName.$InstallerType" $UnattendedArgs -Wait -Passthru).ExitCode Write-Verbose "Customization" -Verbose Write-Verbose "Stop logging" -Verbose $EndDTM = (Get-Date) Write-Verbose "Elapsed Time: $(($EndDTM-$StartDTM).TotalSeconds) Seconds" -Verbose Write-Verbose "Elapsed Time: $(($EndDTM-$StartDTM).TotalMinutes) Minutes" -Verbose Stop-Transcript |