0
例如,我在尋找這樣的命令,將僅更新名爲PackagePrefix
開始包:如何在以特定名稱開頭的解決方案中更新所有NuGet包?
Update-Package "PackagePrefix.*"
我試圖在this blog評論部分提供的腳本,但它扔以下錯誤:
Get-Package | Where Id -like "Contoso.*" | Sort-Object -Property Id -Unique | foreach { Update-Package $_.Id }
Where-Object : Cannot bind parameter 'FilterScript'. Cannot convert the "Id" value of type "System.String" to type "System.Management.Automation.ScriptBlock". At line:1 char:20 + Get-Package | Where <<<< Id -like "Contoso.*" | Sort-Object -Property Id -Unique | foreach { Update-Package $_.Id } + CategoryInfo : InvalidArgument: (:) [Where-Object], ParameterBindingException + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.WhereObjectCommand
該腳本工作正常,我... – DavidG
我有PowerShell 2.0和3.0的NuGet。由於我的Powershell版本可能是個問題。 – Saravana