Monthly Archives: October 2012

Powershell: -contains vs. -match and -like

I recently discovered a problem where the Where-Object –contains operator wasn’t doing what I thought it was, i.e. the equivalent of String.Contains() in C#. For example: (Get-Item .\MyDirectory) | where { $_.Attributes -contains “Directory” } Is not the same as: (Get-Item … Continue reading

Posted in Uncategorized | Comments Off on Powershell: -contains vs. -match and -like