파워쉘 함수

Jmnote bot (토론 | 기여)님의 2017년 7월 23일 (일) 04:03 판 (봇: 자동으로 텍스트 교체 (-==참고 자료== +==참고==))
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)
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 }}