【发布时间】:2016-09-26 20:43:46
【问题描述】:
我有一个用于创建虚拟目录的 powershell 脚本。但是,我想使用 PowerShell 脚本通过 Octopus 部署在 IIS 中创建一个嵌套虚拟目录。
【问题讨论】:
标签: powershell iis virtual-directory octopus-deploy
我有一个用于创建虚拟目录的 powershell 脚本。但是,我想使用 PowerShell 脚本通过 Octopus 部署在 IIS 中创建一个嵌套虚拟目录。
【问题讨论】:
标签: powershell iis virtual-directory octopus-deploy
你能用下面这样的东西吗?
#Create a virtual directory
New-WebVirtualDirectory -Name 'Test' -Site 'Default Web Site\Website1' -PhysicalPath 'C:\inetpub'
#Create a nested virtual directory
New-WebVirtualDirectory -Name 'Test2' -Site 'Default Web Site\Website1\Test' -PhysicalPath 'C:\inetpub'
【讨论】:
-PhysicalPath 参数?
如果可能,您应该利用该工具并避免编写需要维护的定制 PowerShell,并从 Octopus Deploy Template Library 导入经过测试的模板。
https://library.octopusdeploy.com/step-template/actiontemplate-iis-virtual-directory-create
【讨论】:
Library 部分下使用Script Modules。至少你应该得到一个单一的维护点。