Last active
June 16, 2025 07:38
-
-
Save jermdavis/171d6f004b0c981350e51ab876d191c9 to your computer and use it in GitHub Desktop.
A script to help fix the Sitecore v10.2 SIF scripts for installs on Windows 11. Explanation in the blog post at https://blog.jermdavis.dev/posts/2025/fix-install-sitecore-102-win11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function FixupXConnect | |
| { | |
| $source = "xconnect-xp0.json" | |
| $json = Get-Content $source -Raw | ConvertFrom-Json | |
| $json.Tasks.AddSqlDatabasesToElasticPool.Params | Add-Member -MemberType NoteProperty -Name "TrustServerCertificate" -Value ($true) | |
| $json.Tasks.CreateShardApplicationDatabaseServerLoginInvokeSqlCmd.Params | Add-Member -MemberType NoteProperty -Name "TrustServerCertificate" -Value ($true) | |
| $json.Tasks.CreateShardManagerApplicationDatabaseUserInvokeSqlCmd.Params | Add-Member -MemberType NoteProperty -Name "TrustServerCertificate" -Value ($true) | |
| $json.Tasks.CreateShard0ApplicationDatabaseUserInvokeSqlCmd.Params | Add-Member -MemberType NoteProperty -Name "TrustServerCertificate" -Value ($true) | |
| $json.Tasks.CreateShard1ApplicationDatabaseUserInvokeSqlCmd.Params | Add-Member -MemberType NoteProperty -Name "TrustServerCertificate" -Value ($true) | |
| Move-Item $source "$($source).bak" | |
| $json | ConvertTo-Json -Depth 10 | Out-File $source -Encoding default | |
| } | |
| function FixupSitecore | |
| { | |
| $source = "sitecore-XP0.json" | |
| $json = Get-Content $source -Raw | ConvertFrom-Json | |
| $json.Tasks.AddSqlDatabasesToElasticPool.Params | Add-Member -MemberType NoteProperty -Name "TrustServerCertificate" -Value ($true) | |
| Move-Item $source "$($source).bak" | |
| $json | ConvertTo-Json -Depth 10 | Out-File $source -Encoding default | |
| } | |
| function FixupPrerequisites | |
| { | |
| $source = "Prerequisites.json" | |
| $json = Get-Content $source -Raw | ConvertFrom-Json | |
| $json.Parameters | Add-Member -MemberType NoteProperty -Name "WebDeploy" -Value ([PSCustomObject]@{ | |
| Type = 'String' | |
| Description = 'Download path for WebDeploy' | |
| DefaultValue = 'https://download.microsoft.com/download/b/d/8/bd882ec4-12e0-481a-9b32-0fae8e3c0b78/webdeploy_amd64_en-US.msi' | |
| }) | |
| $json.Parameters | Add-Member -MemberType NoteProperty -Name "UrlRewrite" -Value ([PSCustomObject]@{ | |
| Type = 'String' | |
| Description = 'Download path for UrlRewrite' | |
| DefaultValue = 'https://download.microsoft.com/download/1/2/8/128E2E22-C1B9-44A4-BE2A-5859ED1D4592/rewrite_amd64_en-US.msi' | |
| }) | |
| $json.Variables | Add-Member -MemberType NoteProperty -Name "WebDeploy.Download" -Value ("[JoinPath(variable('Temp.Location'),'webdeploy_amd64_en-US.msi')]") | |
| $json.Variables | Add-Member -MemberType NoteProperty -Name "UrlRewrite.Download" -Value ("[JoinPath(variable('Temp.Location'),'rewrite_amd64_en-US.msi')]") | |
| $json.Tasks.PSObject.Properties.Remove("DownloadWebPlatformInstaller") | |
| $json.Tasks.PSObject.Properties.Remove("InstallWebPlatformInstaller") | |
| $json.Tasks.PSObject.Properties.Remove("InstallWebDeploy3.6") | |
| $json.Tasks.PSObject.Properties.Remove("InstallURLRewrite2") | |
| $json.Tasks | Add-Member -MemberType NoteProperty -Name "DownloadWebDeploy" -Value ([PSCustomObject]@{ | |
| Type = 'DownloadFile' | |
| }) | |
| $json.Tasks.DownloadWebDeploy | Add-Member -MemberType NoteProperty -Name "Params" -Value ([PSCustomObject]@{ | |
| SourceUri = "[parameter('WebDeploy')]" | |
| DestinationPath = "[variable('WebDeploy.Download')]" | |
| }) | |
| $json.Tasks | Add-Member -MemberType NoteProperty -Name "InstallWebDeploy" -Value ([PSCustomObject]@{ | |
| Type = 'StartProcess' | |
| }) | |
| $json.Tasks.InstallWebDeploy | Add-Member -MemberType NoteProperty -Name "Params" -Value ([PSCustomObject]@{ | |
| FilePath = "[variable('WebDeploy.Download')]" | |
| ArgumentList = "[variable('InstallArgs')]" | |
| Wait = $true | |
| }) | |
| $json.Tasks | Add-Member -MemberType NoteProperty -Name "DownloadUrlRewrite" -Value ([PSCustomObject]@{ | |
| Type = 'DownloadFile' | |
| }) | |
| $json.Tasks.DownloadUrlRewrite | Add-Member -MemberType NoteProperty -Name "Params" -Value ([PSCustomObject]@{ | |
| SourceUri = "[parameter('UrlRewrite')]" | |
| DestinationPath = "[variable('UrlRewrite.Download')]" | |
| }) | |
| $json.Tasks | Add-Member -MemberType NoteProperty -Name "InstallUrlRewrite" -Value ([PSCustomObject]@{ | |
| Type = 'StartProcess' | |
| }) | |
| $json.Tasks.InstallUrlRewrite | Add-Member -MemberType NoteProperty -Name "Params" -Value ([PSCustomObject]@{ | |
| FilePath = "[variable('UrlRewrite.Download')]" | |
| ArgumentList = "[variable('InstallArgs')]" | |
| Wait = $true | |
| }) | |
| Move-Item $source "$($source).bak" | |
| $json | ConvertTo-Json -Depth 10 | Out-File $source -Encoding default | |
| } | |
| FixupPrerequisites | |
| FixupXConnect | |
| FixupSitecore |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment