Powershell 如何通过Octopus deploy在IIS中创建嵌套虚拟目录?

Powershell 如何通过Octopus deploy在IIS中创建嵌套虚拟目录?,powershell,iis,virtual-directory,octopus-deploy,Powershell,Iis,Virtual Directory,Octopus Deploy,我有一个powershell脚本来创建虚拟目录。但是,我想使用powershell脚本通过Octopus deploy在IIS中创建一个嵌套的虚拟目录。您可以使用下面的方法吗 #Create a virtual directory New-WebVirtualDirectory -Name 'Test' -Site 'Default Web Site\Website1' -PhysicalPath 'C:\inetpub' #Create a nested virtual directory N

我有一个powershell脚本来创建虚拟目录。但是,我想使用powershell脚本通过Octopus deploy在IIS中创建一个嵌套的虚拟目录。

您可以使用下面的方法吗

#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'

如果可能,您应该利用该工具,避免编写需要维护的定制PowerShell,并从
Octopus Deploy template Library
导入经过测试的模板


这创建了一个空的虚拟目录。我应该如何将嵌套的虚拟目录与另一个文件夹中的一些图像映射?使用
-PhysicalPath
参数?同意,如果可能,使用Octopus内置模板或从库中映射。如果需要不同的功能,也可以使用
部分下的
脚本模块
。至少你应该得到一个单一的维护点。