From 259d3b29d0be7325e5b83c8cc0f9f50920924868 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 29 May 2017 21:54:54 -0700 Subject: [PATCH 1/5] Update to use latest .NET Core --- appveyor.yml | 2 +- build.psm1 | 4 ++-- ...soft.PowerShell.Commands.Management.csproj | 2 +- ...crosoft.PowerShell.Commands.Utility.csproj | 2 +- .../Microsoft.PowerShell.ConsoleHost.csproj | 2 +- ...crosoft.PowerShell.CoreCLR.Eventing.csproj | 2 +- .../Microsoft.PowerShell.SDK.csproj | 22 +++++++++---------- .../System.Management.Automation.csproj | 10 ++++----- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 12fe698e014..0388d067ae9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,7 +2,7 @@ version: 6.0.0-beta.2-{build} image: Visual Studio 2015 -# cache version - netcoreapp.2.0.0-preview1-002106-00 +# cache version - netcoreapp.2.0.0-preview2-25324-03 cache: - '%LocalAppData%\Microsoft\dotnet -> appveyor.yml' - '%HOMEDRIVE%%HOMEPATH%\.nuget\packages -> appveyor.yml' diff --git a/build.psm1 b/build.psm1 index 10f1f53c50b..c366373b839 100644 --- a/build.psm1 +++ b/build.psm1 @@ -982,7 +982,7 @@ function Install-Dotnet { [CmdletBinding()] param( [string]$Channel = "preview", - [string]$Version = "2.0.0-preview1-005952", + [string]$Version = "2.0.0-preview2-006195", [switch]$NoSudo ) @@ -1044,7 +1044,7 @@ function Start-PSBootstrap { [string]$Channel = "preview", # we currently pin dotnet-cli version, and will # update it when more stable version comes out. - [string]$Version = "2.0.0-preview1-005952", + [string]$Version = "2.0.0-preview2-006195", [switch]$Package, [switch]$NoSudo, [switch]$Force diff --git a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj index c38477248e6..5b510c32e3c 100644 --- a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj +++ b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj @@ -78,7 +78,7 @@ - + diff --git a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index 2ac72e3b5d9..9a818262f7b 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -90,7 +90,7 @@ - + diff --git a/src/Microsoft.PowerShell.ConsoleHost/Microsoft.PowerShell.ConsoleHost.csproj b/src/Microsoft.PowerShell.ConsoleHost/Microsoft.PowerShell.ConsoleHost.csproj index 34eb0d2a323..b8118ccefac 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/Microsoft.PowerShell.ConsoleHost.csproj +++ b/src/Microsoft.PowerShell.ConsoleHost/Microsoft.PowerShell.ConsoleHost.csproj @@ -25,7 +25,7 @@ - + diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj index d1377e41d8b..081877299e4 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj @@ -32,7 +32,7 @@ - + diff --git a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj index 2c9cc44241f..292f5df22d3 100644 --- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj +++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj @@ -17,17 +17,17 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index bd1c08c0373..30b4d53e007 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -19,12 +19,12 @@ - + - - - - + + + + From 0dff93771d656dea523d5c95ad924d8dff9e7f40 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 29 May 2017 22:41:45 -0700 Subject: [PATCH 2/5] Enable -SkipCertificateCheck on OSX --- .../WebCmdlet/CoreCLR/WebRequestPSCmdlet.CoreClr.cs | 2 +- .../Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/WebRequestPSCmdlet.CoreClr.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/WebRequestPSCmdlet.CoreClr.cs index 9a74abe7b00..ea47b0cd911 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/WebRequestPSCmdlet.CoreClr.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/WebRequestPSCmdlet.CoreClr.cs @@ -147,7 +147,7 @@ internal virtual HttpClient GetHttpClient() if (SkipCertificateCheck) { - handler.ServerCertificateCustomValidationCallback = delegate { return true; }; + handler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator; } if (WebSession.MaximumRedirection > -1) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 index 4d76a6c3ca1..a2608335ad6 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 @@ -443,9 +443,7 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" { $jsonContent.headers.'User-Agent' | Should Match "WindowsPowerShell" } - ## 'HttpClientHandler.ServerCertificateCustomValidationCallback' currently doesn't work in netcoreapp2.0 on Mac at all. - ## This is tracked by powershell issue #3648. - It "Validate Invoke-WebRequest -SkipCertificateCheck" -Pending:$IsOSX { + It "Validate Invoke-WebRequest -SkipCertificateCheck" { # validate that exception is thrown for URI with expired certificate $command = "Invoke-WebRequest -Uri 'https://expired.badssl.com'" @@ -837,9 +835,7 @@ Describe "Invoke-RestMethod tests" -Tags "Feature" { $jsonContent.headers.'User-Agent' | Should Match "WindowsPowerShell" } - ## 'HttpClientHandler.ServerCertificateCustomValidationCallback' currently doesn't work in netcoreapp2.0 on Mac at all. - ## This is tracked by powershell issue #3648. - It "Validate Invoke-RestMethod -SkipCertificateCheck" -Pending:$IsOSX { + It "Validate Invoke-RestMethod -SkipCertificateCheck" { # HTTP method HEAD must be used to not retrieve an unparsable HTTP body # validate that exception is thrown for URI with expired certificate From f5db9242526f1cae839e0388035a10948f62dd46 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Tue, 30 May 2017 12:25:16 -0700 Subject: [PATCH 3/5] Mark 2 tests pending due to changes in .NET Core --- .../Get-ChildItem.Tests.ps1 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1 index d3964dc8dc1..3b2696af758 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1 @@ -66,7 +66,9 @@ Describe "Get-ChildItem" -Tags "CI" { $file.Count | Should be 1 $file.Name | Should be "pagefile.sys" } - It "Should continue enumerating a directory when a contained item is deleted" { + # Test is pending on Unix platforms because of a behavior change in the latest .NET Core. + # Tracked by https://github.com/dotnet/corefx/issues/20456 + It "Should continue enumerating a directory when a contained item is deleted" -Pending:(!$IsWindows) { $Error.Clear() [System.Management.Automation.Internal.InternalTestHooks]::SetTestHook("GciEnumerationActionDelete", $true) $result = Get-ChildItem -Path $TestDrive -ErrorAction SilentlyContinue @@ -84,7 +86,9 @@ Describe "Get-ChildItem" -Tags "CI" { $result.Count | Should BeExactly 4 } } - It "Should continue enumerating a directory when a contained item is renamed" { + # Test is pending on Unix platforms because of a behavior change in the latest .NET Core. + # Tracked by https://github.com/dotnet/corefx/issues/20456 + It "Should continue enumerating a directory when a contained item is renamed" -Pending:(!$IsWindows) { $Error.Clear() [System.Management.Automation.Internal.InternalTestHooks]::SetTestHook("GciEnumerationActionRename", $true) $result = Get-ChildItem -Path $TestDrive -ErrorAction SilentlyContinue From 3e580bfeb6602177b2a3c5722b78ab6419944782 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 31 May 2017 09:42:47 -0700 Subject: [PATCH 4/5] Update Microsoft.CodeAnalysis.CSharp to use 2.2.0 --- .../Microsoft.PowerShell.Commands.Utility.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index 9a818262f7b..c882b89ff21 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -90,7 +90,7 @@ - + From 64ef98479d8dd66b28614e10ee0a48753eacb392 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Tue, 13 Jun 2017 16:24:33 -0700 Subject: [PATCH 5/5] Update to use the latest .NET Core 2.0-preview2 packages --- appveyor.yml | 2 +- build.psm1 | 4 ++-- ...soft.PowerShell.Commands.Management.csproj | 2 +- ...crosoft.PowerShell.CoreCLR.Eventing.csproj | 2 +- .../Microsoft.PowerShell.SDK.csproj | 22 +++++++++---------- .../System.Management.Automation.csproj | 10 ++++----- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 0388d067ae9..c3fb13dc4ad 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,7 +2,7 @@ version: 6.0.0-beta.2-{build} image: Visual Studio 2015 -# cache version - netcoreapp.2.0.0-preview2-25324-03 +# cache version - netcoreapp.2.0.0-preview2-25407-01 cache: - '%LocalAppData%\Microsoft\dotnet -> appveyor.yml' - '%HOMEDRIVE%%HOMEPATH%\.nuget\packages -> appveyor.yml' diff --git a/build.psm1 b/build.psm1 index c366373b839..3cb3d17bc32 100644 --- a/build.psm1 +++ b/build.psm1 @@ -982,7 +982,7 @@ function Install-Dotnet { [CmdletBinding()] param( [string]$Channel = "preview", - [string]$Version = "2.0.0-preview2-006195", + [string]$Version = "2.0.0-preview2-006388", [switch]$NoSudo ) @@ -1044,7 +1044,7 @@ function Start-PSBootstrap { [string]$Channel = "preview", # we currently pin dotnet-cli version, and will # update it when more stable version comes out. - [string]$Version = "2.0.0-preview2-006195", + [string]$Version = "2.0.0-preview2-006388", [switch]$Package, [switch]$NoSudo, [switch]$Force diff --git a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj index 5b510c32e3c..f92bdb350ea 100644 --- a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj +++ b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj @@ -78,7 +78,7 @@ - + diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj index 081877299e4..816357023ae 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj @@ -32,7 +32,7 @@ - + diff --git a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj index 292f5df22d3..f2fa045d886 100644 --- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj +++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj @@ -17,17 +17,17 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index 30b4d53e007..277da6d8b02 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -19,12 +19,12 @@ - + - - - - + + + +