The term 'iis' is not recognized as the name of a cmdlet

Question: How do I control IIS from Windows Terminal (PowerShell)? when I type "iis" in Windows PowerShell I get the error "iis : The term 'iis' 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 again".

 


Please Login to see the rest of the answer

Answer: I think you are trying to run IIS commands from #Windows PowerShell, however, the IIS commands used to come with PowerShell IISAdminstration 1.1.0.0 which is currently missing from Windows 10 or 11. If you need to use that Module then it needs to be installed separately.

However, you can try to import the Module #IISAdminstration using the command below:

Before you install the IISAdminstration Module using PowerShell, first you need to enable IIS Scripting Module in order for IIS to receive commands from PowerShell.
1. Navigate to Control Panel
Access Control Panel in Windows 11

Turn Windows Features On and Off

2. Enable the Scripting Module in Internet Information Service (IIS)
Enable Scripting in IIS

1. Start PowerShell or Windows #Terminal in Administration mode.
2. Copy and Paste the code below in order to install the IISAdministration Module

import-module -Name IISAdministration -RequiredVersion 1.1.0.0
$mod = Get-Module -Name IISAdministration
$mod.Version
$mod.ExportedCmdlets | Format-Table

3. After the IISAdminstration Module is successfully installed run the last command to see the available Console Command you could execute to control IIS from Terminal.

4. You then see all the IIS Commands you can run from Windows PowerShell.

 $mod.ExportedCmdlets | Format-Table

Key                                  Value
---                                  -----
Clear-IISCentralCertProvider         Clear-IISCentralCertProvider
Clear-IISConfigCollection            Clear-IISConfigCollection
Disable-IISCentralCertProvider       Disable-IISCentralCertProvider
Disable-IISSharedConfig              Disable-IISSharedConfig
Enable-IISCentralCertProvider        Enable-IISCentralCertProvider
Enable-IISSharedConfig               Enable-IISSharedConfig
Export-IISConfiguration              Export-IISConfiguration
Get-IISCentralCertProvider           Get-IISCentralCertProvider
Get-IISConfigAttributeValue          Get-IISConfigAttributeValue
Get-IISConfigCollection              Get-IISConfigCollection
Get-IISConfigCollectionElement       Get-IISConfigCollectionElement
Get-IISConfigElement                 Get-IISConfigElement
Get-IISConfigSection                 Get-IISConfigSection
Get-IISServerManager                 Get-IISServerManager
Get-IISSharedConfig                  Get-IISSharedConfig
Get-IISSiteBinding                   Get-IISSiteBinding
New-IISConfigCollectionElement       New-IISConfigCollectionElement
New-IISSite                          New-IISSite
New-IISSiteBinding                   New-IISSiteBinding
Remove-IISConfigAttribute            Remove-IISConfigAttribute
Remove-IISConfigCollectionElement    Remove-IISConfigCollectionElement
Remove-IISConfigElement              Remove-IISConfigElement
Remove-IISSite                       Remove-IISSite
Remove-IISSiteBinding                Remove-IISSiteBinding
Reset-IISServerManager               Reset-IISServerManager
Set-IISCentralCertProvider           Set-IISCentralCertProvider
Set-IISCentralCertProviderCredential Set-IISCentralCertProviderCredential
Set-IISConfigAttributeValue          Set-IISConfigAttributeValue
Start-IISCommitDelay                 Start-IISCommitDelay
Start-IISSite                        Start-IISSite
Stop-IISCommitDelay                  Stop-IISCommitDelay
Stop-IISSite                         Stop-IISSite


If this article helped you, please leave us a comment to know that it was helpful.


Write an Article
If you log in, you will be notified when someone leaves a comment.

Other users would like to know if this solution helped you.


© 2022 - ErnesTech - Privacy