Notice
Recent Posts
250x250
«   2026/04   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30
관리 메뉴

일상 코딩

[윈도우 개발 환경 설정] 1편: 윈도우 기본 세팅 & 패키지 매니저 본문

Windows 개발환경 세팅

[윈도우 개발 환경 설정] 1편: 윈도우 기본 세팅 & 패키지 매니저

polarcompass 2026. 3. 31. 22:21
728x90

1편: 윈도우 기본 세팅 & 패키지 매니저

시리즈: 윈도우 네이티브 개발 환경 구축 A to Z (1/14)
환경: Windows 11, PowerShell 7, Windows Terminal


서론

새 윈도우 PC를 받으면 가장 먼저 해야 할 일은 개발에 적합한 기반 환경을 만드는 것입니다. 이 시리즈에서는 WSL에 의존하지 않고, 윈도우 네이티브 환경에서 모든 개발 도구를 설치하고 실행합니다. 1편에서는 터미널, 셸, 패키지 매니저, 폰트, 프롬프트 테마까지 — 앞으로 13편 동안 반복해서 사용할 기초 인프라를 세팅합니다.


1. Windows Terminal 확인

Windows 11에는 Windows Terminal이 기본 설치되어 있습니다. 혹시 없거나 오래된 버전이라면 Microsoft Store에서 업데이트하세요.

# 버전 확인 — 시작 메뉴에서 "Terminal"을 검색하여 실행한 뒤
wt --version

출력 예시: 1.22.xxxx.0

Tip: Windows Terminal의 설정(Ctrl + ,)에서 기본 프로필을 나중에 설치할 PowerShell 7으로 바꿀 예정입니다. 지금은 기본값(Windows PowerShell 5.1)인 채로 두어도 됩니다.


2. PowerShell 7 설치

Windows에 기본 탑재된 Windows PowerShell 5.1과 별도로, 크로스 플랫폼 오픈소스인 PowerShell 7을 설치합니다. 이 시리즈의 모든 명령어는 PowerShell 7 기준입니다.

# winget은 Windows 11에 기본 포함되어 있습니다
winget install --id Microsoft.PowerShell --source winget

설치가 끝나면 Windows Terminal을 종료했다가 다시 실행합니다. 프로필 드롭다운에 "PowerShell"(아이콘이 검은색)이 새로 생긴 것을 확인할 수 있습니다.

# 새 탭에서 PowerShell 7 프로필을 선택한 뒤 버전 확인
$PSVersionTable.PSVersion

Major7 이상이면 성공입니다.

기본 프로필 변경

Windows Terminal 설정(Ctrl + ,) → 시작기본 프로필을 "PowerShell"(7.x, 검은 아이콘)로 변경하고 저장합니다. 이제 터미널을 열면 항상 PowerShell 7이 실행됩니다.


3. 개발자 모드 활성화

개발자 모드를 켜면 심볼릭 링크 생성, 사이드로드 앱 설치 등 개발에 필요한 권한이 풀립니다.

설정 앱시스템개발자용개발자 모드 토글을 켜기로 전환합니다.

PowerShell에서 확인하려면 아래 명령어를 입력합니다.

reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /v AllowDevelopmentWithoutDevLicense

값이 0x1이면 활성화된 상태입니다.


4. 패키지 매니저

4-1. winget (기본 제공)

winget은 Windows 11에 기본 포함된 공식 패키지 매니저입니다. 이 시리즈에서 대부분의 도구를 winget으로 설치합니다.

winget --version

버전이 출력되면 바로 사용할 수 있습니다. 만약 명령어가 인식되지 않는다면 Microsoft Store에서 "앱 설치 관리자"를 업데이트하세요.

유용한 기본 명령어를 미리 익혀 둡니다.

# 패키지 검색
winget search <키워드>

# 패키지 설치
winget install --id <패키지ID> --source winget

# 설치된 패키지 업그레이드
winget upgrade --all

4-2. Chocolatey (보조)

winget에 없는 패키지가 간혹 있습니다. 그런 경우를 위해 Chocolatey를 보조로 설치해 둡니다.

관리자 권한 PowerShell 7을 엽니다. (Terminal 탭 드롭다운 → PowerShell 우클릭 → "관리자 권한으로 실행", 또는 시작 메뉴에서 "PowerShell 7"을 우클릭하여 관리자로 실행)

Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

설치 후 터미널을 재시작하고 확인합니다.

choco --version

원칙: 가능하면 winget을 우선 사용하고, winget에 패키지가 없을 때만 Chocolatey를 사용합니다.


5. Nerd Font 설치

터미널 프롬프트에서 아이콘(Git 브랜치, 폴더, 언어 로고 등)을 제대로 표시하려면 Nerd Font가 필요합니다. 이 시리즈에서는 개발자 사이에서 가장 널리 쓰이는 FiraCode Nerd Font를 설치합니다.

# Oh My Posh CLI를 이용한 폰트 설치 (관리자 권한 PowerShell)
winget install --id JanDeDobbeleer.OhMyPosh --source winget

Oh My Posh 설치 후 터미널을 재시작하고 아래 명령어로 폰트를 설치합니다.

# 관리자 권한 PowerShell에서 실행
oh-my-posh font install FiraCode

프롬프트에서 폰트를 선택하면 자동으로 시스템에 설치됩니다.

Windows Terminal 폰트 적용

Windows Terminal 설정(Ctrl + ,) → 왼쪽 메뉴에서 프로필 > 기본값추가 설정: 모양글꼴 항목을 "FiraCode Nerd Font" 로 변경하고 저장합니다.

또는 settings.json을 직접 편집할 수도 있습니다. Terminal 설정 좌측 하단의 "JSON 파일 열기"를 클릭하면 됩니다.

// settings.json — profiles.defaults 안에 추가
{
  "profiles": {
    "defaults": {
      "font": {
        "face": "FiraCode Nerd Font",
        "size": 13
      }
    }
  }
}

6. Oh My Posh — 프롬프트 테마 설정 (선택)

Oh My Posh는 PowerShell 프롬프트를 보기 좋게 꾸며 주는 도구입니다. Git 브랜치, 언어 버전, 실행 시간 등을 한눈에 보여 줘서 개발 중 상황 파악이 빨라집니다.

5단계에서 이미 Oh My Posh를 설치했으므로 테마만 적용하면 됩니다.

테마 미리보기

# 설치된 테마 목록을 터미널에서 미리보기
Get-PoshThemes

각 테마가 순서대로 렌더링됩니다. 마음에 드는 테마 이름을 기억해 두세요. 이 글에서는 인기 있는 "catppuccin_mocha" 테마를 사용합니다.

프로필에 적용

# PowerShell 프로필 파일 열기 (없으면 자동 생성)
notepad $PROFILE

열린 파일에 아래 한 줄을 추가하고 저장합니다.

oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\catppuccin_mocha.omp.json" | Invoke-Expression

터미널을 재시작하면 프롬프트가 바뀌어 있습니다.

테마가 마음에 들지 않으면 catppuccin_mocha 부분을 Get-PoshThemes에서 확인한 다른 테마 이름으로 교체하면 됩니다.


oh-my-posh가 제대로 설치되지 않았거나 경로가 설정되지 않은 것으로 보입니다. 단계별로 해결해 보겠습니다.


1단계: 기존 설치 확인 및 제거

winget uninstall JanDeDobbeleer.OhMyPosh

2단계: Oh My Posh 재설치

winget으로 설치하는 것이 가장 안정적입니다:

winget install JanDeDobbeleer.OhMyPosh -s winget

설치 후 PowerShell을 완전히 종료하고 다시 열어주세요.

3단계: 설치 확인

oh-my-posh version

버전이 출력되면 정상 설치된 것입니다.

4단계: 테마 확인

Get-PoshThemes는 이전 PowerShell 모듈 방식의 명령어입니다. 현재 oh-my-posh는 독립 실행 파일 방식으로 바뀌었기 때문에, 테마를 확인하려면 아래 명령어를 사용하세요:

Get-ChildItem "$env:LOCALAPPDATA\Programs\oh-my-posh\themes"

또는 터미널에서 테마를 미리보기하려면:

oh-my-posh font install

5단계: 프로필에 적용

notepad $PROFILE

열린 파일에 아래 내용을 추가합니다:

oh-my-posh init pwsh --config "$env:LOCALAPPDATA\Programs\oh-my-posh\themes\jandedobbeleer.omp.json" | Invoke-Expression

jandedobbeleer.omp.json 대신 원하는 테마 파일 이름으로 변경할 수 있습니다.

저장 후 PowerShell을 다시 열면 적용됩니다.


"구성된 원본에서 사용할 수 있는 최신 패키지 버전이 없습니다" 오류 해결

이 오류는 Install-Module oh-my-posh (PSGallery 모듈 방식)을 사용했을 때 나타납니다. 이 모듈은 더 이상 유지보수되지 않습니다. 위의 winget 방식으로 설치하면 이 문제가 해결됩니다.

혹시 이전 모듈이 남아있다면 제거해 주세요:

Uninstall-Module oh-my-posh -AllVersions -Force

이 단계를 따라해 보시고, 중간에 오류가 나면 알려주세요!


7. 유용한 PowerShell 기본 설정

$PROFILE 파일에 Oh My Posh 설정과 함께 아래 내용을 추가해 두면 편리합니다.

notepad $PROFILE
# ── Oh My Posh ──
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\catppuccin_mocha.omp.json" | Invoke-Expression

# ── Alias ──
Set-Alias -Name ll -Value Get-ChildItem
Set-Alias -Name which -Value Get-Command

# ── 자동 완성 향상 (PSReadLine) ──
Set-PSReadLineOption -PredictionSource History
Set-PSReadLineOption -PredictionViewStyle ListView
Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete

저장 후 터미널을 재시작하면 탭 자동 완성이 메뉴 형태로 표시되고, 명령어 히스토리를 기반으로 예측 입력이 동작합니다.


최종 확인 체크리스트

모든 세팅이 끝났다면 새 PowerShell 7 탭을 열고 아래를 순서대로 확인합니다.

# 1. PowerShell 7 버전
$PSVersionTable.PSVersion
# → Major 7 이상

# 2. winget
winget --version
# → v1.x.xxxxx

# 3. Chocolatey
choco --version
# → 2.x.x

# 4. Oh My Posh
oh-my-posh --version
# → 버전 번호 출력

# 5. 개발자 모드
reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /v AllowDevelopmentWithoutDevLicense
# → 0x1

# 6. 폰트 & 프롬프트
# → 터미널에 아이콘이 깨지지 않고 테마가 정상적으로 표시되는지 눈으로 확인

모두 통과했다면 윈도우 기본 세팅이 완료된 것입니다.


1편에서 다룬 내용을 한 번에 자동으로 세팅해주는 PowerShell 스크립트를 만들어 드리겠습니다.


1편 자동 세팅 스크립트

사용 방법

아래 내용을 setup-windows-dev.ps1 파일로 저장한 뒤, 관리자 권한 PowerShell에서 실행합니다.

# 실행 정책이 막혀 있을 경우 먼저 이 명령어를 한 번 실행
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force

# 스크립트 실행
.\setup-windows-dev.ps1

스크립트 전문

#Requires -RunAsAdministrator
<#
.SYNOPSIS
    윈도우 네이티브 개발 환경 기본 세팅 스크립트 (시리즈 1편)
.DESCRIPTION
    - PowerShell 7 설치
    - 개발자 모드 활성화
    - Chocolatey 설치
    - Oh My Posh + Nerd Font 설치
    - PowerShell 프로필 구성
.NOTES
    반드시 "관리자 권한" PowerShell에서 실행하세요.
#>

$ErrorActionPreference = "Stop"

# ──────────────────────────────────────────────
# 유틸 함수
# ──────────────────────────────────────────────
function Write-Step {
    param([string]$Message)
    Write-Host ""
    Write-Host "========================================" -ForegroundColor Cyan
    Write-Host "  $Message" -ForegroundColor Cyan
    Write-Host "========================================" -ForegroundColor Cyan
}

function Test-CommandExists {
    param([string]$Command)
    return [bool](Get-Command $Command -ErrorAction SilentlyContinue)
}

# ──────────────────────────────────────────────
# 1. PowerShell 7
# ──────────────────────────────────────────────
Write-Step "1/6 — PowerShell 7 설치"

if (Test-CommandExists pwsh) {
    $currentVersion = (pwsh -NoProfile -Command '$PSVersionTable.PSVersion.ToString()') 2>$null
    Write-Host "  이미 설치됨: PowerShell $currentVersion" -ForegroundColor Green
}
else {
    Write-Host "  winget으로 PowerShell 7 설치 중..."
    winget install --id Microsoft.PowerShell --source winget --accept-package-agreements --accept-source-agreements
    Write-Host "  설치 완료" -ForegroundColor Green
}

# ──────────────────────────────────────────────
# 2. 개발자 모드 활성화
# ──────────────────────────────────────────────
Write-Step "2/6 — 개발자 모드 활성화"

$regPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
$current = (Get-ItemProperty -Path $regPath -Name AllowDevelopmentWithoutDevLicense -ErrorAction SilentlyContinue).AllowDevelopmentWithoutDevLicense

if ($current -eq 1) {
    Write-Host "  이미 활성화됨" -ForegroundColor Green
}
else {
    if (-not (Test-Path $regPath)) {
        New-Item -Path $regPath -Force | Out-Null
    }
    Set-ItemProperty -Path $regPath -Name AllowDevelopmentWithoutDevLicense -Value 1 -Type DWord
    Write-Host "  개발자 모드 활성화 완료" -ForegroundColor Green
}

# ──────────────────────────────────────────────
# 3. Chocolatey
# ──────────────────────────────────────────────
Write-Step "3/6 — Chocolatey 설치"

if (Test-CommandExists choco) {
    Write-Host "  이미 설치됨: choco $(choco --version)" -ForegroundColor Green
}
else {
    Write-Host "  Chocolatey 설치 중..."
    Set-ExecutionPolicy Bypass -Scope Process -Force
    [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
    iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
    Write-Host "  설치 완료" -ForegroundColor Green
}

# ──────────────────────────────────────────────
# 4. Oh My Posh
# ──────────────────────────────────────────────
Write-Step "4/6 — Oh My Posh 설치"

if (Test-CommandExists oh-my-posh) {
    Write-Host "  이미 설치됨: oh-my-posh $(oh-my-posh --version)" -ForegroundColor Green
}
else {
    Write-Host "  winget으로 Oh My Posh 설치 중..."
    winget install --id JanDeDobbeleer.OhMyPosh --source winget --accept-package-agreements --accept-source-agreements
    # 환경 변수 갱신
    $env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
    Write-Host "  설치 완료" -ForegroundColor Green
}

# ──────────────────────────────────────────────
# 5. Nerd Font (FiraCode)
# ──────────────────────────────────────────────
Write-Step "5/6 — FiraCode Nerd Font 설치"

$fontInstalled = (Get-ChildItem -Path "$env:LOCALAPPDATA\Microsoft\Windows\Fonts" -Filter "*FiraCode*" -ErrorAction SilentlyContinue) -or
                 (Get-ChildItem -Path "C:\Windows\Fonts" -Filter "*FiraCode*Nerd*" -ErrorAction SilentlyContinue)

if ($fontInstalled) {
    Write-Host "  이미 설치됨" -ForegroundColor Green
}
else {
    Write-Host "  FiraCode Nerd Font 설치 중..."
    oh-my-posh font install FiraCode
    Write-Host "  설치 완료" -ForegroundColor Green
}

# ──────────────────────────────────────────────
# 6. PowerShell 7 프로필 구성
# ──────────────────────────────────────────────
Write-Step "6/6 — PowerShell 7 프로필 구성"

# pwsh의 $PROFILE 경로를 직접 계산
$pwshProfile = Join-Path ([Environment]::GetFolderPath("MyDocuments")) "PowerShell\Microsoft.PowerShell_profile.ps1"
$profileDir = Split-Path $pwshProfile -Parent

if (-not (Test-Path $profileDir)) {
    New-Item -ItemType Directory -Path $profileDir -Force | Out-Null
}

$profileContent = @'
# ── Oh My Posh ──
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\catppuccin_mocha.omp.json" | Invoke-Expression

# ── Alias ──
Set-Alias -Name ll -Value Get-ChildItem
Set-Alias -Name which -Value Get-Command

# ── PSReadLine ──
Set-PSReadLineOption -PredictionSource History
Set-PSReadLineOption -PredictionViewStyle ListView
Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete
'@

if (Test-Path $pwshProfile) {
    $existing = Get-Content $pwshProfile -Raw
    if ($existing -match "oh-my-posh init") {
        Write-Host "  프로필에 이미 Oh My Posh 설정이 있습니다. 건너뜀." -ForegroundColor Yellow
    }
    else {
        Add-Content -Path $pwshProfile -Value "`n$profileContent"
        Write-Host "  기존 프로필에 설정 추가 완료" -ForegroundColor Green
    }
}
else {
    Set-Content -Path $pwshProfile -Value $profileContent
    Write-Host "  프로필 생성 완료: $pwshProfile" -ForegroundColor Green
}

# ──────────────────────────────────────────────
# Windows Terminal 폰트 설정 안내
# ──────────────────────────────────────────────
Write-Host ""
Write-Host "========================================" -ForegroundColor Magenta
Write-Host "  모든 설치가 완료되었습니다!" -ForegroundColor Magenta
Write-Host "========================================" -ForegroundColor Magenta
Write-Host ""
Write-Host "[수동 설정 필요]" -ForegroundColor Yellow
Write-Host "  1. Windows Terminal을 종료하고 다시 여세요."
Write-Host "  2. 설정(Ctrl+,) > 기본 프로필 > 'PowerShell' (7.x) 선택"
Write-Host "  3. 프로필 > 기본값 > 모양 > 글꼴 > 'FiraCode Nerd Font' 선택"
Write-Host ""

# ──────────────────────────────────────────────
# 최종 확인
# ──────────────────────────────────────────────
Write-Host "[설치 결과 요약]" -ForegroundColor Cyan
Write-Host "  PowerShell 7 : $(if (Test-CommandExists pwsh) { 'OK' } else { 'MISSING' })"
Write-Host "  winget       : $(if (Test-CommandExists winget) { 'OK' } else { 'MISSING' })"
Write-Host "  Chocolatey   : $(if (Test-CommandExists choco) { 'OK' } else { 'MISSING' })"
Write-Host "  Oh My Posh   : $(if (Test-CommandExists oh-my-posh) { 'OK' } else { 'MISSING' })"
Write-Host "  개발자 모드  : $(if ((Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock' -Name AllowDevelopmentWithoutDevLicense -ErrorAction SilentlyContinue).AllowDevelopmentWithoutDevLicense -eq 1) { 'OK' } else { 'OFF' })"
Write-Host ""

실행 결과 예시

========================================
  1/6 — PowerShell 7 설치
========================================
  winget으로 PowerShell 7 설치 중...
  설치 완료

  ...중략...

========================================
  모든 설치가 완료되었습니다!
========================================

[수동 설정 필요]
  1. Windows Terminal을 종료하고 다시 여세요.
  2. 설정(Ctrl+,) > 기본 프로필 > 'PowerShell' (7.x) 선택
  3. 프로필 > 기본값 > 모양 > 글꼴 > 'FiraCode Nerd Font' 선택

[설치 결과 요약]
  PowerShell 7 : OK
  winget       : OK
  Chocolatey   : OK
  Oh My Posh   : OK
  개발자 모드  : OK

스크립트의 핵심 설계 포인트는 멱등성입니다. 이미 설치된 항목은 감지해서 건너뛰기 때문에, 중간에 실패하더라도 다시 실행하면 남은 부분만 이어서 처리됩니다. Windows Terminal의 기본 프로필과 폰트 설정만 수동으로 한 번 잡아주면 1편 세팅이 끝납니다.

728x90