Skip to content

Commit

Permalink
api.nuget.org - all lowercase URLs
Browse files Browse the repository at this point in the history
Change all api.nuget.org URLs to all lowercase to fix download issues (blob not found)

Signed-off-by: Fabio Klapper <[email protected]>
  • Loading branch information
fklapper authored Nov 19, 2024
1 parent 326b1d6 commit 0053260
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Harden-Windows-Security.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ public static class SecureStringGenerator

if ([System.String]::IsNullOrWhiteSpace($SignTool)) {
Write-Verbose -Message 'Finding the latest version of the Microsoft.Windows.SDK.BuildTools package from NuGet and Downloading it'
[System.String]$LatestSignToolVersion = (Invoke-RestMethod -Uri 'https://api.nuget.org/v3-flatcontainer/Microsoft.Windows.SDK.BuildTools/index.json').versions | Select-Object -Last 1
Invoke-WebRequest -Uri "https://api.nuget.org/v3-flatcontainer/Microsoft.Windows.SDK.BuildTools/${LatestSignToolVersion}/Microsoft.Windows.SDK.BuildTools.${LatestSignToolVersion}.nupkg" -OutFile (Join-Path -Path $WorkingDir -ChildPath 'Microsoft.Windows.SDK.BuildTools.zip')
[System.String]$LatestSignToolVersion = (Invoke-RestMethod -Uri 'https://api.nuget.org/v3-flatcontainer/microsoft.windows.sdk.buildtools/index.json').versions | Select-Object -Last 1
Invoke-WebRequest -Uri "https://api.nuget.org/v3-flatcontainer/microsoft.windows.sdk.buildtools/${LatestSignToolVersion}/microsoft.windows.sdk.buildtools.${LatestSignToolVersion}.nupkg" -OutFile (Join-Path -Path $WorkingDir -ChildPath 'Microsoft.Windows.SDK.BuildTools.zip')
Write-Verbose -Message 'Extracting the nupkg'
Expand-Archive -Path "$WorkingDir\Microsoft.Windows.SDK.BuildTools.zip" -DestinationPath $WorkingDir -Force # Saving .nupkg as .zip to satisfy Windows PowerShell
Write-Verbose -Message 'Finding the Signtool.exe path in the extracted directory'
Expand Down Expand Up @@ -387,4 +387,4 @@ public static class SecureStringGenerator
Write-Verbose -Message 'Cleaning up the working directory in the TEMP directory'
[System.IO.Directory]::Delete($WorkingDir, $true)
}
}
}

0 comments on commit 0053260

Please sign in to comment.