It is this time again, the monthly patch release from Microsoft. This month a security update for Exchange 2019, 2016 and 2013.
Problem is the patch (may) failed to install on Exchange 2019 (don’t know for 2016 and 2013 as I don’t have these version anymore), leaving Exchange in a bad shape as the services won’t start anymore.
As you should (not to say must) install these updates using an elevated command prompt (and not with Windows Update) you will have a log file (ServiceControl.log located in C:\ExchangeSetupLogs) and will found the following error
[Error] System.Management.Automation.CommandNotFoundException: The term ‘Stop-SetupService’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Obviously the Stop-SetupService is not a PowerShell cmdlet.
The solution is to create a profile.ps1 file you will save in C:\Windows\System32\WindowsPowerShell\v1.0 with the content (use Notepad executed with the Run As Administrator)
New-Alias Stop-SetupService Stop-Service
Then you will be able to restart the patch installation.