How to skip the error message and continue the installation.
Do the usual in programming: Error Handling
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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
How to skip the error message and continue the installation.
Do the usual in programming: Error Handling