파워쉘 함수

PowerShell function
파워쉘 함수

1 예시 1[ | ]

PS C:\Users\jmnote> Function Greet {"hello"}
PS C:\Users\jmnote> Greet
hello

2 예시 2[ | ]

PS C:\Users\jmnote> Function Sum($a,$b){$a+$b}
PS C:\Users\jmnote> Sum 5 6
11
PS C:\Users\jmnote> Function Sum2{$args[0]+$args[1]}
PS C:\Users\jmnote> Sum2 6 7
13

3 예시 3[ | ]

PS C:\Users\jmnote> Function Greet{"Hello, $args"}
PS C:\Users\jmnote> Greet
Hello,
PS C:\Users\jmnote> Greet John
Hello, John
PS C:\Users\jmnote> Greet John Smith
Hello, John Smith
PS C:\Users\jmnote> Greet John              Smith
Hello, John Smith

4 같이 보기[ | ]

5 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}