Once IIS is installed, we need to import the WebAdministration
module to interact with IIS (using Import-Module
WebAdministration
). Using the Get-Command
cmdlet to find the Get-
cmdlets in the module is a good way to get an idea about what the module allows us to work with:
Here, we can see that we have cmdlets to deal with sites, virtual directories, applications, bindings, configuration, and much more. Another thing that is worth mentioning at this point is that the WebAdministration module also adds a new PSProvider called WebAdministration and a PSDrive called IIS, which exposes a hierarchical view of the IIS installation. Remember that PSDrives are how PowerShell exposes hierarchical data. In this case, the IIS configuration is treated in a similar way to a drive.