【问题标题】:How can I create a nested virtual directory in IIS through Octopus deploy?如何通过 Octopus deploy 在 IIS 中创建嵌套虚拟目录?
【发布时间】:2016-09-26 20:43:46
【问题描述】:

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

【问题讨论】:

    标签: powershell iis virtual-directory octopus-deploy


    【解决方案1】:

    你能用下面这样的东西吗?

    #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 参数?
    【解决方案2】:

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

    https://library.octopusdeploy.com/step-template/actiontemplate-iis-virtual-directory-create

    【讨论】:

    • 同意,如果可能,请使用 Octopus 内置模板或来自库。如果需要不同的东西,也可以在Library 部分下使用Script Modules。至少你应该得到一个单一的维护点。
    猜你喜欢
    • 1970-01-01
    • 2012-02-02
    • 1970-01-01
    • 2010-09-20
    • 2017-01-02
    • 1970-01-01
    • 2016-10-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多