Skip to content

Instantly share code, notes, and snippets.

@ryzhovau
Created July 27, 2022 07:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryzhovau/db7c5d56b04c8bdc424cea18b5359f9d to your computer and use it in GitHub Desktop.
Save ryzhovau/db7c5d56b04c8bdc424cea18b5359f9d to your computer and use it in GitHub Desktop.
# Creds goes to https://github.com/farag2/Office
# It is needed to remove these keys not to bypass Russian and Belarusian region blocks
Remove-Item -Path HKCU:\SOFTWARE\Microsoft\Office\16.0\Common\Experiment -Recurse -Force -ErrorAction Ignore
Remove-Item -Path HKCU:\SOFTWARE\Microsoft\Office\16.0\Common\ExperimentConfigs -Recurse -Force -ErrorAction Ignore
Remove-Item -Path HKCU:\SOFTWARE\Microsoft\Office\16.0\Common\ExperimentEcs -Recurse -Force -ErrorAction Ignore
# Set location to Ukraine
Set-WinHomeLocation -GeoId 241
# Download installer
$Installer = 'OfficeSetup.exe'
$URL = 'https://c2rsetup.officeapps.live.com/c2r/download.aspx?productReleaseID=O365ProPlusRetail&platform=Def&language=ru-ru&TaxRegion=pr&correlationId=382437ff-19d3-480b-a3f0-7cc88fc07cc4&token=06623e14-ba99-4d97-9899-a5777f83ea15&version=O16GA&source=O15OLSO365&Br=2&TenantId=882d47f6-50f4-4554-9aa6-43a46416b0f0'
if (-not (Test-Path -Path $Installer)) {
try {
Invoke-WebRequest $URL -OutFile $Installer -ErrorAction Stop
} catch {
Write-Host "Сперва скачайте $Installer на https://www.office.com/?auth=2&home=1"
exit
}
}
# Start installation
Start-Process -FilePath $Installer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment