From 9fe84562869e081c30e33832f7c328d9939d0969 Mon Sep 17 00:00:00 2001 From: "Matthew J. DeGarmo" <46715299+matthewjdegarmo@users.noreply.github.com> Date: Tue, 17 Nov 2020 14:09:57 -0600 Subject: [PATCH] Expanding where alias to Where-Object. --- tools/windows/Reset-PWSHSystemPath.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/windows/Reset-PWSHSystemPath.ps1 b/tools/windows/Reset-PWSHSystemPath.ps1 index 7a6a6d9e451..a72a9b47b3c 100644 --- a/tools/windows/Reset-PWSHSystemPath.ps1 +++ b/tools/windows/Reset-PWSHSystemPath.ps1 @@ -53,7 +53,7 @@ ForEach ($PathScopeItem in $PathScope) { $AssembledNewPath = $NewPath = '' #From the current path scope. retrieve the array of paths that match the pathspec of PowerShell (to use as a filter) - $pathstoremove = @([Environment]::GetEnvironmentVariable("PATH","$PathScopeItem").split(';') | where { $_ -ilike "*\Program Files\Powershell\6*"}) + $pathstoremove = @([Environment]::GetEnvironmentVariable("PATH","$PathScopeItem").split(';') | Where-Object { $_ -ilike "*\Program Files\Powershell\6*"}) If (!$RemoveAllOccurences) { #If we are not removing all occurances of PowerShell paths, then remove the highest sorted path from the filter