Installing Sitecore 9 when you've installed 9.1
Installing Sitecore 9 was never the easiest of things, particularly when you compare it to how relatively simple Sitecore 8 was. But if you install Sitecore 9.1 on the same machine and then try your trusty Sitecore 9.0 script you may find it's got even harder and there's a bunch of new issues to worry about.
Multiple version of SIF
The first issue your probably going to run into is an error saying a name parameter is missing. Your script hasn't change, but what has changed is the default version of SIF that's now running.
So the first change you need to make is to ensure your running the correct version of SIF. You can do this either by adding the command to your script or running this before calling you install script. It will take effect for the duration of your PowerShell session.
1#Switch to correct vesion of SIF2Remove-Module -Name SitecoreInstallFramework3Import-Module -Name SitecoreInstallFramework -RequiredVersion 1.2.1
If you want to check what the active version of SIF is you can do this in a PowerShell window using
1Get-Command -Module SitecoreInstallFramework | Select-Object -Property name, version
Certificates Error - Part 1
Now we're calling the right version of SIF, the next issue I encountered was to do with certs. Specifically I got this error:
1TerminatingError(New-SignedCertificate): "Cannot process argument transformation on parameter 'Signer'. Cannot convert the "System.Object[]" value of type "System.Object[]" to type "System.Security.Cryptography.X509Certificates.X509Certificate2"."2Install-SitecoreConfiguration : Cannot process argument transformation on parameter 'Signer'. Cannot convert the "System.Object[]" value of type "System.Object[]" to type "System.Security.Cryptography.X509Certificates.X509Certificate2".
This is due to the certificate for Sitecore 9.1 that has been installed. You can remove the certificate but then your Sitecore 9.1 install will break instead.
Alternatively add a "RootCertFilename" to the certificate definition:
1# Install client certificate for xconnect2$certParams = @{3 Path = "$SCLocation\xconnect-createcert.json"4 CertificateName = "$prefix.xconnect_client"5 RootCertFileName = "SIF121Root"6}7Install-SitecoreConfiguration @certParams -Verbose
Certificate Error - Part 2
This error looks exactly the same as the error above but you've already added that Root Cert File Name, so what's happening now.
1Install-SitecoreConfiguration : Cannot process argument transformation on parameter 'Signer'. Cannot convert the2"System.Object[]" value of type "System.Object[]" to type3"System.Security.Cryptography.X509Certificates.X509Certificate2".4At C:\resourceFiles9.0\install.ps1:47 char:15+ Install-SitecoreConfiguration @certParams -Verbose6+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~7 + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException8 + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfiguration
The error is saying that it expected to find 1 certificate but found many instead. Each time you run the script the number of thumbprints also keeps going up.
TBH I'm not overly certain what causes this as most of the time you get the one root cert and your done forever more. But somehow you get a second and then get you in a loop of repeatedly deleting certificates only to discover they still exist somewhere. You know it's also not the certificate for the 9.1 install as the certificate has the new name you added to it.
For me the issue was although I had deleted them from my personal certificates, trusted root certificates, and even the c:\certificates folder they were being added to, what I needed to do was run this in PowerShell.
1Get-ChildItem -Path "cert:\LocalMachine\Root" | Where-Object { $_.subject -like "*SIF121Root*" }2 | Remove-Item
If your wanting to find out what certificates are installed on your machine you can run these
1Get-ChildItem -Path "cert:\LocalMachine\Root" | Format-Table Subject, FriendlyName, Thumbprint2Get-ChildItem -Path "cert:\LocalMachine\My" | Format-Table Subject, FriendlyName, Thumbprint3Get-ChildItem -Path "cert:\CurrentUser\My" | Format-Table Subject, FriendlyName, Thumbprint
Make sure your config is actually correct
This one is really just my mistake. Multiple versions of Siteocore have meant rather than just having one "C:\reousrcefiles\" folder on my machine (as per instructions), I now have a few with the version post-fixed to the end. It only becomes apparent that the path in the install.ps1 file is wrong part way through the install process.