简体   繁体   中英

Enable Development time IIS support from PowerShell

I like to keep a PowerShell script that installs and configures my development applications (Visual Studio, VSC, Git etc etc) and environment, mainly using chocolatey. This helps if I change machine or we take on a new developer.

Here is part of my existing script. It installs Visual Studio 2019 and required workloads then enables the local IIS Windows Features for local debugging:

choco install -y visualstudio2019professional
choco install -y visualstudio2019-workload-netweb
choco install -y visualstudio2019-workload-data
choco install -y visualstudio2019-workload-manageddesktop
choco install -y netfx-4.5.2-devpack

Enable-WindowsOptionalFeature -Online -All -FeatureName IIS-WebServerRole
Enable-WindowsOptionalFeature -Online -All -FeatureName IIS-BasicAuthentication
Enable-WindowsOptionalFeature -Online -All -FeatureName IIS-WindowsAuthentication
Enable-WindowsOptionalFeature -Online -All -FeatureName IIS-ASP
Enable-WindowsOptionalFeature -Online -All -FeatureName IIS-ASPNET45
Enable-WindowsOptionalFeature -Online -All -FeatureName IIS-HttpRedirect
Enable-WindowsOptionalFeature -Online -All -FeatureName WCF-HTTP-Activation
Enable-WindowsOptionalFeature -Online -All -FeatureName WCF-HTTP-Activation45

I have recently come across the requirement to enable "Development time IIS support" in the Visual Studio Installer for .NET Core applications as per https://devblogs.microsoft.com/do.net/development-time-iis-support-for-asp.net-core-applications/#development-time-iis-support . Is there a way I can do this from PowerShell?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM