Powershell 의 Prompt는 기본적으로 PS {현재경로}> 로 되어 있다. 이 모양은 Powershell 에서 명령을 수행하고 Prompt 라는 Function을 수행한 결과이다. 믿기지 않는 다면 다음 명령으로 확인 해 보자.
1 |
Get-Command prompt |
다음과 같이 Fuction임을 확인 할 수 있을 것이다.
1 2 3 |
CommandType Name Definition ----------- ---- ---------- Function prompt $(if (test-path variable:/PSDebugCon... |
Definition을 자세히 보면 다음과 같다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
$( if (test-path variable:/PSDebugContext) { '[DBG]: ' } else { '' } ) + 'PS ' + $(Get-Location) + $( if ($nestedpromptlevel -ge 1) { '>>' } ) + '> ' |
위의 코드가 Powershell의 Prompt를 쓰는 것이다. 그러므로 똑같은 이름의 Prompt Function을…