PowerShell i IIS 02: Moduł WebAdministration

29-paź-2016

Po zainstalowaniu IIS na systemie dostępny staje się moduł WebAdministration. Można go wylistować korzystając z polecenia Get-Module -ListAvailable

iis021

iis022

We właściwości ExportedCommands widać już listę dostępnych poleceń. Aby wyświetlić je wszystkie lepiej użyć Get-Command z parametrem -Module WebAdministration
Oto wynik tego polecenia

CommandType     Name                                               Version    Source                                   

-----------     ----                                               -------    ------                                   

Function        IIS:                                               1.0.0.0    WebAdministration                        

Cmdlet          Add-WebConfiguration                               1.0.0.0    WebAdministration                        

Cmdlet          Add-WebConfigurationLock                           1.0.0.0    WebAdministration                        

Cmdlet          Add-WebConfigurationProperty                       1.0.0.0    WebAdministration                        

Cmdlet          Backup-WebConfiguration                            1.0.0.0    WebAdministration                        

Cmdlet          Clear-WebCentralCertProvider                       1.0.0.0    WebAdministration                        

Cmdlet          Clear-WebConfiguration                             1.0.0.0    WebAdministration                        

Cmdlet          Clear-WebRequestTracingSetting                     1.0.0.0    WebAdministration                        

Cmdlet          Clear-WebRequestTracingSettings                    1.0.0.0    WebAdministration                        

Cmdlet          ConvertTo-WebApplication                           1.0.0.0    WebAdministration                        

Cmdlet          Disable-WebCentralCertProvider                     1.0.0.0    WebAdministration                        

Cmdlet          Disable-WebGlobalModule                            1.0.0.0    WebAdministration                        

Cmdlet          Disable-WebRequestTracing                          1.0.0.0    WebAdministration                        

Cmdlet          Enable-WebCentralCertProvider                      1.0.0.0    WebAdministration                        

Cmdlet          Enable-WebGlobalModule                             1.0.0.0    WebAdministration                        

Cmdlet          Enable-WebRequestTracing                           1.0.0.0    WebAdministration                        

Cmdlet          Get-WebAppDomain                                   1.0.0.0    WebAdministration                        

Cmdlet          Get-WebApplication                                 1.0.0.0    WebAdministration                        

Cmdlet          Get-WebAppPoolState                                1.0.0.0    WebAdministration                        

Cmdlet          Get-WebBinding                                     1.0.0.0    WebAdministration                        

Cmdlet          Get-WebCentralCertProvider                         1.0.0.0    WebAdministration                        

Cmdlet          Get-WebConfigFile                                  1.0.0.0    WebAdministration                        

Cmdlet          Get-WebConfiguration                               1.0.0.0    WebAdministration                        

Cmdlet          Get-WebConfigurationBackup                         1.0.0.0    WebAdministration                        

Cmdlet          Get-WebConfigurationLocation                       1.0.0.0    WebAdministration                        

Cmdlet          Get-WebConfigurationLock                           1.0.0.0    WebAdministration                        

Cmdlet          Get-WebConfigurationProperty                       1.0.0.0    WebAdministration                        

Cmdlet          Get-WebFilePath                                    1.0.0.0    WebAdministration                        

Cmdlet          Get-WebGlobalModule                                1.0.0.0    WebAdministration                        

Cmdlet          Get-WebHandler                                     1.0.0.0    WebAdministration                        

Cmdlet          Get-WebItemState                                   1.0.0.0    WebAdministration                        

Cmdlet          Get-WebManagedModule                               1.0.0.0    WebAdministration                        

Cmdlet          Get-WebRequest                                     1.0.0.0    WebAdministration                        

Cmdlet          Get-Website                                        1.0.0.0    WebAdministration                        

Cmdlet          Get-WebsiteState                                   1.0.0.0    WebAdministration                        

Cmdlet          Get-WebURL                                         1.0.0.0    WebAdministration                        

Cmdlet          Get-WebVirtualDirectory                            1.0.0.0    WebAdministration                        

Cmdlet          New-WebApplication                                 1.0.0.0    WebAdministration                        

Cmdlet          New-WebAppPool                                     1.0.0.0    WebAdministration                        

Cmdlet          New-WebBinding                                     1.0.0.0    WebAdministration                        

Cmdlet          New-WebFtpSite                                     1.0.0.0    WebAdministration                        

Cmdlet          New-WebGlobalModule                                1.0.0.0    WebAdministration                        

Cmdlet          New-WebHandler                                     1.0.0.0    WebAdministration                        

Cmdlet          New-WebManagedModule                               1.0.0.0    WebAdministration                        

Cmdlet          New-Website                                        1.0.0.0    WebAdministration                        

Cmdlet          New-WebVirtualDirectory                            1.0.0.0    WebAdministration                        

Cmdlet          Remove-WebApplication                              1.0.0.0    WebAdministration                        

Cmdlet          Remove-WebAppPool                                  1.0.0.0    WebAdministration                        

Cmdlet          Remove-WebBinding                                  1.0.0.0    WebAdministration                        

Cmdlet          Remove-WebConfigurationBackup                      1.0.0.0    WebAdministration                        

Cmdlet          Remove-WebConfigurationLocation                    1.0.0.0    WebAdministration                        

Cmdlet          Remove-WebConfigurationLock                        1.0.0.0    WebAdministration                        

Cmdlet          Remove-WebConfigurationProperty                    1.0.0.0    WebAdministration                        

Cmdlet          Remove-WebGlobalModule                             1.0.0.0    WebAdministration                        

Cmdlet          Remove-WebHandler                                  1.0.0.0    WebAdministration                        

Cmdlet          Remove-WebManagedModule                            1.0.0.0    WebAdministration                        

Cmdlet          Remove-Website                                     1.0.0.0    WebAdministration                        

Cmdlet          Remove-WebVirtualDirectory                         1.0.0.0    WebAdministration                        

Cmdlet          Rename-WebConfigurationLocation                    1.0.0.0    WebAdministration                        

Cmdlet          Restart-WebAppPool                                 1.0.0.0    WebAdministration                        

Cmdlet          Restart-WebItem                                    1.0.0.0    WebAdministration                        

Cmdlet          Restore-WebConfiguration                           1.0.0.0    WebAdministration                        

Cmdlet          Select-WebConfiguration                            1.0.0.0    WebAdministration                        

Cmdlet          Set-WebBinding                                     1.0.0.0    WebAdministration                        

Cmdlet          Set-WebCentralCertProvider                         1.0.0.0    WebAdministration                        

Cmdlet          Set-WebCentralCertProviderCredential               1.0.0.0    WebAdministration                        

Cmdlet          Set-WebConfiguration                               1.0.0.0    WebAdministration                        

Cmdlet          Set-WebConfigurationProperty                       1.0.0.0    WebAdministration                        

Cmdlet          Set-WebGlobalModule                                1.0.0.0    WebAdministration                        

Cmdlet          Set-WebHandler                                     1.0.0.0    WebAdministration                        

Cmdlet          Set-WebManagedModule                               1.0.0.0    WebAdministration                        

Cmdlet          Start-WebAppPool                                   1.0.0.0    WebAdministration                        

Cmdlet          Start-WebCommitDelay                               1.0.0.0    WebAdministration                        

Cmdlet          Start-WebItem                                      1.0.0.0    WebAdministration                        

Cmdlet          Start-Website                                      1.0.0.0    WebAdministration                        

Cmdlet          Stop-WebAppPool                                    1.0.0.0    WebAdministration                        

Cmdlet          Stop-WebCommitDelay                                1.0.0.0    WebAdministration                        

Cmdlet          Stop-WebItem                                       1.0.0.0    WebAdministration                        

Cmdlet          Stop-Website                                       1.0.0.0    WebAdministration

Aby skorzystać z tych poleceń zaimportuj najpierw ten moduł poleceniem Import-Module. Od wersji 4.0, jeśli uruchomione zostanie polecenie z niezaładowanego do pamięci modułu to ten moduł zostanie w tle załadowany automatycznie, można więc założyć, że ten krok jest opcjonalny.

Komentarze są wyłączone

Autor: Rafał Kraik