首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >静默安装dotnet4.8和4.8.1

静默安装dotnet4.8和4.8.1

原创
作者头像
Windows技术交流
修改2025-07-15 17:28:34
修改2025-07-15 17:28:34
1.8K0
举报
文章被收录于专栏:Windows技术交流Windows技术交流

<server2022只能安装dotnet4.8

代码语言:txt
复制
KB4486129 Server2016
KB4486153 Server2019
代码语言:powershell
复制
$client111 = new-object System.Net.WebClient
$client111.DownloadFile('http://download.visualstudio.microsoft.com/download/pr/2d6bb6b2-226a-4baa-bdec-798822606ff1/9b7b8746971ed51a1770ae4293618187/ndp48-web.exe','c:\ndp48-web.exe')
cmd.exe /c C:\ndp48-web.exe /q /log %temp%\SP123.html /norestart

≥server2022才可以安装dotnet4.8.1

代码语言:txt
复制
KB5011048 Server2022
代码语言:powershell
复制
$client111 = new-object System.Net.WebClient
$client111.DownloadFile('http://download.microsoft.com/download/4/b/2/cd00d4ed-ebdd-49ee-8a33-eabc3d1030e3/NDP481-Web.exe','c:\NDP481-Web.exe')
cmd.exe /c C:\NDP481-Web.exe /q /log %temp%\SP123.html /norestart

安装完成后重启机器生效

安装完成后重启机器生效

安装完成后重启机器生效

然后可以安装检查dotnet版本号的命令行工具

代码语言:txt
复制
(Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full").Release

https://learn.microsoft.com/zh-cn/dotnet/framework/install/how-to-determine-which-versions-are-installed

代码语言:powershell
复制
[System.Net.ServicePointManager]::SecurityProtocol.HasFlag([Net.SecurityProtocolType]::Tls12)

if(([System.Net.ServicePointManager]::SecurityProtocol.HasFlag([Net.SecurityProtocolType]::Tls12)) -eq $false){
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12
}

[System.Net.ServicePointManager]::SecurityProtocol.HasFlag([Net.SecurityProtocolType]::Tls12)

Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force

Install-Module -Name DotNetVersionLister -Scope CurrentUser -Force
Get-STDotNetVersion -NoSummary

server2019

server2022

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档