Skip to content

Commit 577166a

Browse files
committed
Fix all Invoke-WebRequest calls to include -UseBasicParsing to address security changes in PowerShell 5.1, preventing failures in non-interactive CI environments.
1 parent 2c944db commit 577166a

File tree

4 files changed

+16
-11
lines changed

4 files changed

+16
-11
lines changed

CHANGELOG.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5555

5656
### Fixed
5757

58+
- Fixed all `Invoke-WebRequest` calls throughout the codebase to include the
59+
`-UseBasicParsing` parameter. This addresses a Windows PowerShell 5.1 security
60+
update (CVE-2025-54100) released December 9, 2025, which changed the default
61+
behavior of `Invoke-WebRequest` to require an interactive prompt unless
62+
`-UseBasicParsing` is specified. This change prevents failures in non-interactive
63+
CI environments. Affected files include integration tests, production code, and
64+
build scripts
65+
([issue #2376](https://github.com/dsccommunity/SqlServerDsc/issues/2376)).
5866
- `SqlRS`
5967
- Fixed integration tests failing with status code 0 when checking ReportServer
60-
and Reports site accessibility. This was caused by a Windows PowerShell 5.1
61-
security update (CVE-2025-54100) released December 9, 2025, which changed the
62-
default behavior of `Invoke-WebRequest` to require an interactive prompt unless
63-
`-UseBasicParsing` is specified. Added `-UseBasicParsing` parameter to all
64-
`Invoke-WebRequest` calls and implemented retry logic (up to 2 minutes) to
65-
handle timing issues. On final retry attempt with status code 0, the exception
66-
is now re-thrown to provide detailed error diagnostics
68+
and Reports site accessibility by implementing retry logic (up to 2 minutes) to
69+
handle timing issues where Reporting Services web services are not immediately
70+
ready after DSC configuration completes. On final retry attempt with status
71+
code 0, the exception is now re-thrown to provide detailed error diagnostics
6772
([issue #2376](https://github.com/dsccommunity/SqlServerDsc/issues/2376)).
6873
- Refactored to use the public command `Get-SqlDscServerProtocol` instead
6974
of the deprecated private function `Get-ServerProtocolObject`

source/Public/Save-SqlDscSqlServerMediaFile.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ function Save-SqlDscSqlServerMediaFile
166166
Write-Verbose -Message ($script:localizedData.SqlServerMediaFile_Save_DownloadingInformation -f $Url)
167167

168168
# Download the URL content.
169-
Invoke-WebRequest -Uri $Url -OutFile $downloadedFilePath | Out-Null
169+
Invoke-WebRequest -Uri $Url -OutFile $downloadedFilePath -UseBasicParsing | Out-Null
170170

171171
if ($Quiet.IsPresent)
172172
{

tests/Integration/Resources/DSC_SqlRSSetup.Integration.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ BeforeAll {
8989

9090
Write-Verbose -Message ('Start downloading the {1} executable at {0}.' -f (Get-Date -Format 'yyyy-MM-dd hh:mm:ss'), $script:mockSourceMediaDisplayName) -Verbose
9191

92-
Invoke-WebRequest -Uri $script:mockSourceMediaUrl -OutFile $ConfigurationData.AllNodes.MediaPath
92+
Invoke-WebRequest -Uri $script:mockSourceMediaUrl -OutFile $ConfigurationData.AllNodes.MediaPath -UseBasicParsing
9393

9494
Write-Verbose -Message ('{1} executable file has SHA1 hash ''{0}''.' -f (Get-FileHash -Path $ConfigurationData.AllNodes.MediaPath -Algorithm 'SHA1').Hash, $script:mockSourceMediaDisplayName) -Verbose
9595

tests/Integration/Resources/DSC_SqlSetup.Integration.Tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ BeforeAll {
128128
if ($script:mockSourceDownloadExeUrl)
129129
{
130130
# Download the EXE used to download the ISO
131-
Invoke-WebRequest -Uri $script:mockSourceDownloadExeUrl -OutFile $ConfigurationData.AllNodes.DownloadExePath | Out-Null
131+
Invoke-WebRequest -Uri $script:mockSourceDownloadExeUrl -OutFile $ConfigurationData.AllNodes.DownloadExePath -UseBasicParsing | Out-Null
132132

133133
# Download ISO using the EXE
134134
$imageDirectoryPath = Split-Path -Path $ConfigurationData.AllNodes.ImagePath -Parent
@@ -144,7 +144,7 @@ BeforeAll {
144144
else
145145
{
146146
# Direct ISO download
147-
Invoke-WebRequest -Uri $script:mockSourceMediaUrl -OutFile $ConfigurationData.AllNodes.ImagePath
147+
Invoke-WebRequest -Uri $script:mockSourceMediaUrl -OutFile $ConfigurationData.AllNodes.ImagePath -UseBasicParsing
148148
}
149149

150150
Write-Verbose -Message ('SQL Server media file has SHA1 hash ''{0}''' -f (Get-FileHash -Path $ConfigurationData.AllNodes.ImagePath -Algorithm 'SHA1').Hash) -Verbose

0 commit comments

Comments
 (0)