- $arrColors = "blue", "red", "green", "yellow", "white", "pink", "orange", "turquoise"
-
- # 判断数组是否包含指定元素
- $arrColors -contains "black"
-
- # 判断数组是否包含指定元素(大小写敏感)
- $arrColors -ccontains "Green"
-
- # 判断数组是否不包含指定元素
- $arrColors -notcontains "violet"
-
- # 判断数组是否不包含指定元素(大小写敏感)
- $arrColors -cnotcontains "Green"
复制代码
参考:
https://technet.microsoft.com/en-us/library/ee692798.aspx |