mirror of
https://github.com/microsoft/PowerToys
synced 2025-08-22 01:58:04 +00:00
### NuGet Package Management Improvements: * This pull request includes updates to improve NuGet package management and dependency versions. ### Example problem of the new ps1 change, and fixed in this PR Updated the version of `NLog` from `5.0.4` to `5.2.8`, with the error message: error NU1605: Warning As Error: Detected package downgrade: NLog from 5.2.8 to 5.0.4. Reference the package directly from the pr oject to select a different version. Microsoft.PowerToys.Run.Plugin.History -> Wox.Plugin -> NLog.Extensions.Logging 5.3.8 -> NLog (>= 5.2.8) Microsoft.PowerToys.Run.Plugin.History -> Wox.Plugin -> NLog (>= 5.0.4)
34 lines
824 B
PowerShell
34 lines
824 B
PowerShell
[CmdletBinding()]
|
|
Param(
|
|
[Parameter(Mandatory=$True,Position=1)]
|
|
[string]$solution
|
|
)
|
|
|
|
Write-Host "Verifying Nuget packages for $solution"
|
|
|
|
dotnet tool restore
|
|
dotnet consolidate -s $solution
|
|
if ($lastExitCode -ne 0)
|
|
{
|
|
$result = $lastExitCode
|
|
Write-Error "Error running dotnet consolidate, with the exit code $lastExitCode. Please verify logs and running environment."
|
|
exit $result
|
|
}
|
|
|
|
if (-not $?)
|
|
{
|
|
Write-Host -ForegroundColor Red "Nuget packages with the same name must all be the same version."
|
|
exit 1
|
|
}
|
|
|
|
# Ignore NU1503 on vcxproj files
|
|
dotnet restore $solution /nowarn:NU1503
|
|
if ($lastExitCode -ne 0)
|
|
{
|
|
$result = $lastExitCode
|
|
Write-Error "Error running dotnet restore, with the exit code $lastExitCode. Please verify logs on the nuget package versions."
|
|
exit $result
|
|
}
|
|
|
|
exit 0
|