#Requires -Version 5.1 <# ================================================== Windows 11 Ollama 관리 시스템 (PowerShell) - 첫 화면: 서버·적재 모델·CPU/램·그래픽 카드(GPU/VRAM)·디스크·연결·최근 오류 모니터링 - 실시간 모니터링 화면 (2초마다 갱신, q/Esc로 복귀) - 서버 기동 / 종료 / 재시작 분리 (스크립트를 켜도 서버를 건드리지 않음) - 인터넷(ollama.com)에서 모델 목록·태그를 가져와 바로 설치 (인기순·최신순·기능별 분류(비전·멀티모달 분리) + 검색어, 1시간 캐시, 오프라인이면 추천 목록 사용) - PC 사양(CPU, 램, GPU, VRAM)을 확인해 모델·태그마다 적합도 표시, 성능 설정 자동 조정 - 설치된 모델 실행 / ⭐추천 모델 / 도구 연동(ollama launch) / 일괄 다운로드 - VS Code Continue 설정(config.json) 자동 갱신: 로컬 PC + 원격(macpro01) 모델 전체, 추천·가능·느림·불가 표시 - Visual Studio Code: 설치·설정 한 번에(VS Code → Continue 확장 → 설정 → 실행), 폴더 골라 실행, 상태·업데이트·제거 - Open WebUI를 Podman 컨테이너로 실행 (데이터: 스크립트 폴더\webui) WSL2 확인·Podman 자동 설치(winget), 가상 머신 생성(CPU·메모리 선택), 기동·종료·재시작·이미지 업데이트·로그·브라우저 열기·백업·모니터링 - ComfyUI(그림 생성)를 Podman 컨테이너로 실행 (데이터: 스크립트 폴더\comfyui) 공식 소스 + CPU용 PyTorch로 직접 빌드, 여러 버전을 포트만 다르게 동시 실행, 그림 모델 다운로드(⭐CPU 추천), Open WebUI 이미지 생성 자동 연결, 기동 시 Ollama 모델 자동 내리기, 가상 머신 메모리 점검, 실행 확인·그림 생성 시험 - 통합 운영: Ollama → WebUI → ComfyUI 전체 기동·종료·연결 점검 - 방향키(↑↓) 메뉴(fzf), 없으면 winget 설치 여부를 묻고 거절하면 번호 입력 실행 방법 (PowerShell 창에서): powershell -ExecutionPolicy Bypass -File .\jj_ollama_manager.ps1 ================================================== #> # -------------------------------------------------- # 문자 인코딩 (한글이 fzf와 ollama 사이에서 깨지지 않도록 UTF-8로 통일) # -------------------------------------------------- $Utf8NoBom = New-Object System.Text.UTF8Encoding $false try { [Console]::OutputEncoding = $Utf8NoBom [Console]::InputEncoding = $Utf8NoBom } catch { } $OutputEncoding = $Utf8NoBom $global:OutputEncoding = $Utf8NoBom $ProgressPreference = 'SilentlyContinue' # 웹 요청 진행 표시줄 끄기 (속도 향상) # 색상 정의 (실제 제어 문자로 저장) $ESC = [char]27 $GREEN = "$ESC[0;32m" $BLUE = "$ESC[0;34m" $CYAN = "$ESC[0;36m" $YELLOW = "$ESC[1;33m" $RED = "$ESC[0;31m" $GRAY = "$ESC[0;90m" $BOLD = "$ESC[1m" $RESET = "$ESC[0m" $TAB = "`t" # -------------------------------------------------- # 설정값 # -------------------------------------------------- $OllamaBind = '0.0.0.0:11434' # 서버가 열어둘 주소 (외부 접속 허용) $ApiPort = 11434 $ApiUrl = "http://127.0.0.1:$ApiPort" # 상태 확인용 로컬 주소 $LogFile = Join-Path $HOME 'ollama_server.log' # 이 스크립트로 기동한 서버의 로그 $OutLogFile = Join-Path $HOME 'ollama_server.out.log' # 이 스크립트로 기동한 서버의 표준 출력 $AppLogFile = Join-Path $env:LOCALAPPDATA 'Ollama\server.log' # 트레이 앱으로 기동한 서버의 로그 $PidFile = Join-Path $HOME '.ollama_server.pid' # 이 스크립트로 기동한 서버의 PID $CtxFile = Join-Path $HOME '.ollama_server.ctx' # 이 스크립트로 기동한 서버의 컨텍스트 길이 $AgentContextLength = 65536 # 코딩 에이전트 권장 컨텍스트 (64K) $PreviewDir = Join-Path $env:TEMP 'jj_ollama_manager_preview' $CacheDir = Join-Path $env:LOCALAPPDATA 'jj_ollama_manager_cache' # 인터넷 모델 목록 캐시 # 이름 변경(ollama_manager → jj_ollama_manager) 전 설정·캐시 폴더가 있으면 새 이름으로 옮김 $OldCacheDir = Join-Path $env:LOCALAPPDATA 'ollama_manager_cache' if ((Test-Path $OldCacheDir) -and -not (Test-Path $CacheDir)) { try { Move-Item -LiteralPath $OldCacheDir -Destination $CacheDir -ErrorAction Stop } catch { } } $CacheTtlMin = 60 # 캐시 유지 시간(분) # VS Code Continue 설정 자동 갱신 (Update-ContinueConfig) $ContinueConfig = Join-Path $env:USERPROFILE '.continue\config.json' $ContinueRemoteName = 'macpro01' # 원격 Ollama 이름 (모델 이름 앞 [macpro01]) $ContinueRemoteBase = 'https://ollama.joynala.com:443' # 원격 Ollama 주소 (NAS 역방향 프록시) $ContinueRemoteRamGB = 128 # 원격 PC 램 (판정 기준) $ContinueRemoteCtx = 32768 # 원격 서버 OLLAMA_CONTEXT_LENGTH 와 같게 $ContinueRemoteThreads = 12 # 추천 모델 (적은 순서대로 위에 나옴, 첫 번째가 Continue 기본 모델) $ContinueRemoteRec = [ordered]@{ 'qwen3-coder:30b' = '메인 코딩'; 'qwen3.6:35b' = '에이전트 코딩·이미지 입력'; 'qwen3-vl:2b-instruct' = '이미지 분석·OCR 빠름' } $ContinueLocalRec = [ordered]@{ 'qwen:4b' = '빠른 대화'; 'qwen3-vl:2b-instruct' = '이미지 분석 빠름' } $LibraryUrl = 'https://ollama.com/library' # Open WebUI (Podman) 설정 # 컨테이너가 이 PC의 Ollama를 부를 때 쓰는 이 PC 주소 (비우면 자동: 기본 경로가 있는 어댑터 중 유선 먼저) # - 이 PC에 그 주소가 없으면(이더넷 빠짐 등) 무시하고 자동으로 고름 # - 2026-11-05: 이더넷(192.168.88.249)과 Wi-Fi(10.224.x)가 같이 켜져 Wi-Fi 주소가 뽑혀 WebUI → Ollama 연결 실패 $LanIpFixed = '192.168.88.249' $ScriptDir = $PSScriptRoot if (-not $ScriptDir) { $ScriptDir = (Get-Location).Path } $WebuiDir = Join-Path $ScriptDir 'webui' # 이 폴더 아래에 데이터가 쌓입니다 $WebuiData = Join-Path $WebuiDir 'data' # 컨테이너의 /app/backend/data $WebuiBackupDir = Join-Path $WebuiDir 'backups' $WebuiSecretFile = Join-Path $WebuiDir '.secret_key' $WebuiName = 'open-webui' # 컨테이너 이름 $WebuiImage = 'ghcr.io/open-webui/open-webui:main' $WebuiPort = 3000 # 접속 포트 $WebuiBind = '0.0.0.0' # 내부망의 다른 PC도 접속 가능 $WebuiOllamaUrl = 'http://host.containers.internal:11434' # 컨테이너에서 이 PC의 Ollama로 접속 (시작할 때 이 PC의 내부망 IP 주소로 바뀜) $WebuiDiskGB = 60 # Podman 가상 머신 디스크 크기 # ComfyUI (Podman) 설정 - 그림 생성 # - 이미지: 공식 소스(GitHub)와 CPU용 PyTorch로 이 PC에서 직접 빌드 (버전마다 이미지 태그가 다름) # - 버전마다 컨테이너가 따로 있고 포트만 다르게 동시에 실행 가능 (8188, 8189 ...) # - 모델 파일(comfyui\models)은 모든 버전이 함께 사용, 출력·작업흐름·노드는 버전별 폴더 $ComfyDir = Join-Path $ScriptDir 'comfyui' $ComfyModels = Join-Path $ComfyDir 'models' # 모든 버전이 함께 쓰는 모델 (기본 위치) $ComfyModelsFile = Join-Path $CacheDir 'comfy_models_dir.txt' # 저장 위치를 바꿨으면 그 경로가 적힘 if (Test-Path $ComfyModelsFile) { $cmTmp = ([IO.File]::ReadAllText($ComfyModelsFile)).Trim(); if ($cmTmp) { $ComfyModels = $cmTmp } } $ComfyInstDir = Join-Path $ComfyDir 'instances' # 버전별 output·input·user·custom_nodes $ComfyBackupDir = Join-Path $ComfyDir 'backups' $ComfyBuildDir = Join-Path $ComfyDir 'build' # 이미지 빌드 파일 (자동 생성) $ComfyPipCache = Join-Path $ComfyDir 'pip-cache' # 노드 패키지 재설치를 빠르게 $ComfyListFile = Join-Path $ComfyDir 'instances.txt' # 이름|버전|포트 $ComfyLinkFile = Join-Path $ComfyDir 'webui_link.txt' # WebUI 연결: 이름|모델파일 $ComfyTokenFile = Join-Path $ComfyDir '.hf_token' # (선택) Hugging Face 토큰 $ComfyImageRepo = 'localhost/comfyui-cpu' $ComfyGitUrl = 'https://github.com/Comfy-Org/ComfyUI' $ComfyReleaseApi = 'https://api.github.com/repos/Comfy-Org/ComfyUI/releases?per_page=30' $ComfyBasePort = 8188 $MinGpuVramGB = 4 # NVIDIA GPU의 VRAM이 이보다 작으면 Ollama를 CPU로 실행 (CUDA 오류 방지) $ComfyBind = '0.0.0.0' # 내부망의 다른 PC도 접속 가능 $ComfyMinMemGB = 8 # 가상 머신 메모리가 이보다 적으면 크기 조정 제안 $StackNetwork = 'ollama-stack' # WebUI·ComfyUI가 서로 이름으로 접속하는 내부 네트워크 $WebuiEnvFile = Join-Path $WebuiDir 'comfyui.env' # WebUI 이미지 생성 연결 설정 # 이 창에서 실행하는 ollama 명령(클라이언트)은 항상 로컬 서버에 접속 $env:OLLAMA_HOST = "127.0.0.1:$ApiPort" # -------------------------------------------------- # ⭐ 추천 모델 목록 (인터넷 목록의 ⭐ 표시용 + 오프라인일 때 대체 목록) # 형식: 분류|태그|표시 이름|크기(GB)|추천(Y/N)|도구호출(Y/N)|MoE(Y/N)|설명 # -------------------------------------------------- $ModelData = @( 'coding|qwen3-coder:30b|Qwen3 Coder 30B-A3B|19|Y|Y|Y|코딩 전용 MoE, 빠름, 256K 컨텍스트' 'coding|qwen3.6:35b|Qwen3.6 35B-A3B|24|Y|Y|Y|에이전트 코딩, 이미지 입력, 추론 모드' 'coding|qwen3.8:27b|Qwen3.8 27B|18|N|Y|N|최신 Qwen, 이미지 입력' 'general|gpt-oss:120b|GPT-OSS 120B|65|Y|Y|Y|대형 MoE 추론 모델, 램·VRAM이 넉넉할 때' 'general|gpt-oss:20b|GPT-OSS 20B|14|Y|Y|Y|빠른 MoE 추론, 일상 질문·문서 작업' 'general|gemma4:26b|Gemma 4 26B-A4B|19|Y|Y|Y|MoE, 이미지 입력, 256K 컨텍스트' 'general|gemma4:31b|Gemma 4 31B|20|N|Y|N|dense 모델, 품질 위주 (GPU가 있으면 유리)' 'light|gemma4:12b|Gemma 4 12B|8|N|Y|N|가벼운 작업용, 256K 컨텍스트' 'light|gemma4:e4b|Gemma 4 E4B|10|N|Y|N|초경량, 이미지·음성 입력' 'legacy|qwen2.5-coder:32b|Qwen 2.5 Coder 32B (구형)|20|N|Y|N|qwen3-coder:30b로 대체 권장' 'legacy|llama3.3|Llama 3.3 70B (구형)|43|N|Y|N|dense 70B, gpt-oss:120b로 대체 권장' 'legacy|deepseek-r1:14b|DeepSeek-R1 14B (구형)|9|N|N|N|gpt-oss:20b 또는 qwen3.6:35b로 대체 권장' 'embed|nomic-embed-text|Nomic Embed Text|1|Y|N|N|문서 검색(RAG)용 임베딩, 영어 위주' 'embed|bge-m3|BGE-M3|2|N|N|N|문서 검색(RAG)용 임베딩, 한국어 포함 다국어' ) $Models = foreach ($line in $ModelData) { $f = $line -split '\|' [pscustomobject]@{ Cat = $f[0] Tag = $f[1] Name = $f[2] Size = [int]$f[3] Rec = ($f[4] -eq 'Y') Tools = ($f[5] -eq 'Y') Moe = ($f[6] -eq 'Y') Desc = $f[7] } } # ⭐ 추천 모델의 계열 이름 (예: qwen3-coder, gpt-oss) $RecFamilies = @($Models | Where-Object { $_.Rec } | ForEach-Object { ($_.Tag -split ':')[0] } | Sort-Object -Unique) # -------------------------------------------------- # 연동 도구 목록 (ollama launch) # 형식: 실행 이름|표시 이름|설명|코딩 에이전트(Y/N) # ※ 지원 목록은 Ollama 버전마다 다를 수 있어 '대화형 선택' 메뉴도 함께 제공합니다. # -------------------------------------------------- $IntegrationData = @( 'claude|Claude Code|Anthropic의 터미널 코딩 에이전트 (코드 읽기·수정·명령 실행)|Y' 'codex|Codex|OpenAI의 코딩 에이전트|Y' 'opencode|OpenCode|오픈소스 터미널 코딩 에이전트|Y' 'droid|Droid|Factory의 코딩 에이전트|Y' 'openclaw|OpenClaw|메신저 앱으로 대화하는 개인 비서|N' 'hermes|Hermes Agent|메모리·재사용 스킬·메신저를 갖춘 개인 비서|N' ) $Integrations = foreach ($line in $IntegrationData) { $f = $line -split '\|' [pscustomobject]@{ Key = $f[0]; Name = $f[1]; Desc = $f[2]; Coding = ($f[3] -eq 'Y') } } # 도구 연동별 추천 모델 function Test-IntegrationRecommends([bool]$Coding, [string]$Tag) { if ($Coding) { return ($Tag -eq 'qwen3-coder:30b' -or $Tag -eq 'qwen3.6:35b') } return ($Tag -eq 'qwen3.6:35b' -or $Tag -eq 'gpt-oss:20b') } $CategoryLabels = @{ coding = '코딩 모델' general = '추론·범용 모델' light = '경량 모델' legacy = '구형 모델 (기존 사용 모델)' embed = '문서 검색(RAG) 임베딩 모델' } # 실행 중에 채워지는 값 $script:UseFzf = $false $script:OllamaExe = $null $script:HW = $null $script:Perf = $null $script:Installed = @() $script:LaunchDone = $false $script:PodmanExe = $null $script:PodmanVer = $null $script:LanIp = '' # Get-LanIp 가 기억해 둔 내부망 IP $script:LanIpKnown = $false $script:KeyHelp = "${GRAY}↑↓ 이동 · Enter/→ 선택 · ←/Esc 이전 메뉴 · 글자 입력 시 검색${RESET}" $script:MainKeyHelp = "${GRAY}↑↓ 이동 · Enter/→ 선택 · Esc 종료 · 글자 입력 시 검색${RESET}" # -------------------------------------------------- # 소스 불러오기 (src\platform\windows, 파일당 300~400줄 · 700줄 이하) # -------------------------------------------------- $SrcDir = Join-Path $ScriptDir 'src\platform\windows' foreach ($__src in @( '01_common_hardware_menu.ps1', '02_menu_library.ps1', '03_library_monitor.ps1', '04_server.ps1', '05_hardware_continue_ko.ps1', '06_ko_model_action.ps1', '07_online_launch.ps1', '08_bulk_podman_webui.ps1', '09_webui.ps1', '10_webui_menu_comfy.ps1', '11_comfy_network.ps1', '12_comfy_install.ps1', '13_comfy_stack_storage.ps1', '14_storage_quickopen.ps1', '15_webui_image_sync.ps1', '16_factory_reset.ps1', '17_podman_monitor.ps1', '18_podman_server.ps1', '19_ollama_restart.ps1', '20_git_menu.ps1', '21_vscode.ps1' )) { $__path = Join-Path $SrcDir $__src if (-not (Test-Path -LiteralPath $__path)) { Write-Host "${RED}❌ 소스 파일이 없습니다: $__path (저장소를 다시 받아 주세요: git pull)${RESET}" exit 1 } . $__path } Remove-Variable __src, __path -ErrorAction SilentlyContinue # -------------------------------------------------- # 시작 준비 (서버는 기동하지 않음) # -------------------------------------------------- Initialize-Fzf if (-not $script:UseFzf) { $script:KeyHelp = "${GRAY}번호를 입력해 선택 · 엔터만 누르면 뒤로${RESET}" $script:MainKeyHelp = "${GRAY}번호를 입력해 선택 · 엔터만 누르면 종료 확인${RESET}" } if (-not (Initialize-Ollama)) { Wait-Return exit 1 } Clear-Host Write-C "${CYAN}PC 사양을 확인하는 중입니다...${RESET}" $script:HW = Get-Hardware $script:Perf = Get-PerfSettings $script:HW $WebuiOllamaUrl = Get-WebuiOllamaUrl # WebUI 컨테이너가 이 PC의 Ollama를 부를 주소 if ($env:JJ_OM_NOMENU -ne '1') { try { Update-ContinueConfig -Quiet } catch { } } # VS Code Continue 설정 (바뀌었을 때만 안내) # -------------------------------------------------- # 메인 메뉴 # -------------------------------------------------- # 점검용: JJ_OM_NOMENU=1 이면 함수만 읽고 메뉴는 띄우지 않음 (자동 점검 스크립트가 사용) if ($env:JJ_OM_NOMENU -eq '1') { return } $script:StatusInMenus = $true # 이제부터 모든 메뉴에 상태 정보 표시 while ($true) { $items = @( (New-MenuItem '-' "${CYAN}──────── Podman 서버 ────────${RESET}" '-p') (New-MenuItem 'p_start' "▶ Podman 서버 기동 ${GRAY}(가상 머신 + 멈추기 전 켜져 있던 컨테이너)${RESET}") (New-MenuItem 'p_stop' "■ Podman 서버 종료 ${GRAY}(컨테이너 → 가상 머신)${RESET}") (New-MenuItem 'p_restart' "↻ Podman 서버 재시작 ${GRAY}(그대로 또는 CPU·메모리 바꿔서)${RESET}") (New-MenuItem '-' "${CYAN}──────── Ollama 서버 ────────${RESET}" '-0') (New-MenuItem 'start' "▶ Ollama 서버 기동 ${GRAY}(꺼져 있을 때만 켭니다)${RESET}") (New-MenuItem 'stop' '■ Ollama 서버 종료') (New-MenuItem 'restart' "↻ Ollama 서버 재시작 ${GRAY}(성능 설정 다시 적용 · 모델 저장 위치 유지/변경/이동)${RESET}") (New-MenuItem '-' "${CYAN}──────── 모델 ────────${RESET}" '-1') (New-MenuItem 'installed' ' 설치된 모델 실행') (New-MenuItem 'online' " 🔎 인터넷에서 모델 찾기·설치 ${GRAY}(ollama.com)${RESET}") (New-MenuItem 'rec' " ⭐ 추천 모델 목록 ${GRAY}(오프라인 가능)${RESET}") (New-MenuItem 'launch' " 도구 연동 ${GRAY}(Claude Code · Codex · OpenCode · Droid · OpenClaw · Hermes)${RESET}") (New-MenuItem 'bulk' ' 추천 모델 일괄 다운로드') (New-MenuItem 'ko' " 한국어 전용 모드: $(Get-KoModeLabel) ${GRAY}(답변에 한자·중국어 섞임 방지)${RESET}") (New-MenuItem 'storage' " 모델 저장 위치 ${GRAY}(Ollama · ComfyUI 폴더 확인·변경)${RESET}") (New-MenuItem '-' "${CYAN}──────── Visual Studio Code ────────${RESET}" '-v') (New-MenuItem 'vs_setup' " ★ VS Code 설치·설정 한 번에 ${GRAY}(VS Code → Continue 확장 → Continue 설정 → 실행, 있는 것은 건너뜀)${RESET}") (New-MenuItem 'vs_run' " ▶ VS Code 실행 ${GRAY}(최근 폴더 · 폴더 입력 · 그냥 열기)${RESET}") (New-MenuItem 'continue' " VS Code Continue 설정 갱신 ${GRAY}(로컬 PC + $ContinueRemoteName 모델 전체를 config.json에)${RESET}") (New-MenuItem 'vs_manage' " VS Code · Continue 관리 ${GRAY}(상태 · 업데이트 · 제거)${RESET}") (New-MenuItem '-' "${CYAN}──────── Open WebUI · ComfyUI ────────${RESET}" '-w') (New-MenuItem 'stack' " ▶ 통합 운영 ${GRAY}(Ollama + WebUI + ComfyUI 전체 기동·종료·점검)${RESET}") (New-MenuItem 'webui' " Open WebUI (Podman) 관리 ${GRAY}(기동·종료·업데이트·로그·백업)${RESET}") (New-MenuItem 'comfy' " ComfyUI (Podman) 관리 ${GRAY}(그림 생성 · 버전 설치 · 모델 다운로드 · WebUI 연결)${RESET}") (New-MenuItem '-' "${CYAN}──────── 모니터링 ────────${RESET}" '-2') (New-MenuItem 'live' " 실시간 모니터링 ${GRAY}(2초마다 갱신)${RESET}") (New-MenuItem 'status' ' 서버 상태 상세') (New-MenuItem 'log' ' 서버 로그 보기') (New-MenuItem 'hw' ' PC 사양 확인 및 모델 적합도') (New-MenuItem '-' "${CYAN}───────────────────────────${RESET}" '-3') (New-MenuItem 'git' " Git ${GRAY}(⬇ 최신 받기 · 상태 · 최근 기록)${RESET}") (New-MenuItem 'quit' ' 종료') ) $header = "$(Get-StatusBlock)`n$($script:MainKeyHelp)" $sel = Show-Menu -Header $header -Items $items -NoLeftBack -NoMonitor -SecretWord $ResetWord # 0000000000 → 완전 초기화 if (-not $sel) { # Esc(또는 번호 입력 취소) → 종료 확인 Clear-Host if (Confirm-Choice '프로그램을 종료할까요?') { Exit-App } continue } if ($sel -eq '-') { continue } if ($sel -eq '__secret') { Invoke-FactoryReset; continue } switch ($sel) { 'git' { Show-GitMenu } 'p_start' { Clear-Host; Start-PodmanServer; Wait-Return } 'p_stop' { Clear-Host; Stop-PodmanServer; Wait-Return } 'p_restart' { Clear-Host; Restart-PodmanServer; Wait-Return } 'start' { Clear-Host; [void](Start-OllamaServer); Wait-Return } 'stop' { Clear-Host; Stop-OllamaServer; Wait-Return } 'restart' { Show-OllamaRestartMenu; Wait-Return } 'installed' { Clear-Host; Show-InstalledMenu } 'online' { Invoke-OnlineInstallFlow } 'rec' { Show-RecMenu } 'launch' { Show-LaunchMenu } 'bulk' { Show-BulkDownloadMenu } 'ko' { Show-KoMenu } 'storage' { Show-StorageMenu } 'vs_setup' { Invoke-VscodeSetup } 'vs_run' { if (Show-VscodeRunMenu) { Wait-Return } } 'vs_manage' { Show-VscodeManageMenu } 'continue' { Clear-Host; Write-C "${CYAN}로컬 PC와 $ContinueRemoteName 의 모델 목록을 읽는 중...${RESET}"; Update-ContinueConfig; Wait-Return } 'live' { Show-LiveMonitor } 'status' { Clear-Host; Show-ServerStatus; Wait-Return } 'log' { Clear-Host; Show-ServerLog } 'webui' { Show-WebuiMenu } 'comfy' { Show-ComfyMenu } 'stack' { Show-StackMenu } 'hw' { Clear-Host; $script:HW = Get-Hardware; $script:Perf = Get-PerfSettings $script:HW; Show-HardwareInfo; Wait-Return } 'quit' { Exit-App } } }