본문으로 바로가기

powershell 에서 파일 인코딩 바꾸기

category 개발/Window 2020. 6. 4. 14:37
반응형

> Get-Content [기존파일] | Set-Content -Encoding [변경할 언어셋] [신규파일]


ex) Get-Content C:\test.cfg | Set-Content -Encoding utf-8 C:\new.cfg




cf. 커맨드(cmd)창에서 실행하기

- 파워쉘에서는 일반 커맨드창의 bat 파일을 실행할 수 없음.

ps1 파일로 저장해준 다음 command 에서 아래의 명령어로 실행 


> Powershell.exe -noprofile -executionpolicy bypass -file "[파워셸파일].ps1" 



반응형