powershell contains not working

后端 未结 4 972
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-27 00:36

I am trying filter by the name of each share using $Share.Name. However, when I try to use -contains in the if statement below, I get no r

4条回答
  •  既然无缘
    2021-01-27 01:04

    Bizarrely, .contains() acts like -contains on arrays:

    $a = 'one','two','three'
    $a.contains('one')
    True
    
    $a.contains('o')
    False
    
    $a.contains
    
    OverloadDefinitions
    -------------------
    bool IList.Contains(System.Object value)
    

提交回复
热议问题