Running the following command line in both PowerShell ISE and VS Code on my system:
Get-ChildItem "$($env:systemdrive)\Program Files (x86)\Windows Kits\10\bin\" -Directory | Where { $_ -match "10." }
It gives out different output. On VS Code, the output will be like:
Directory: C:\Program Files (x86)\Windows Kits\10\bin
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 1/27/2023 12:50 PM 10.0.14393.0
d---- 1/27/2023 12:50 PM 10.0.15063.0
d---- 1/27/2023 12:50 PM 10.0.16299.0
d---- 1/27/2023 12:50 PM 10.0.17134.0
d---- 10/7/2021 4:57 PM 10.0.18362.0
d---- 10/7/2021 4:54 PM 10.0.19041.0
d---- 1/11/2022 5:14 PM 10.0.20348.0
d---- 1/27/2023 12:50 PM 10.0.22621.0
d---- 1/27/2023 12:50 PM arm
d---- 1/27/2023 12:50 PM arm64
d---- 1/27/2023 12:50 PM x64
d---- 1/27/2023 12:50 PM x86
Yet in the ISE, the output will be like:
Directory: C:\Program Files (x86)\Windows Kits\10\bin
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 1/27/2023 12:50 PM 10.0.14393.0
d----- 1/27/2023 12:50 PM 10.0.15063.0
d----- 1/27/2023 12:50 PM 10.0.16299.0
d----- 1/27/2023 12:50 PM 10.0.17134.0
d----- 10/7/2021 4:57 PM 10.0.18362.0
d----- 10/7/2021 4:54 PM 10.0.19041.0
d----- 1/11/2022 5:14 PM 10.0.20348.0
d----- 1/27/2023 12:50 PM 10.0.22621.0
To me, this is a bug with PowerShell within VS code, or PowerShell 7, since I have the PSVersion 7.3.3 for VS code, and PSVersion 5.1.17763.3770 for ISE.
Anybody have any thought?