There are many reasons for this error, first you can try to restart your computer and try again, if it still can't work, you can try to install IIS with PowerShell, this may get more error messages. about how to install IIS with PowerShell, you can refer to below steps:
- In the search, type PowerShell, and then click Windows PowerShell run as administrator.
- In Windows PowerShell, type the following command:
Install-WindowsFeature -name Web-Server -IncludeManagementTools
- Press Enter.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.