Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"IIS Application - Create" step template incorrectly check for parent site existence #315

Closed
KasperHoldum opened this issue May 12, 2016 · 1 comment

Comments

@KasperHoldum
Copy link

The "Get-Website" cmdlet is used which has an active bug that ignores the -name parameter thus returning all websites. So the following check just checks if any website exist:

$site = Get-Website -name $parentSite
if (!$site) {
    throw "The web site '$parentSite' does not exist. Please create the site first."
}

It should instead be changed to:

try{
   **$site = Get-Website |?{$_.Name -eq $parentSite}**
} 
catch [System.IO.FileNotFoundException]{
   $site = Get-Website |?{$_.Name -eq $parentSite}
} 
finally {
    Write-Host $site.name # or do whatever meaningful thing we want to do...
}

Or similar.

@hnrkndrssn
Copy link
Contributor

The step template has been updated to not use the -name parameter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants