본문 바로가기
개발언어/PowerShell

PowerShell 연산자

by 후쮸아빠 2016. 4. 1.

PowerShell을 자주 사용하지 않다보니... 연산자를 사용해야 할 때마다 검색을 해야 하는 불편함이 있어서...

비교 연산자

 -eq             Equal
 -ne             Not equal
 -ge             Greater than or equal
 -gt             Greater than
 -lt             Less than
 -le             Less than or equal
 -like           Wildcard comparison
 -notlike        Wildcard comparison
 -match          Regular expression comparison
 -notmatch       Regular expression comparison
 -replace        Replace operator
 -contains       Containment operator
 -notcontains    Containment operator
 -shl            Shift bits left (PowerShell 3.0)
 -shr            Shift bits right – preserves sign for signed values.(PowerShell 3.0)
 -in             Like –contains, but with the operands reversed.(PowerShell 3.0)
 -notin          Like –notcontains, but with the operands reversed.(PowerShell 3.0)

 

 

Types
 -is     Is of a type
 -isnot  Is not of a type
 -as     As a type, no error if conversion fails

Logical operators
 -and    Logical And
 -or     Logical Or
 -not    logical not
  !      logical not

Bitwise operators
 -band   Bitwise and
 -bor    Bitwise or