본문 바로가기

파워쉘

[파워쉘] 골뱅이(@, Splat 이라고 함)의 의미

굳이 해석할 필요도 없어 보인다.



Splat

Splatting allows the entries of a hash-table to be used in the invocation of a cmdlet - more specifically, keys become named parameters and values become input to those parameters. Here's a sample:


$procs = @{name="notepad","iexplore"}

get-process @procs


결과는 귀차나서.. 생략..


Of course multiple parameters can be specified at once (that's the whole point of the hashtable anyhow):


$gm = @{memberType="ScriptProperty","Property";name="[a-d]*"} 

get-process @gm


역시 결과는 귀차나서.. 생략..


In other words, invocation parameterization information can now be kept and passed around as data.




출처 : http://bartdesmet.net/blogs/bart/archive/2008/03/24/windows-powershell-2-0-feature-focus-splat-split-and-join.aspx