(#8013) [vcpkg] Compatibility with pwsh >= 6.2

In Powershell 6.2/7.0, `Get-ChildItem`'s paths are now printed as
absolute paths instead of relative paths; this breaks the code we have
that assumes that they're printed as relative paths.

Thus, change the code to request the `Name` property specifically, which
is what we actually wanted.
This commit is contained in:
TheGoddessInari 2019-09-01 05:09:34 -07:00 committed by Nicole Mazzuca
parent 0777986512
commit 0872eebe34

View File

@ -226,8 +226,9 @@ function getWindowsSDK( [Parameter(Mandatory=$False)][switch]$DisableWin10SDK =
$win10sdkVersions = @(Get-ChildItem $folder | Where-Object {$_.Name -match "^10"} | Sort-Object)
[array]::Reverse($win10sdkVersions) # Newest SDK first
foreach ($win10sdkV in $win10sdkVersions)
foreach ($win10sdk in $win10sdkVersions)
{
$win10sdkV = $win10sdk.Name
$windowsheader = "$folder\$win10sdkV\um\windows.h"
if (!(Test-Path $windowsheader))
{