Wednesday, January 31, 2018

Sitecore Experience Commerce - Install-WindowsFeature error during installation

When installing Sitecore Experience Commerce 9.0 on my local developer machine (Windows 10 professional), the following error occurred:
[--------------------------------- CreateWebAppPoolMinions : ManageCommerceService -----------------------------------]
[CreateWebAppPoolMinions]:[Create-WebAppPool] CommerceMinions_Sc9
Creating and starting the CommerceMinions_Sc9 Services application pool
Command start time: 20180110222144
PS>TerminatingError(Invoke-ManageCommerceServiceTask): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: The term 'Install-WindowsFeature' 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."
I then installed Remote Server Administration Tools on my machine which then allows this feature to work in PowerShell (after running import-module servermanager). However this then led to the following error message:
TerminatingError(Install-WindowsFeature): "The target of the specified cmdlet cannot be a Windows client-based operating system."
It appears that the Install-WindowsFeature command in PowerShell is only available on Windows Server. After searching through the PowerShell files I found the following line in the ManageCommerceServices.psm1 file:
Install-WindowsFeature -Name Web-AppInit
I simply commented this file out to get the installation to continue, and ensured that the feature was installed manually.

1 comment:

  1. I have replaced the install-WindowsFeature -Name Web-AppInit with Enable-WindowsOptionalFeature -Online -FeatureName IIS-ApplicationInit