Delete lingering script (#7266)
parent
5c9f59da20
commit
6d2c6fed29
|
@ -1,31 +0,0 @@
|
|||
# Backup existing applicationHost.config
|
||||
copy C:\Windows\System32\inetsrv\config\applicationHost.config C:\Windows\System32\inetsrv\config\applicationHost_BeforeInstallingAspNetCoreModule.config
|
||||
|
||||
Import-Module IISAdministration
|
||||
|
||||
# Initialize variables
|
||||
$aspNetCoreHandlerFilePath="C:\windows\system32\inetsrv\aspnetcore.dll"
|
||||
Reset-IISServerManager -confirm:$false
|
||||
$sm = Get-IISServerManager
|
||||
|
||||
# Add AppSettings section
|
||||
$sm.GetApplicationHostConfiguration().RootSectionGroup.Sections.Add("appSettings")
|
||||
|
||||
# Set Allow for handlers section
|
||||
$appHostconfig = $sm.GetApplicationHostConfiguration()
|
||||
$section = $appHostconfig.GetSection("system.webServer/handlers")
|
||||
$section.OverrideMode="Allow"
|
||||
|
||||
# Add aspNetCore section to system.webServer
|
||||
$sectionaspNetCore = $appHostConfig.RootSectionGroup.SectionGroups["system.webServer"].Sections.Add("aspNetCore")
|
||||
$sectionaspNetCore.OverrideModeDefault = "Allow"
|
||||
$sm.CommitChanges()
|
||||
|
||||
# Configure globalModule
|
||||
Reset-IISServerManager -confirm:$false
|
||||
$globalModules = Get-IISConfigSection "system.webServer/globalModules" | Get-IISConfigCollection
|
||||
New-IISConfigCollectionElement $globalModules -ConfigAttribute @{"name"="AspNetCoreModule";"image"=$aspNetCoreHandlerFilePath}
|
||||
|
||||
# Configure module
|
||||
$modules = Get-IISConfigSection "system.webServer/modules" | Get-IISConfigCollection
|
||||
New-IISConfigCollectionElement $modules -ConfigAttribute @{"name"="AspNetCoreModule"}
|
Loading…
Reference in New Issue