-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathsetup_iis.ps1
More file actions
15 lines (14 loc) · 670 Bytes
/
setup_iis.ps1
File metadata and controls
15 lines (14 loc) · 670 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# https://learn.microsoft.com/en-us/powershell/module/webadministration/new-website?view=windowsserver2025-ps
$loc = Get-Location
# $sites | Select-Object -Property *
$has_site = Get-Website | Select-Object PhysicalPath, Name | Where-Object PhysicalPath -eq $loc.path
if ($has_site -and $has_site.Name -ne "manager-gametools") {
Write-Output "Removed old site with wrong naming"
Remove-Website -Name $has_site.Name
}
$has_site = Get-Website | Select-Object PhysicalPath, Name | Where-Object PhysicalPath -eq $loc.path
$has_site
if ( !$has_site )
{
New-WebSite -Name "manager-gametools" -Port "80" -HostHeader "manager.localhost" -PhysicalPath $loc.path
}