You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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:
It should instead be changed to:
Or similar.
The text was updated successfully, but these errors were encountered: