# requires -version 5.1 <# 서버노트북 점검 — «됐는지»를 사람이 판단하지 않게 한다 ========================================================= 설치가 끝난 것 같아도 정작 밖에서 안 붙는 일이 많다. 여섯 가지를 기계가 재서 통과/실패로 찍어 준다. irm https://www.jjcreative.co.kr/lab/check.ps1 | iex © 2026 JJ CREATIVE Edu with AI #> $ErrorActionPreference = 'SilentlyContinue' chcp 65001 > $null $script:R = @() function T($no, $name, $pass, $detail) { $script:R += [pscustomobject]@{ N=$no; 항목=$name; 결과=$(if($pass){'통과'}else{'확인필요'}); 내용=$detail } $c = if ($pass) { 'Green' } else { 'Yellow' } $m = if ($pass) { 'OK' } else { '!!' } Write-Host (" [{0}] {1}/6 {2,-16} {3}" -f $m, $no, $name, $detail) -ForegroundColor $c } Write-Host "" Write-Host " 서버노트북 점검" -ForegroundColor Yellow Write-Host "" # ── 1. 덮어도 안 자나 ───────────────────────────────────── # powercfg 출력은 언어에 따라 달라지므로, 마지막 두 16진수(AC/DC)만 읽는다. function PowerVal($sub, $set) { $o = powercfg /query SCHEME_CURRENT $sub $set 2>$null $m = [regex]::Matches(($o -join "`n"), '0x[0-9a-fA-F]{8}') if ($m.Count -lt 2) { return $null } return @([Convert]::ToInt64($m[$m.Count-2].Value,16), [Convert]::ToInt64($m[$m.Count-1].Value,16)) } $sleep = PowerVal '238c9fa8-0aad-41ed-83f4-97be242c8f20' '29f6c1db-86da-48c5-9fdb-f2b67b1f44da' $lid = PowerVal '4f971e89-eebd-4455-a8de-9e59040e7347' '5ca83367-6e45-459f-a27b-476b1d01c936' if ($null -eq $sleep -or $null -eq $lid) { T 1 '잠들지 않기' $false '전원 설정을 읽지 못했습니다' } else { $ok = ($sleep[0] -eq 0 -and $sleep[1] -eq 0 -and $lid[0] -eq 0 -and $lid[1] -eq 0) T 1 '잠들지 않기' $ok ("절전 AC={0} DC={1} · 덮개 AC={2} DC={3} (0이어야 함)" -f $sleep[0],$sleep[1],$lid[0],$lid[1]) } # ── 2. 기본 도구 ────────────────────────────────────────── $tools = @( @{n='node'; v='--version'}, @{n='python'; v='--version'}, @{n='git'; v='--version'}, @{n='npm'; v='--version'} ) $miss = @() $vers = @() foreach ($t in $tools) { if (Get-Command $t.n -ErrorAction SilentlyContinue) { $line = (& $t.n $t.v 2>&1 | Select-Object -First 1) -as [string] $mv = [regex]::Match($line, '\d+\.\d+(\.\d+)?') $vers += ("{0} {1}" -f $t.n, $(if ($mv.Success) { $mv.Value } else { '?' })) } else { $miss += $t.n } } T 2 '기본 도구' ($miss.Count -eq 0) $(if($miss.Count){"없음: " + ($miss -join ', ')}else{$vers -join ' · '}) # ── 3. Claude Code ──────────────────────────────────────── $cl = Get-Command claude -ErrorAction SilentlyContinue if ($cl) { T 3 'Claude Code' $true ((& claude --version 2>&1 | Select-Object -First 1)) } else { T 3 'Claude Code' $false '설치되지 않았습니다' } # ── 4. 설정이 이식됐나 ──────────────────────────────────── $C = Join-Path $env:USERPROFILE '.claude' $nSkill = @(Get-ChildItem "$C\skills" -Directory -ErrorAction SilentlyContinue).Count $nAgent = @(Get-ChildItem "$C\agents" -Filter *.md -ErrorAction SilentlyContinue).Count $nCmd = @(Get-ChildItem "$C\commands" -Filter *.md -ErrorAction SilentlyContinue).Count T 4 '스킬·설정' ($nSkill -gt 0) ("스킬 {0} · 에이전트 {1} · 명령어 {2}" -f $nSkill,$nAgent,$nCmd) # ── 5. MCP 연결 ─────────────────────────────────────────── # .claude.json 은 BOM 이 섞일 수 있으므로 앞의 BOM 을 떼고 읽는다. $J = Join-Path $env:USERPROFILE '.claude.json' $nMcp = 0; $mcpNames = '' if (Test-Path $J) { try { $raw = [IO.File]::ReadAllText($J).TrimStart([char]0xFEFF) $cfg = $raw | ConvertFrom-Json $names = @($cfg.mcpServers.PSObject.Properties.Name) $nMcp = $names.Count $mcpNames = ($names -join ', ') } catch { $mcpNames = '설정 파일을 읽지 못했습니다' } } T 5 'MCP 연결' ($nMcp -gt 0) $(if($nMcp){"$nMcp 개 — $mcpNames"}else{'설정된 MCP 가 없습니다'}) # ── 6. 밖에서 부릴 준비 ─────────────────────────────────── # 원격조종은 «켜 둔 작업창»이 있어야 붙는다. 흔적으로만 판정한다. $hasSess = (Test-Path "$C\sessions") -or (Test-Path "$C\session-env") $running = @(Get-Process -Name node -ErrorAction SilentlyContinue).Count T 6 '밖에서 부리기' $hasSess ("세션 폴더 {0} · node 프로세스 {1}개 — 휴대폰 확인은 아래 참고" -f $(if($hasSess){'있음'}else{'없음'}), $running) # ── 정리 ────────────────────────────────────────────────── Write-Host "" $fail = @($script:R | Where-Object { $_.결과 -ne '통과' }) if ($fail.Count -eq 0) { Write-Host " 여섯 가지 모두 통과했습니다." -ForegroundColor Green Write-Host "" Write-Host " 마지막 한 가지는 손으로 확인하십시오 —" -ForegroundColor DarkGray Write-Host " 1) 이 노트북에서 claude 를 열고 /remote-control 을 칩니다" Write-Host " 2) 휴대폰 Claude 앱 > Code 탭에서 이 노트북이 보이면 끝입니다" } else { Write-Host (" 확인이 필요한 항목 {0}개" -f $fail.Count) -ForegroundColor Yellow foreach ($f in $fail) { Write-Host (" {0}/6 {1} — {2}" -f $f.N, $f.항목, $f.내용) } Write-Host "" Write-Host " 막히면 Claude 에게 그대로 붙여넣으십시오:" -ForegroundColor DarkGray Write-Host ' "점검에서 이렇게 나왔어. 고쳐줘." + 위 내용' -ForegroundColor White } Write-Host "" if ($fail.Count -eq 0) { exit 0 } else { exit 1 }