diff --git a/windows/win_iis_virtualdirectory.ps1 b/windows/win_iis_virtualdirectory.ps1 index 3f2ab692b42..44854ff09b4 100644 --- a/windows/win_iis_virtualdirectory.ps1 +++ b/windows/win_iis_virtualdirectory.ps1 @@ -66,7 +66,11 @@ $directory_path = if($application) { } # Directory info -$directory = Get-WebVirtualDirectory -Site $site -Name $name +$directory = if($application) { + Get-WebVirtualDirectory -Site $site -Name $name -Application $application +} else { + Get-WebVirtualDirectory -Site $site -Name $name +} try { # Add directory