How can i find a string using contains in powershell?
https://stackoverflow.com/questions/77305674/how-can-i-find-a-string-using-contains-in-powershell
WebOct 17, 2023 · You've mixed up -contains, which works on collections, and .Contains, which is a method on strings. Use this: $str.ToLower().Contains("myappservice") #=> True Or this: $str -like "*myappservice*" You could use -contains if you split the string into an array and are looking for an exact match of an entire component:
DA: 88 PA: 96 MOZ Rank: 85