diff --git a/aspnetcore/tutorials/nano-server/enable-aspnetcoremodule.ps1 b/aspnetcore/tutorials/nano-server/enable-aspnetcoremodule.ps1 deleted file mode 100644 index 3710e98866..0000000000 --- a/aspnetcore/tutorials/nano-server/enable-aspnetcoremodule.ps1 +++ /dev/null @@ -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"}