From ea9f5d891cec7f6e20349a88e975bbcc9c525b25 Mon Sep 17 00:00:00 2001 From: markekraus Date: Sun, 24 Sep 2017 19:00:28 -0500 Subject: [PATCH 1/8] Change UserAgent App WindowsPowerShell -> PowerShell --- .../commands/utility/WebCmdlet/PSUserAgent.cs | 2 +- .../WebCmdlets.Tests.ps1 | 28 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/PSUserAgent.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/PSUserAgent.cs index da3ccefec59..7e23c2e5ea5 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/PSUserAgent.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/PSUserAgent.cs @@ -113,7 +113,7 @@ internal static string App get { string app = string.Format(CultureInfo.InvariantCulture, - "WindowsPowerShell/{0}", PSVersionInfo.PSVersion); + "PowerShell/{0}", PSVersionInfo.PSVersion); return (app); } } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 index b226af42113..fbc2190a93d 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 @@ -463,7 +463,7 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" { # Validate response content $jsonContent = $result.Output.Content | ConvertFrom-Json - $jsonContent.headers.'User-Agent' | Should Match "WindowsPowerShell" + $jsonContent.headers.'User-Agent' | Should Match "PowerShell" } It "Invoke-WebRequest returns headers dictionary" { @@ -477,7 +477,7 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" { # Validate response content $jsonContent = $result.Output.Content | ConvertFrom-Json $jsonContent.headers.Host | Should Be $Uri.Authority - $jsonContent.headers.'User-Agent' | Should Match "WindowsPowerShell" + $jsonContent.headers.'User-Agent' | Should Match "PowerShell" } It "Validate Invoke-WebRequest -DisableKeepAlive" { @@ -503,7 +503,7 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" { # Validate response content $jsonContent = $result.Output.Content | ConvertFrom-Json $jsonContent.headers.Host | Should Match $uri.Authority - $jsonContent.headers.'User-Agent' | Should Match "WindowsPowerShell" + $jsonContent.headers.'User-Agent' | Should Match "PowerShell" } It "Validate Invoke-WebRequest error for -MaximumRedirection" { @@ -584,7 +584,7 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" { # Validate response content $jsonContent = $result.Output.Content | ConvertFrom-Json $jsonContent.headers.Host | Should Be $uri.Authority - $jsonContent.headers.'User-Agent' | Should Match "WindowsPowerShell" + $jsonContent.headers.'User-Agent' | Should Match "PowerShell" } It "Invoke-WebRequest validate timeout option" { @@ -658,7 +658,7 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" { # Validate response content $jsonContent = $result.Output.Content | ConvertFrom-Json $jsonContent.url | Should Match $uri - $jsonContent.headers.'User-Agent' | Should Match "WindowsPowerShell" + $jsonContent.headers.'User-Agent' | Should Match "PowerShell" # For a GET request, there is no data property to validate. if ($method -ne "GET") @@ -720,7 +720,7 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" { $result = ExecuteRequestWithOutFile -cmdletName "Invoke-WebRequest" -uri $uri $jsonContent = $result.Output | ConvertFrom-Json $jsonContent.headers.Host | Should Be $uri.Authority - $jsonContent.headers.'User-Agent' | Should Match "WindowsPowerShell" + $jsonContent.headers.'User-Agent' | Should Match "PowerShell" } It "Validate Invoke-WebRequest handles missing Content-Type in response header" { @@ -1322,7 +1322,7 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" { $result = ExecuteWebCommand -command $command # Validate response - $result.Output.headers.'User-Agent' | Should Match "WindowsPowerShell" + $result.Output.headers.'User-Agent' | Should Match "PowerShell" } It "Invoke-RestMethod returns headers dictionary" { @@ -1334,7 +1334,7 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" { # Validate response $result.Output.headers.Host | Should Be $Uri.Authority - $result.Output.headers.'User-Agent' | Should Match "WindowsPowerShell" + $result.Output.headers.'User-Agent' | Should Match "PowerShell" } It "Validate Invoke-RestMethod -DisableKeepAlive" { @@ -1347,7 +1347,7 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" { # Validate response $result.Output.headers.Host | Should Be $uri.Authority - $result.Output.headers.'User-Agent' | Should Match "WindowsPowerShell" + $result.Output.headers.'User-Agent' | Should Match "PowerShell" $result.Output.Headers.Connection | Should Be "Close" } @@ -1360,7 +1360,7 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" { # Validate response $result.Output.headers.Host | Should Match $uri.Authority - $result.Output.headers.'User-Agent' | Should Match "WindowsPowerShell" + $result.Output.headers.'User-Agent' | Should Match "PowerShell" } It "Validate Invoke-RestMethod error for -MaximumRedirection" { @@ -1435,7 +1435,7 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" { $result = ExecuteWebCommand -command $command # Validate response - $result.Output.headers.'User-Agent' | Should Match "WindowsPowerShell" + $result.Output.headers.'User-Agent' | Should Match "PowerShell" } # Perform the following operation for Invoke-RestMethod @@ -1497,7 +1497,7 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" { # Validate response $result.Output.url | Should Match $uri - $result.Output.headers.'User-Agent' | Should Match "WindowsPowerShell" + $result.Output.headers.'User-Agent' | Should Match "PowerShell" # For a GET request, there is no data property to validate. if ($method -ne "GET") @@ -1525,7 +1525,7 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" { # Validate response $result.Output.url | Should Match $uri - $result.Output.headers.'User-Agent' | Should Match "WindowsPowerShell" + $result.Output.headers.'User-Agent' | Should Match "PowerShell" $result.Output.Headers.Connection | Should Be "Close" } @@ -1560,7 +1560,7 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" { $result = ExecuteRequestWithOutFile -cmdletName "Invoke-RestMethod" -uri $uri $jsonContent = $result.Output | ConvertFrom-Json $jsonContent.headers.Host | Should Be $uri.Authority - $jsonContent.headers.'User-Agent' | Should Match "WindowsPowerShell" + $jsonContent.headers.'User-Agent' | Should Match "PowerShell" } It "Validate Invoke-RestMethod handles missing Content-Type in response header" { From 9313cdbf69f303c6af930a5f4e6b07151492b91b Mon Sep 17 00:00:00 2001 From: markekraus Date: Sun, 24 Sep 2017 19:20:20 -0500 Subject: [PATCH 2/8] [Feature] Run Feature tests From 6ecbdcc0823a5ec12423a00a9e631415dedb3ca3 Mon Sep 17 00:00:00 2001 From: markekraus Date: Mon, 25 Sep 2017 19:35:40 -0500 Subject: [PATCH 3/8] [feature] Address PR Feedback with more precise assertion --- .../WebCmdlets.Tests.ps1 | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 index fbc2190a93d..15c5b43e63f 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 @@ -421,6 +421,9 @@ $PendingCertificateTest = $false if ( $IsMacOS ) { $PendingCertificateTest = $true } if ( test-path /etc/centos-release ) { $PendingCertificateTest = $true } +# Get the default UserAgent through reflection +$DefaultUserAgent = [Microsoft.PowerShell.Commands.PSUserAgent].GetProperty('UserAgent',@('Static','NonPublic')).GetValue($null,$null) + Describe "Invoke-WebRequest tests" -Tags "Feature" { BeforeAll { @@ -463,7 +466,7 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" { # Validate response content $jsonContent = $result.Output.Content | ConvertFrom-Json - $jsonContent.headers.'User-Agent' | Should Match "PowerShell" + $jsonContent.headers.'User-Agent' | Should Be $DefaultUserAgent } It "Invoke-WebRequest returns headers dictionary" { @@ -477,7 +480,7 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" { # Validate response content $jsonContent = $result.Output.Content | ConvertFrom-Json $jsonContent.headers.Host | Should Be $Uri.Authority - $jsonContent.headers.'User-Agent' | Should Match "PowerShell" + $jsonContent.headers.'User-Agent' | Should Be $DefaultUserAgent } It "Validate Invoke-WebRequest -DisableKeepAlive" { @@ -503,7 +506,7 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" { # Validate response content $jsonContent = $result.Output.Content | ConvertFrom-Json $jsonContent.headers.Host | Should Match $uri.Authority - $jsonContent.headers.'User-Agent' | Should Match "PowerShell" + $jsonContent.headers.'User-Agent' | Should Be $DefaultUserAgent } It "Validate Invoke-WebRequest error for -MaximumRedirection" { @@ -584,7 +587,7 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" { # Validate response content $jsonContent = $result.Output.Content | ConvertFrom-Json $jsonContent.headers.Host | Should Be $uri.Authority - $jsonContent.headers.'User-Agent' | Should Match "PowerShell" + $jsonContent.headers.'User-Agent' | Should Be $DefaultUserAgent } It "Invoke-WebRequest validate timeout option" { @@ -658,7 +661,7 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" { # Validate response content $jsonContent = $result.Output.Content | ConvertFrom-Json $jsonContent.url | Should Match $uri - $jsonContent.headers.'User-Agent' | Should Match "PowerShell" + $jsonContent.headers.'User-Agent' | Should Be $DefaultUserAgent # For a GET request, there is no data property to validate. if ($method -ne "GET") @@ -720,7 +723,7 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" { $result = ExecuteRequestWithOutFile -cmdletName "Invoke-WebRequest" -uri $uri $jsonContent = $result.Output | ConvertFrom-Json $jsonContent.headers.Host | Should Be $uri.Authority - $jsonContent.headers.'User-Agent' | Should Match "PowerShell" + $jsonContent.headers.'User-Agent' | Should Be $DefaultUserAgent } It "Validate Invoke-WebRequest handles missing Content-Type in response header" { @@ -1322,7 +1325,7 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" { $result = ExecuteWebCommand -command $command # Validate response - $result.Output.headers.'User-Agent' | Should Match "PowerShell" + $result.Output.headers.'User-Agent' | Should Be $DefaultUserAgent } It "Invoke-RestMethod returns headers dictionary" { @@ -1334,7 +1337,7 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" { # Validate response $result.Output.headers.Host | Should Be $Uri.Authority - $result.Output.headers.'User-Agent' | Should Match "PowerShell" + $result.Output.headers.'User-Agent' | Should Be $DefaultUserAgent } It "Validate Invoke-RestMethod -DisableKeepAlive" { @@ -1347,7 +1350,7 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" { # Validate response $result.Output.headers.Host | Should Be $uri.Authority - $result.Output.headers.'User-Agent' | Should Match "PowerShell" + $result.Output.headers.'User-Agent' | Should Be $DefaultUserAgent $result.Output.Headers.Connection | Should Be "Close" } @@ -1360,7 +1363,7 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" { # Validate response $result.Output.headers.Host | Should Match $uri.Authority - $result.Output.headers.'User-Agent' | Should Match "PowerShell" + $result.Output.headers.'User-Agent' | Should Be $DefaultUserAgent } It "Validate Invoke-RestMethod error for -MaximumRedirection" { @@ -1435,7 +1438,7 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" { $result = ExecuteWebCommand -command $command # Validate response - $result.Output.headers.'User-Agent' | Should Match "PowerShell" + $result.Output.headers.'User-Agent' | Should Be $DefaultUserAgent } # Perform the following operation for Invoke-RestMethod @@ -1497,7 +1500,7 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" { # Validate response $result.Output.url | Should Match $uri - $result.Output.headers.'User-Agent' | Should Match "PowerShell" + $result.Output.headers.'User-Agent' | Should Be $DefaultUserAgent # For a GET request, there is no data property to validate. if ($method -ne "GET") @@ -1525,7 +1528,7 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" { # Validate response $result.Output.url | Should Match $uri - $result.Output.headers.'User-Agent' | Should Match "PowerShell" + $result.Output.headers.'User-Agent' | Should Be $DefaultUserAgent $result.Output.Headers.Connection | Should Be "Close" } @@ -1560,7 +1563,7 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" { $result = ExecuteRequestWithOutFile -cmdletName "Invoke-RestMethod" -uri $uri $jsonContent = $result.Output | ConvertFrom-Json $jsonContent.headers.Host | Should Be $uri.Authority - $jsonContent.headers.'User-Agent' | Should Match "PowerShell" + $jsonContent.headers.'User-Agent' | Should Be $DefaultUserAgent } It "Validate Invoke-RestMethod handles missing Content-Type in response header" { From 59e02b4ec03dc3e3f9845b1e29b32fc4ca485c35 Mon Sep 17 00:00:00 2001 From: markekraus Date: Tue, 26 Sep 2017 03:39:43 -0500 Subject: [PATCH 4/8] [feature] Address PR Feedback and add PSUserAgent Test --- .../WebCmdlets.Tests.ps1 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 index 15c5b43e63f..18dab0b45ca 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 @@ -421,14 +421,13 @@ $PendingCertificateTest = $false if ( $IsMacOS ) { $PendingCertificateTest = $true } if ( test-path /etc/centos-release ) { $PendingCertificateTest = $true } -# Get the default UserAgent through reflection -$DefaultUserAgent = [Microsoft.PowerShell.Commands.PSUserAgent].GetProperty('UserAgent',@('Static','NonPublic')).GetValue($null,$null) - Describe "Invoke-WebRequest tests" -Tags "Feature" { BeforeAll { $response = Start-HttpListener -Port 8080 $WebListener = Start-WebListener + # Get the default UserAgent through reflection + $DefaultUserAgent = [Microsoft.PowerShell.Commands.PSUserAgent].GetProperty('UserAgent',@('Static','NonPublic')).GetValue($null,$null) } AfterAll { @@ -1310,6 +1309,8 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" { BeforeAll { $response = Start-HttpListener -Port 8081 $WebListener = Start-WebListener + # Get the default UserAgent through reflection + $DefaultUserAgent = [Microsoft.PowerShell.Commands.PSUserAgent].GetProperty('UserAgent',@('Static','NonPublic')).GetValue($null,$null) } AfterAll { @@ -2188,3 +2189,10 @@ Describe "Web cmdlets tests using the cmdlet's aliases" -Tags "CI" { $result.Hello | Should Be "world" } } + +Describe "PSUserAgent Tests" { + It "App Should Match ^PowerShell/\d+\.\d+\.\d+.*" { + $app = [Microsoft.PowerShell.Commands.PSUserAgent].GetProperty('App',@('Static','NonPublic')).GetValue($null,$null) + $app | Should Match '^PowerShell/\d+\.\d+\.\d+.*' + } +} From 7198bec6c5193a9040743324688f35013f284d3b Mon Sep 17 00:00:00 2001 From: markekraus Date: Tue, 26 Sep 2017 04:13:09 -0500 Subject: [PATCH 5/8] [feature] add tag to describe block --- .../Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 index 18dab0b45ca..cc68081da6c 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 @@ -2190,7 +2190,7 @@ Describe "Web cmdlets tests using the cmdlet's aliases" -Tags "CI" { } } -Describe "PSUserAgent Tests" { +Describe "PSUserAgent Tests" -Tags "CI" { It "App Should Match ^PowerShell/\d+\.\d+\.\d+.*" { $app = [Microsoft.PowerShell.Commands.PSUserAgent].GetProperty('App',@('Static','NonPublic')).GetValue($null,$null) $app | Should Match '^PowerShell/\d+\.\d+\.\d+.*' From 671fc63ab878905199da5395e61513ff31faecf3 Mon Sep 17 00:00:00 2001 From: markekraus Date: Tue, 26 Sep 2017 04:36:40 -0500 Subject: [PATCH 6/8] [feature] Remove describe block Add pattern to User-Agent specific tests --- .../Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 index cc68081da6c..faaa387b767 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 @@ -465,7 +465,7 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" { # Validate response content $jsonContent = $result.Output.Content | ConvertFrom-Json - $jsonContent.headers.'User-Agent' | Should Be $DefaultUserAgent + $jsonContent.headers.'User-Agent' | Should Match '(? Date: Tue, 26 Sep 2017 06:16:13 -0500 Subject: [PATCH 7/8] [feature] Address PF Feedback Remove all assertions for User-Agent that are not specifically about the User-Agent header. --- .../WebCmdlets.Tests.ps1 | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 index faaa387b767..b39d403f878 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 @@ -426,8 +426,6 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" { BeforeAll { $response = Start-HttpListener -Port 8080 $WebListener = Start-WebListener - # Get the default UserAgent through reflection - $DefaultUserAgent = [Microsoft.PowerShell.Commands.PSUserAgent].GetProperty('UserAgent',@('Static','NonPublic')).GetValue($null,$null) } AfterAll { @@ -479,7 +477,6 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" { # Validate response content $jsonContent = $result.Output.Content | ConvertFrom-Json $jsonContent.headers.Host | Should Be $Uri.Authority - $jsonContent.headers.'User-Agent' | Should Be $DefaultUserAgent } It "Validate Invoke-WebRequest -DisableKeepAlive" { @@ -505,7 +502,6 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" { # Validate response content $jsonContent = $result.Output.Content | ConvertFrom-Json $jsonContent.headers.Host | Should Match $uri.Authority - $jsonContent.headers.'User-Agent' | Should Be $DefaultUserAgent } It "Validate Invoke-WebRequest error for -MaximumRedirection" { @@ -586,7 +582,6 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" { # Validate response content $jsonContent = $result.Output.Content | ConvertFrom-Json $jsonContent.headers.Host | Should Be $uri.Authority - $jsonContent.headers.'User-Agent' | Should Be $DefaultUserAgent } It "Invoke-WebRequest validate timeout option" { @@ -660,7 +655,6 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" { # Validate response content $jsonContent = $result.Output.Content | ConvertFrom-Json $jsonContent.url | Should Match $uri - $jsonContent.headers.'User-Agent' | Should Be $DefaultUserAgent # For a GET request, there is no data property to validate. if ($method -ne "GET") @@ -722,7 +716,6 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" { $result = ExecuteRequestWithOutFile -cmdletName "Invoke-WebRequest" -uri $uri $jsonContent = $result.Output | ConvertFrom-Json $jsonContent.headers.Host | Should Be $uri.Authority - $jsonContent.headers.'User-Agent' | Should Be $DefaultUserAgent } It "Validate Invoke-WebRequest handles missing Content-Type in response header" { @@ -1309,8 +1302,6 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" { BeforeAll { $response = Start-HttpListener -Port 8081 $WebListener = Start-WebListener - # Get the default UserAgent through reflection - $DefaultUserAgent = [Microsoft.PowerShell.Commands.PSUserAgent].GetProperty('UserAgent',@('Static','NonPublic')).GetValue($null,$null) } AfterAll { @@ -1326,7 +1317,7 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" { $result = ExecuteWebCommand -command $command # Validate response - $result.Output.headers.'User-Agent' | Should Be '(? Date: Tue, 26 Sep 2017 12:57:32 -0500 Subject: [PATCH 8/8] [feature] Match -> MatchExactly --- .../Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 index b39d403f878..cd252de6724 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 @@ -463,7 +463,7 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" { # Validate response content $jsonContent = $result.Output.Content | ConvertFrom-Json - $jsonContent.headers.'User-Agent' | Should Match '(?