¿ù°£ Àα⠰Խù°

°Ô½Ã¹° 58°Ç
   
[POWERSHELL] Á¶°Ç½Ä ¿É¼Ç
±Û¾´ÀÌ : ÃÖ°í°ü¸®ÀÚ ³¯Â¥ : 2012-06-14 (¸ñ) 17:22 Á¶È¸ : 4213
±ÛÁÖ¼Ò :
                          

So you have whole load of conditional statement like these:

Operator

Definition

-lt

Less than

-le

Less than or equal to

-gt

Greater than

-ge

Greater than or equal to

-eq

Equal to.  If the left hand side of the operator is an array and the right hand side is a scalar, the equivalent values of the left hand side will be returned

-ne

Not Equal to. If the left hand side of the operator is an array and the right hand side is a scalar, the not equivalent values of the left hand side will be returned

-contains

Determine elements in a group, this always returns Boolean $True or $False.

-notcontains

Determine excluded elements in a group, this always returns Boolean $True or $False.

-like

Like - uses wildcards for pattern matching

-notlike

Not Like - uses wildcards for pattern matching

-match

Match - uses regular expressions for pattern matching

-notmatch

Not Match - uses regular expressions for pattern matching

-band

Bitwise AND

-bor

Bitwise OR

-is

Is of Type

-isnot

Is not of Type

These operators are the case-sensitive counterparts:

Operator

Definition

-clt

Less than (case sensitive)

-cle

Less than or equal to (case sensitive)

-cgt

Greater than (case sensitive)

-cge

Greater than or equal to (case sensitive)

-ceq

Equal to  (case sensitive)

-cne

Not Equal to (case sensitive)

-clike

Like (case sensitive)

-cnotlike

Not Like (case sensitive)

-ccontains

left hand side contains right hand side in a case sensitive manner

-cnotcontains

determine excluded elements in a group in a case sensitive manner

-cmatch

Match (case sensitive)

-cnotmatch

Not Match (case sensitive)

Other operators:

Operator

Definition

+

Add

-

Subtract

*

Multiply

/

Divide

%

Modulo

-not

logical not

!

logical not

-band

binary and

-bor

binary or

-bnot

binary not

-replace

Replace (e.g.  "abcde" –replace "b","B") (case insensitive)

-ireplace

Case-insensitive replace (e.g.  "abcde" –ireplace "B","3")

-creplace

Case-sensitive replace (e.g.  "abcde" –creplace "B","3")

-and

AND (e.g. ($a -ge 5 -AND $a -le 15) )

-or

OR  (e.g. ($a –eq "A" –OR $a –eq "B") )

-is

IS type (e.g. $a -is [int] )

-isnot

IS not type (e.g. $a -isnot [int] )

-as

convert to type (e.g. 1 -as [string] treats 1 as a string )

..

Range operator (e.g.  foreach ($i in 1..10) {$i }  )

&

call operator (e.g. $a = "Get-ChildItem" &$a executes Get-ChildItem)

. (dot followed by a space)

call operator (e.g. $a = "Get-ChildItem" . $a executes Get-ChildItem in the current scope)

-F

Format operator (e.g. foreach ($p in Get-Process) { "{0,-15} has {1,6} handles" –F $p.processname,$p.Handlecount } )


À̸§ Æнº¿öµå
ºñ¹Ð±Û (üũÇÏ¸é ±Û¾´À̸¸ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
¿ÞÂÊÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
   

 



 
»çÀÌÆ®¸í : ¸ðÁö¸®³× | ´ëÇ¥ : ÀÌ°æÇö | °³ÀÎÄ¿¹Â´ÏƼ : ·©Å°´åÄÄ ¿î¿µÃ¼Á¦(OS) | °æ±âµµ ¼º³²½Ã ºÐ´ç±¸ | ÀüÀÚ¿ìÆí : mojily°ñ¹ðÀÌchonnom.com Copyright ¨Ï www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.