Otter Documentation

iis - Ensure Virtual Directory

  • Last Modified: 2018-09-21

This is generated from the built-in components of Otter 2.0, and may be different than what you have installed (especially if you have extensions); go to [User Icon] > Documentation within your Otter instance to see exactly what operations are available.

Ensure Virtual Directory

Ensures the existence of a virtual directory within an IIS site.

Operation type:

Ensuring - this operation will ensure a specified configuration exists on a remote server after comparing its current state to the desired state.

Script usage:

IIS::Ensure-VirtualDirectory(
	Site: <text>,
	[ApplicationPath: <text>],
	Path: <text>,
	[PhysicalPath: <text>],
	[LogonMethod: <integer>],
	[Credentials: <text>],
	[UserName: <text>],
	[Password: <text>],
	[Exists: <true/false>]
);

Arguments:

Name Format Script Usage Usage Notes
🔑 Site name
text
Site
The name of this site where the virtual directory would exist This argument is the unique key for this operation, which means it must uniquely identify the target of the operation. This argument is required.
🔑 Application path
text
ApplicationPath
The relative URL of the application containing the virtual directory, such as / This argument is the unique key for this operation, which means it must uniquely identify the target of the operation.
🔑 Virtual path
text
Path
The relative URL of the path, such as /hdars This argument is the unique key for this operation, which means it must uniquely identify the target of the operation. This argument is required.
Physical path
text
PhysicalPath
Physical path to the content for the virtual directory, such as c:\hdars.
Logon method
integer
LogonMethod
Specifies the type of the logon operation to perform when calling LogonUser to acquire the user token impersonated to access the physical path for the virtual directory.
Otter credentials
text
Credentials
The Otter credential name to be impersonated when accessing the physical path for the virtual directory. If a credential name is specified, the username and password fields will be ignored.
User name
text
UserName
Password
text
Password
Exists
true/false
Exists

Example:

# ensures that the hdars virtual directory pool is present on the web server
IIS::Ensure-VirtualDirectory(
    Site: Hdars,
    Path: /hdars,
    PhysicalPath: C:\hdars
);

Have a question? Try the Q&A Forum

Our documentation is now Open Source and on GitHub. We highly encourage our users to contribute and get involved! .