Search code examples
powershelliisvirtual-directoryoctopus-deploy

How can I create a nested virtual directory in IIS through Octopus deploy?


I have a powershell script to create a virtual directory.However, I want to create a nested virtual directory in IIS through Octopus deploy using PowerShell script.


Solution

  • Could you just use something like below?

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