dsingh23
dsingh23

Reputation: 195

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.

Upvotes: 1

Views: 1398

Answers (2)

Kye
Kye

Reputation: 6279

If possible you should leverage the tool and avoid writing bespoke PowerShell which will need to be maintained and import a tested template from the Octopus Deploy Template Library.

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

Upvotes: 1

Alex M
Alex M

Reputation: 2548

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'

Upvotes: 1

Related Questions