zip
-
[PowerShell] 파워셸에서 한글 파일명 깨지지 않게 압축 풀기Shell & CMD/PowerShell 2022. 7. 30. 17:17
파워셸에선 Compress-Archive 라는 압축 명령어와 Expand-Archive 라는 이름의 압축해제 명령어가 존재한다. 상당히 유용한 명령어지만 파일제목이 한글 인코딩(euc-kr)으로 된 경우, 명칭이 깨져나오는 불편함이 존재한다. 이를 해결하려면 아래와 같이 .NET 내장함수를 이용해야 한다. [System.IO.Compression.ZipFile]::ExtractToDirectory('202206_상세주소DB_전체분.zip', "out", [System.Text.Encoding]::GetEncoding("EUC-KR")) [Expand-Archive 이용시] [ExtractToDirectory 이용시]