title: Delete local windows profile with PowerShell
body: <p>I am trying to write a script that will delete the local profile of a test account. I am using the following line to return the SID of any account that starts with "test-"</p>
  
  <p>PowerShell: <code>$UserSID = (Get-WmiObject Win32_UserProfile | Where {$_.LocalPath -like '*\test-*'}).SID</code></p>
  
  <p>Once I had the SID I used wmic to do the deletion but, I am not sure how to translate that code into PowerShell.</p>
  
  <p>WMIC:<code>wmic /node:"localhost" path win32_UserProfile where Sid="%%b" Delete</code></p>