주제

 

VS Code 로 powershell 스크립트 만들면 좋은 점 하나 - 문제가 생길 수 있는 것을 막아준다.

 

 

 내용

 

VS Code 에서 powershell 로 간단한 코딩을 하던중에

 

만든 파일 색은 흰색인데 짙은 오렌지색으로 있으로 있는 파일이 있었다.

 

봤더니 내용 중에 밑줄에 그어져 있었다.

 

마우스를 위에 올렸더니 아래의 문구가 띄워졌다.

function select
'select' is an alias of 'Select-bject'. 

Alias can introduce possible problems and make scripts hard to maintain. 

Please consider changing alias to its full content.PSScriptAnalyzer(PSAvoidUsingCmdletAliases)

 

빠른 수정...

 

수정 후

 

 

 결론

 

별칭은 가능한 문제를 야기하고 스크립트를 유지 관리하기 어렵게 만들 수 있습니다.

Alias can introduce possible problems and make scripts hard to maintain.

 

별칭(Alias)은 창모드에서 사용할 때는 좋으나, 스크립트를 만들때는 안쓰는 것이 좋겠다.

 

+ Recent posts