I am trying to list output names from win32\_share and only include those which do not contain a $. I have the following code written, but it passes everything. How can I list those shares which do not contain a $ in their name?

```
$winshare = Get-WmiObject -computername 127.0.0.1 -class win32_share | Select-Object name
$share = $null

foreach ($i in $winshare.name) { 
if ($i -notcontains '$') {$share = $i + ',' + $share}else{}
}

write-host $share

```

Thanks!