[英]Check if iis module exist by appcmd
I need to check if my custom IIS module is installed for my site.我需要检查是否为我的站点安装了我的自定义 IIS 模块。 I run command bellow:
我运行以下命令:
C:\windows\system32\inetsrv\appcmd.exe list config 'mySite' /section:system.webServer/modules /[name="myModuleName"]
And see the error:并查看错误:
ERROR ( message:The attribute "[name=myModuleName]" is not supported in the current command usage. )
错误(消息:当前命令用法中不支持属性“[name=myModuleName]”。)
What I am doing wrong?我做错了什么?
If you are on current versions of IIS (7 and higher), then why not just use the IIS Admin or Web Admin cmdlets, vs app command for this effort?如果您使用的是当前版本的 IIS(7 及更高版本),那么为什么不直接使用 IIS Admin 或 Web Admin cmdlet、vs app 命令来完成这项工作呢?
https://docs.microsoft.com/en-us/iis/get-started/whats-new-in-iis-10/iisadministration-powershell-cmdlets
https://docs.microsoft.com/en-us/iis/get-started/whats-new-in-iis-10/iisadministration-powershell-cmdlets
https://docs.microsoft.com/en-us/powershell/module/webadministration/?view=win10-ps
https://docs.microsoft.com/en-us/powershell/module/webadministration/?view=win10-ps
https://octopus.com/blog/iis-powershell
https://octopus.com/blog/iis-powershell
https://blogs.iis.net/jeonghwan/iis-powershell-user-guide-comparing-representative-iis-ui-tasks
https://blogs.iis.net/jeonghwan/iis-powershell-user-guide-comparing-representative-iis-ui-tasks
# [IIS] Configure Module elements and properties which are configured in globalModules section
# Case1: List all native modules
(Get-WebConfiguration //globalmodules).collection -PSPath iis:
# Case4: List all of enabled modules from 'server' level
(get-webconfiguration //modules -PSPath iis:).collection -PSPath iis:
# Case5: Get the attributes for a specific module
$modules=(get-webconfiguration //modules -PSPath iis:).collection
$modules | foreach {if ($_.name -eq "cgiModule") { $_.attributes | select name, value}}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.