goormide는 무료로 사용할 수 있는 ubuntu container를 제공합니다. 즉, ubuntu 머신(버전는 18.04)에 pwsh를 설치해 사용하는 방법을 설명합니다.
프로젝트는 Blank Project를 선택합니다.
설치
다음의 커맨드를 사용해서 설치합니다.
|
|
확인
최신 버전은 아니지만, 괜찮습니다.
root@goorm:~# pwsh
PowerShell 7.0.3
Copyright (c) Microsoft Corporation. All rights reserved.
https://aka.ms/powershell
Type 'help' to get help.
PS /root> hostname
goorm
PS /root> $host
Name : ConsoleHost
Version : 7.0.3
InstanceId : 9f0b25b1-fcf1-41bf-98b4-c212a6e45c49
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : ko-KR
CurrentUICulture : ko-KR
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled : True
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace
Set-PSReadLineOption
기본으로 설치되어 있는 모듈을 보면 PSReadLine
이라는 모듈이 로드되어 있습니다.
|
|
이 모듈의 공식 페이지는 https://github.com/PowerShell/PSReadLine 입니다.
PS /root> Set-PSReadLineOption -EditMode
Emacs Vi Windows
vi모드 입력, emacs입력을 지원하고, 키바인딩에 사용자 정의 함수를 기동시키기도 합니다. vscode 의 powershell에도 로드되어 있는 모듈이므로, 연구해 볼 만한 가치가 있습니다.
$profile
리눅스의 pwsh에도 $Profile 스크립트를 지원합니다.
PS /root> $profile
/root/.config/powershell/Microsoft.PowerShell_profile.ps1
이쪽도 커스터마이징 포인트이겠네요.