Error while enabling IIS optional feature IIS-ASPNET and IIS-ManagementConsole - powershell

I am unable to enable the optional feature IIS-ASPNET and IIS-ManagementConsole. I keep getting the below error
Enable-WindowsOptionalFeature : One or several parent features are disabled so current feature can not be enabled.
At line:1 char:1
+ Enable-WindowsOptionalFeature -Online -FeatureName IIS-ASPNET
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Enable-WindowsOptionalFeature], COMException
+ FullyQualifiedErrorId : Microsoft.Dism.Commands.EnableWindowsOptionalFeatureCommand
What are the parent features of iis-aspnet and IIS-ManagementConsole that need to be enabled?

You need to pass the -All parameter to Enable-WindowsOptionalFeatures which installs the required parent features:
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ASPNET, IIS-ManagementConsole -All

To enable asp.net you also need to install the .net extensibility feature. you could try below PowerShell command:
Enable-WindowsOptionalFeature -Online -FeatureName IIS-NetFxExtensibility, IIS-NetFxExtensibility45,IIS-ASPNET, IIS-ASPNET45
To enable ManagementConsole you could use below command:
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ManagementConsole

Related

Failed to update Help for the module

PS C:\WINDOWS\system32> Update-Help
Update-Help : Failed to update Help for the module(s) 'WindowsUpdateProvider'
with UI culture(s) {en-US} : Unable to retrieve the HelpInfo XML file for UI
culture en-US. Make sure the HelpInfoUri property in the module manifest is
valid or check your network connection and then try the command again.
At line:1 char:1
+ Update-Help
+ ~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [Update-Help], Exception
+ FullyQualifiedErrorId : UnableToRetrieveHelpInfoXml,Microsoft.PowerShell.Commands.UpdateHelpCommand
PS C:\WINDOWS\system32>
Please try the below, sometimes there's no XML document to update.
Update-Help -Verbose -Force -ErrorAction SilentlyContinue
Official link to Microsoft: Link
According to this link
Apparently a problem at Microsoft's end it always happens since sometimes there's no XML document to update, so for the time being use this command:
Update-Help -Verbose -Force -ErrorAction SilentlyContinue

Multicast MSMQ inside Docker Windows Container

We have a legacy windows project, that we would like to containerize.
This uses MSMQ multicasting (part of Telerik's obsolete ORM).
Inside my Windows Container, If I attempt
Enable-WindowsOptionalFeature -Oneline -FeatureName MSMQ-Multicast -All
This fails:
Enable-WindowsOptionalFeature : One or several parent features are disabled so current feature can not be enabled.
At line:1 char:1
+ Enable-WindowsOptionalFeature -Online -FeatureName MSMQ-Multicast -Al ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Enable-WindowsOptionalFeature], COMException
+ FullyQualifiedErrorId : Microsoft.Dism.Commands.EnableWindowsOptionalFeatureCommand
Also:
PS C:\scripts> netcfg -c p -i ms_rmcast
Trying to install ms_rmcast ...
... failed. Error code: 0x800106d9.
The container is connected via a 'transparent' network type, so is bridged to the local network.
Is there any solution to this, or is this just not (yet) supported?
Is version 1809 likely to help?
Any other clever ideas?
MSMQ was added in 1803 SAC channel. It does not exist in LTSC channel.
https://blogs.technet.microsoft.com/virtualization/2018/07/25/hello-world-msmq-from-windows-containers/

Error while enabling IISNET45

I am running powershell scripts to install IIS. Below is my script
Add-WindowsFeature NET-Framework-45-ASPNET
Add-WindowsFeature NET-HTTP-Activation
Add-WindowsFeature Telnet-Client
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerRole
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServer
Enable-WindowsOptionalFeature -Online -FeatureName IIS-CommonHttpFeatures
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpErrors
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpRedirect
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ApplicationDevelopment
Enable-WindowsOptionalFeature -Online -FeatureName IIS-NetFxExtensibility45
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HealthAndDiagnostics
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpLogging
Enable-WindowsOptionalFeature -Online -FeatureName IIS-LoggingLibraries
Enable-WindowsOptionalFeature -Online -FeatureName IIS-RequestMonitor
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpTracing
Enable-WindowsOptionalFeature -Online -FeatureName IIS-Security
Enable-WindowsOptionalFeature -Online -FeatureName IIS-RequestFiltering
Enable-WindowsOptionalFeature -Online -FeatureName IIS-Performance
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerManagementTools
Enable-WindowsOptionalFeature -Online -FeatureName IIS-IIS6ManagementCompatibility
Enable-WindowsOptionalFeature -Online -FeatureName IIS-Metabase
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ManagementConsole
Enable-WindowsOptionalFeature -Online -FeatureName IIS-BasicAuthentication
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WindowsAuthentication
Enable-WindowsOptionalFeature -Online -FeatureName IIS-StaticContent
Enable-WindowsOptionalFeature -Online -FeatureName IIS-DefaultDocument
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebSockets
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ApplicationInit
Enable-WindowsOptionalFeature -Online -FeatureName IIS-NetFxExtensibility45
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ASPNET45
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ISAPIExtensions
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ISAPIFilter
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpCompressionStatic
Add-WindowsFeature Web-Scripting-Tools
Add-WindowsFeature MSMQ
Add-WindowsFeature msmq-server, msmq-triggers
Add-WindowsFeature Web-Ftp-Server
I get error
Enable-WindowsOptionalFeature : One or several parent features are disabled so current feature can not be enabled.
At C:\SetupScripts\Install-IIS.ps1:34 char:1
+ Enable-WindowsOptionalFeature -Online -FeatureName IIS-ASPNET45
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Enable-WindowsOptionalFeature], COMException
+ FullyQualifiedErrorId : Microsoft.Dism.Commands.EnableWindowsOptionalFeatureCommand
What am i doing wrong here? Sure something is wrong?
Try to add option -All at the end. The All parameter enables all parent features of the specified feature before enabling the specified feature. The parent feature will be enabled with default values
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ASPNET45 -All
Also please refer
https://learn.microsoft.com/en-us/powershell/module/dism/enable-windowsoptionalfeature?view=win10-ps
I just had the same problem, and found that I had to install IIS-ISAPIExtensions and IIS-ISAPIFilter before installing IIS-ASPNET45. In other words:
...
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ISAPIExtensions
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ISAPIFilter
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ASPNET45
...
I don't know of any easy way to find the parent feature of another feature. It would have been nice if it was a property on the objects returned from Get-WindowsOptionalFeature
You will get it done by adding below in your script
Enable-WindowsOptionalFeature -online -FeatureName NetFx4Extended-ASPNET45
I had same issue like this previously. I solved it by simply by running PowerShell as Administrator. Even after running from elevated PowerShell,if it still throw an error then please try this
Install-WindowsFeature -name Web-Server -IncludeManagementTools
Make sure you run this script from an Admin Prompt!
Make sure Powershell Execution Policy is bypassed to run these scripts:
YOU MAY HAVE TO RUN THIS COMMAND PRIOR TO RUNNING THIS SCRIPT
Set-ExecutionPolicy Bypass -Scope Process

How to install documentation for 7zip4PowerShell

After installing the 7zip4PowerShell module, if I call Get-Help on any of its cmdlets, I get the message
Get-Help cannot find the Help files for this cmdlet on this computer. It is displaying only partial help.
-- To download and install Help files for the module that includes this cmdlet, use Update-Help.
If I call update-help by itself, it doesn't change anything.
If I call update-help -Module 7zip4PowerShell, I get the following:
PS C:\windows\system32> update-help -Module 7zip4PowerShell
update-help : Failed to update Help for the module(s) :
'7Zip4Powershell'
The HelpInfoURI https://github.com/thoemmi/7Zip4Powershell does not start with HTTP.
At line:1 char:1
+ update-help -Module 7zip4PowerShell
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (HelpInfoUri:Uri) [Update-Help], Exception
+ FullyQualifiedErrorId : InvalidHelpInfoUriFormat,Microsoft.PowerShell.Commands.UpdateHelpCommand
What am I doing wrong?

Install hyperv cmdlet on workstation

I have a script that starts new HyperV VM's on a remote server using powershell
New-VM
Get-VM
I want to run this script on my desktop, however I get the following error.
the term 'new-vm' is not recognized as the name of a cmdlet
I can't figure out how to install the new-vm cmdlet on my workstation
Get-WindowsFeature
the target of the specified cmdlet cannot be a windows client-based operating system
Install-windowsFeature hyperv-
the target of the specified cmdlet cannot be a windows client-based operating system
I am very new to powershell, and don't do much with windows.
How can I install the cmdlet New-VM on a Windows 8 machine?
Update
Also tried the following.
Enable-WindowsOptionalFeature -Online -FeatureName Hyper-V-Tools
Enable-WindowsOptionalFeature -Online -FeatureName Hyper-V-PowerShell
I see hyperv tools in the following command
Get-WindowsOptionalFeature -Online | sort state
Microsoft-Hyper-V
Microsoft-Hyper-V-Tools-All
Microsoft-Hyper-V-Management-Powershell
Update 2
I almost got it installed, but it gives this error:
PS C:\Windows\system32> Enable-WindowsOptionalFeature -online -FeatureName Microsoft-Hyper-V-Management-Powershell
Enable-WindowsOptionalFeature : One or several parent features are disabled so current feature can not be enabled.
At line:1 char:1
+ Enable-WindowsOptionalFeature -online -FeatureName Microsoft-Hyper-V-Management- ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Enable-WindowsOptionalFeature], COMException
+ FullyQualifiedErrorId : Microsoft.Dism.Commands.EnableWindowsOptionalFeatureCommand
PS C:\Windows\system32>
Got it installed. The powershell cmdlet has parents that can be installed by adding -all.
Enable-WindowsOptionalFeature -online -FeatureName Microsoft-Hyper-V-Management-Powershell -all
You will need to reboot before the cmdlet is available.