From 0053260804b5de735e6534bfa9710077dba273a6 Mon Sep 17 00:00:00 2001 From: Fabio Klapper <101273999+fklapper@users.noreply.github.com> Date: Tue, 19 Nov 2024 12:51:13 +0100 Subject: [PATCH] api.nuget.org - all lowercase URLs Change all api.nuget.org URLs to all lowercase to fix download issues (blob not found) Signed-off-by: Fabio Klapper <101273999+fklapper@users.noreply.github.com> --- Harden-Windows-Security.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Harden-Windows-Security.ps1 b/Harden-Windows-Security.ps1 index 976369821..95250a590 100644 --- a/Harden-Windows-Security.ps1 +++ b/Harden-Windows-Security.ps1 @@ -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' @@ -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) } -} \ No newline at end of file +}