How do I install the Nuget provider for PowerShell on a unconnected machine so I can install a nuget package from the PS command line?

前端 未结 5 1404
有刺的猬
有刺的猬 2020-12-24 11:16

I\'m trying to install pswindowsupdate.2.0.0.4.nupkg from the Powershell command line on a Win 7 computer not connected to the internet. I\'m running PS 5.1.14

5条回答
  •  攒了一身酷
    2020-12-24 11:28

    Try this:

    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
    
    Install-PackageProvider NuGet -Force
    
    Set-PSRepository PSGallery -InstallationPolicy Trusted
    

提交回复
热议问题