简体   繁体   English

无法以管理员身份在新安装的 Windows Server 2016 上安装 NuGet?

[英]Unable to Install NuGet on newly installed Windows Server 2016 as Administrator?

I'm using Windows Server 2016 and ADFS 4.0.我正在使用 Windows Server 2016 和 ADFS 4.0。

As part of the troubleshooting AD Federation service, which requires me to install the NuGet and the Modules as per https://adfshelp.microsoft.com/diagnosticsanalyzer/Analyze作为故障排除 AD 联合服务的一部分,这要求我按照https://adfshelp.microsoft.com/diagnosticsanalyzer/Analyze安装 NuGet 和模块

This is what I have executed and the error:这是我已经执行的错误:

Install-Module -Name ADFSToolbox -Force
Import-Module -Name ADFSToolbox -Force
Install-PackageProvider -name NuGet -MinimumVersion 2.8.5.201 -Force

Error:错误:

WARNING: Unable to download from URI 'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' to ''.
WARNING: Unable to download the list of available providers. Check your internet connection.
PackageManagement\Install-PackageProvider : No match was found for the specified search criteria for the provider 'NuGet'. The package provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified package has the tags.
PackageManagement\Import-PackageProvider : No match was found for the specified search criteria and provider name 'NuGet'. Try 'Get-PackageProvider -ListAvailable' to see if the provider exists on the system.

WARNING: Unable to download from URI 'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' to ''.
WARNING: Unable to download the list of available providers. Check your internet connection.
PackageManagement\Get-PackageProvider : Unable to find package provider 'NuGet'. It may not be imported yet. Try 'Get-PackageProvider -ListAvailable'.

Install-Module : NuGet provider is required to interact with NuGet-based repositories. Please ensure that '2.8.5.201' or newer version of NuGet provider is installed.
Import-Module : The specified module 'ADFSToolbox' was not loaded because no valid module file was found in any module directory.

WARNING: Unable to download from URI 'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' to ''.
WARNING: Unable to download the list of available providers. Check your internet connection.
Install-PackageProvider : No match was found for the specified search criteria for the provider 'NuGet'. The package provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified package has the tags.

The script above was executed via Powershell ISE Run as Administrator with login as domain admins.上面的脚本是通过 Powershell ISE Run as Administrator以域管理员身份登录的。

Force PowerShell to use TLS 1.2, and then execute your commands.强制 PowerShell 使用 TLS 1.2,然后执行您的命令。 I ran into this issue after the cutoff date for TLS 1:我在 TLS 1 的截止日期之后遇到了这个问题:

[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Windows Server 2016 Dockerfile 安装服务 - Windows Server 2016 Dockerfile install service 尝试使用 Install-Module 在 Windows Server 2016 中安装 Docker 时出错 - Error trying to install Docker in Windows Server 2016 with Install-Module 检查并在Windows Server 2008/2012/2016上安装了Web浏览器 - Checking and a Web-Browser is installed on Windows Server 2008/2012/2016 Windows 2016中无法获取WindowsUpdateLog - Unable to get WindowsUpdateLog in Windows 2016 使用提升的 PowerShell 在 Windows Server 2016 上安装 Docker Engine Enterprise 失败 - Install Docker Engine Enterprise on Windows Server 2016 fails using elevated PowerShell Install-Package&NuGet Package安装位置 - 安装到哪里? - Install-Package & NuGet Package install location - where installed to? 如何在 Windows 10 的 PowerShell 中安装 NuGet? - How to install NuGet in PowerShell on Windows 10? 如何在没有 GUI 的情况下安装以管理员身份运行的 Windows 服务? - How do I install a windows service that runs as an administrator without GUI? Windows Server 2016 密码套件不起作用 - Windows Server 2016 Cipher Suites not working AWS 创建 Windows 服务器 2016 并安装软件 - AWS creating a Windows server 2016 with software installation
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM