Fix typo in Reset-PWSHSystemPath.ps1 (#20632)

occurances -> occurrences
This commit is contained in:
Ikko Eltociear Ashimine 2023-11-07 12:57:56 +09:00 committed by GitHub
parent c8afc18404
commit 504b6e0e6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,7 +58,7 @@ ForEach ($PathScopeItem in $PathScope)
$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
#If we are not removing all occurrences of PowerShell paths, then remove the highest sorted path from the filter
$pathstoremove = @($pathstoremove | Sort-Object | Select-Object -SkipLast 1)
}
Write-Verbose "Reset-PWSHSystemPath: Found $($pathstoremove.count) paths to remove from $PathScopeItem path scope: $($Pathstoremove -join ', ' | Out-String)"