and*_*cci 4 iis environment-variables appcmd
在IIS管理器上为每个站点设置环境变量非常容易:
我正在寻找使用appcmd.exe的方法,所以我可以在我的安装脚本中包含它.
我得到的最接近的是:
C:\>C:\Windows\System32\inetsrv\appcmd.exe set config "dashboard" -section:system.webServer/aspNetCore /environmentVariables.[name='foo',value='bar'] /commit:apphost
Run Code Online (Sandbox Code Playgroud)
- >仪表板是我网站的名称.
但是此命令返回此错误:
错误(消息:找不到请求的集合元素.)
您可能已经想出来了,但这种格式应该有效:
appcmd.exe set config "dashboard" -section:system.webServer/aspNetCore /+"environmentVariables.[name='foo',value='bar']" /commit:apphost
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2379 次 |
| 最近记录: |