Skip to content

Commit

Permalink
Fix error when no extra aliases to rename
Browse files Browse the repository at this point in the history
  • Loading branch information
bdukes committed Aug 11, 2023
1 parent 6e83d10 commit 7891e63
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DnnWebsiteManagement/DnnWebsiteManagement.psm1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Requires -Version 3
#Requires -Version 3
#Requires -Modules Add-HostFileEntry, AdministratorRole, PKI, SslWebBinding, SqlServer, IISAdministration, Read-Choice
Set-StrictMode -Version:Latest

Expand Down Expand Up @@ -572,7 +572,7 @@ function New-DNNSite {
invokeSql -Query:"UPDATE $(getDnnDatabaseObjectName -objectName:'PortalSettings' -DatabaseOwner:$DatabaseOwner -ObjectQualifier:$ObjectQualifier) SET SettingValue = REPLACE(SettingValue, '$Domain', '$Name') WHERE SettingName = 'DefaultPortalAlias'" -Database:$Name
}

$aliases = invokeSql -Query:"SELECT PortalID, HTTPAlias FROM $(getDnnDatabaseObjectName -objectName:'PortalAlias' -DatabaseOwner:$DatabaseOwner -ObjectQualifier:$ObjectQualifier) WHERE HTTPAlias != '$Name' ORDER BY PortalID, HTTPAlias" -Database:$Name
$aliases = @(invokeSql -Query:"SELECT PortalID, HTTPAlias FROM $(getDnnDatabaseObjectName -objectName:'PortalAlias' -DatabaseOwner:$DatabaseOwner -ObjectQualifier:$ObjectQualifier) WHERE HTTPAlias != '$Name' ORDER BY PortalID, HTTPAlias" -Database:$Name);
if ($Domain -ne '') {
$aliasCount = $aliases.Count
$ProcessManual = $false
Expand Down

0 comments on commit 7891e63

Please sign in to comment.