alter this line to not remove ending with -500 but otherwise remove all items??

I have this line to remove all the registry entries in this key:

Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\NetCache\PurgeAtNextLogoff\ -name s* -whatif

I want to exclude the one with -500 at the end but using -exclude *-500 does not work, how do I revise this line to remove all entries but the one ending with -500??

I tried using -filter but I got an error saying the provider does not support the use of filters.

Any other ways I can get the line to remove all items but the one ending in -500??

Thank you, Tom

Do a get-item and store them in a variable then use a for each loop. inside the loop use an if statement

if(!( $item -like ā€œ*-500ā€)){
Remove-item bla bla bla

Iā€™m on my iPad I can write it when I get to my pc if no ne else chimes in.

I would take this approach

$RegPath =  "HKCU:\SOFTWARE\Test"
Get-Item -Path $RegPath |
Select-Object -ExpandProperty Property |
Where-Object {$_ -like 's*' -and $_ -notlike '*-500'} |
ForEach-Object {
                Remove-ItemProperty -Path $RegPath -Name $_ -WhatIf