Could not find any service with display name ‘XCELERAINST ’

Jimmy Afflick 80 Reputation points
2024-06-04T14:06:43.2333333+00:00

Hi Experts, I was trying to install MSSQL 2019 via powershell. During the MSSQL installation we are setting instance service name as XCELERAINST. As per our code we trying to check the service XCELERAINST. If the XCELERAINST service already present then code have to say MSSQL already installed or else it have install the MSSQL. Since the service was missing before the installation I am getting error like “Could not find any service with display name 'XCELERAINST '” then it start installation. How to skip the error message and continue the installation. ? Also we are trying to do the reboot after MSSQL installation and trying to install the SSMS once the MSSQL installation. but after the reboot its not executing the SSMS part. Could someone help me to fix it. I am feel there is some issue the powershell code we have. I have attached the code and error message below.

I am looking forward to hearing from you.

Thanks in advance.

    `##MSSQL Installation`

$MSSQLISCV = Get-Service -DisplayName "SQL Server Agent (XCELERAINST)" | Where-Object {$_.Status -eq "Running"}

Write-host"`nStaring Installation of MSSQL for ISCV"

if (!($MSSQLISCV.displayname))

{

CreateFileOrFolder $UnattendedINI "file"

Add-Content -Value $UnattendedINIContent -Path $UnattendedINI

Write-host"MSSQL Installation starts"

ExecuteProcess -fullexepath "$($SQLBinariesBasePath)\setup.exe" -arglist "/ConfigurationFile=$($SQLBinariesBasePath)\Unattended.ini"

Write-host"MSSQL Server installed successfully"

Write-host"Will Run RebootAndContinue with domainName = $env:USERDOMAIN"

RebootAndContinue -Domain $env:UserDomain

}

else

{

Write-host"$($MSSQLISCV.displayname) service appears already. Skipping MSSQL installation."

}

##SSMS Installation Starts

SQL Service Error

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,067 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,410 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,430 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,219 questions
0 comments No comments
{count} votes

Accepted answer
  1. Olaf Helper 42,386 Reputation points
    2024-06-04T17:56:05.13+00:00

    How to skip the error message and continue the installation.

    Do the usual in programming: Error Handling

    https://learn.microsoft.com/en-us/powershell/scripting/learn/deep-dives/everything-about-exceptions?view=powershell-7.4


0 additional answers

Sort by: Most helpful