Windows上利用powershell安装dotnet和iis
- 2019 年 12 月 20 日
- 筆記
Windows2012/2016/2019利用powershell安装dotnet和iis非常简单
运行powershell输入Get-WindowsFeature -Name NET-*, Web-* | Install-WindowsFeature这句命令就可以了
如果不想要IIS-Ftp-Server,可以输入Get-WindowsFeature -Name Web-Ftp* | Uninstall-WindowsFeature卸载

如上图,有百分比的进度显示
如果是2008安装IIS,把下面这段命令另存为.bat文件执行即可
========================================================================
start /w pkgmgr /iu:TelnetClient;IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;IIS-ASP;IIS-CGI;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ODBCLogging;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-ClientCertificateMappingAuthentication;IIS-IISCertificateMappingAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-ManagementScriptingTools;IIS-ManagementService;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-LegacyScripts;IIS-LegacySnapIn;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI;IIS-FTPServer;IIS-FTPSvc;IIS-FTPExtensibility;IIS-WebDAV;IIS-HostableWebCore
pause
========================================================================
如果不想要IIS-Ftp-Server,另存为.bat文件时可以去掉结尾处斜体显示的IIS-FTPServer;IIS-FTPSvc;IIS-FTPExtensibility;