问题标签 [oneget]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
24884 浏览

powershell - Skip confirmation while using Install-Package?

I have added ChocolateyGet as a provider on Powershell so I can use it with PackageManagement (OneGet), it works but every package I try to install warns:

https://www.chocolatey.org is not a trusted package source

Then asks for confirmation. It also asks me if I agree to the license of the package.

I wanted to make a script to automatically install some packages, but I needed this script to be unattended, and it's not possible now because it asks those two previous questions.

Is there anyway to circumvent/automatically respond these confirmations? Like the y or yes command on Linux?

0 投票
3 回答
2713 浏览

powershell - PowerShell 包来源确认

我正在尝试创建一个函数,该函数将根据需要从存储库 PSGallery 自动安装、更新和导入 PowerShell 模块,这将在构建服务器上运行,因此我必须避免任何类型的确认提示。如果模块已经加载到会话中(仅第一次),此函数将被经常调用,并且不会尝试安装或更新模块。

如果该模块尚未安装,我将尝试安装它。问题是当我进入必须安装 NuGet PackageManagement 提供程序的步骤时(在导入从 PSGallery 安装模块所需的 PowerShellGet 模块之前)。我执行以下 cmdlet:

但我收到以下确认提示:

在此处输入图像描述

-Force我可以通过使用这样的参数来解决这个问题:

但是我在该解决方案中看到的问题(可能不是什么大问题)是-Force即使安装的版本是最新的,每次使用都会再次下载并安装 NuGet。如果没有-Force参数,如果版本是最新的,它将跳过它,我更愿意这样做。

有没有办法将包源“ https://oneget.org/nuget-2.8.5.208.package.swidtag ”设置为受信任的,这样我就不会再次得到确认提示而无需使用-Force参数?

0 投票
0 回答
623 浏览

powershell - 如何使用 PackageManagement 模块下载和安装 Nuget 包?

如何使用 PackageManagement 模块下载和安装 Nuget 包?当我运行 find-package -Source nuget.org 或尝试使用我在 nuget.org 上看到的包运行安装时,我似乎找不到任何包。我缺少一些配置吗?

0 投票
1 回答
12981 浏览

node.js - 如何使用 Windows PowerShell PackageManager (OneGet) 安装 Node.js?

我试过Install-Package nodejs了,这似乎做了一些事情:

然后当我尝试运行node命令时,它失败了:

如何正确使用PackageManager,以便该命令可用?

不确定这个其他问题是否相关:Chocolaty packages not installed via OneGet/PackageManagement in Windows 10?

正如其他问题所暗示的那样,我尝试了设置Set-ExecutionPolicy Unrestricted、卸载和重新安装nodejs,但结果是一样的。

我确实看到安装后存在以下文件:

这让我觉得也许它希望我在之后手动运行安装程序?

我的目标是简单地通过脚本在新的 Windows 机器上安装我需要的任何东西,而无需使用 GUI 手动下载/安装它们。

0 投票
1 回答
220 浏览

oneget - 新的 winget 和 Microsoft.PackageManagement 有什么关系

几年前,有一个名为PackageManagement(又名 OneGet)的 Microsoft 包管理器,它似乎基于 PowerShell 命令约定,并且是可扩展的。

最近,微软推出了另一个包管理器工具winget,它仍然被认为是预发布的。似乎没有使用 PowerShell 约定。

这两者之间有什么关系?

WinGet 会取代 OneGet,还是会有某种互操作性?

0 投票
2 回答
2649 浏览

windows - 损坏的包管理器?找不到模块提供程序 (PowerShellGet)

这是我在互联网上找到的常见解决方案无法解决的常见错误。

无法运行 Get-PsRepository、Install-Module 和相关 (OneGet?) 命令,而不会引发“无法找到模块提供程序 (PowerShellGet)”错误。这似乎是 NuGet 包管理器模块的问题,但我不知道如何恢复。安装的包提供程序似乎有效

症状模式:
C:> [Net.ServicePointManager]::SecurityProtocol

获取 PSRepository

注册-PSRepository -Default -Verbose

安装模块 PowerShellGet -Force

事实:
Windows 10 (1903)
Powershell 5.1.18362.1171
以管理员身份运行 PowerShell 不在代理后面
有权访问https://www.powershellgallery.com/api/v2
有权访问 nuget.org
`[Net.ServicePointManager]::SecurityProtocol = Tls12
FIPS 已禁用 (HKLM\System\CurrentControlSet\Control\Lsa\FIPSAlgorithmPolicy\Enabled DWORD=0)
Get-PackageProvider 仅显示 NuGet 2.8.5.208
PowerShellGet 版本为 1.0.0.1 ;当尝试使用 Install-Module PowerShellGet -Force 强制安装 sxs 时,我得到了相同的结果: PackageManagement\Install-Package:无法找到模块提供程序 (PowerShellGet)。