<# 商盟 ERP「操作功能」Skill · 在线安装(不需要拷贝任何东西) 三种用法: 1) 一行安装(脚本和 zip 都放在网上) irm https://你的地址/install.ps1 | iex 2) 指定下载地址 powershell -ExecutionPolicy Bypass -File install.ps1 -Url https://你的地址/svip-erp-ops.zip 3) 本地已有 zip powershell -ExecutionPolicy Bypass -File install.ps1 -Zip D:\svip-erp-ops.zip 也可以直接把 install.ps1 和 svip-erp-ops.zip 放同一目录,双击 安装.bat 它做了什么:下载 → 解压到 %USERPROFILE%\.workbuddy\skills\svip-erp-ops → 自动联网装依赖(pyodbc/pyautogui/pillow/pycryptodome)→ 自检 重新打包:skill 里只有 SKILL.md 和 erp_ops.py 两个文件,压成 zip 即可。 #> param( [string]$Url = "https://shangmeng-erp-tools.app.workbuddy.host/skillpkg.bin", [string]$Zip = "" ) $ErrorActionPreference = "Stop" $dest = Join-Path $env:USERPROFILE ".workbuddy\skills\svip-erp-ops" New-Item -ItemType Directory -Force -Path $dest | Out-Null $src = $Zip if (-not $src -and -not $Url -and $env:SVIP_SKILL_URL) { $Url = $env:SVIP_SKILL_URL } if (-not $src -and $Url) { $src = Join-Path $env:TEMP "svip-erp-ops.zip" Write-Host "下载安装包: $Url" Invoke-WebRequest -Uri $Url -OutFile $src -UseBasicParsing } if (-not $src -and $PSScriptRoot) { $cand = Join-Path $PSScriptRoot "svip-erp-ops.zip" if (Test-Path $cand) { $src = $cand } } if (-not $src -or -not (Test-Path $src)) { Write-Host "找不到安装包:请用 -Url 指定下载地址,或把 svip-erp-ops.zip 放到本脚本同一目录。" -ForegroundColor Yellow exit 1 } Expand-Archive -Path $src -DestinationPath $dest -Force Write-Host "已安装到: $dest" $py = (Get-Command python -ErrorAction SilentlyContinue).Source if (-not $py) { $cand = Join-Path $env:USERPROFILE ".workbuddy\binaries\python\envs\default\Scripts\python.exe" if (Test-Path $cand) { $py = $cand } } if (-not $py) { Write-Host "未找到 python。装好 Python 3.9+ 后执行:python `"$dest\erp_ops.py`" deps" -ForegroundColor Yellow exit 0 } Write-Host "`n[1/2] 安装依赖(联网)" & $py (Join-Path $dest "erp_ops.py") deps Write-Host "`n[2/2] 连接自检" & $py (Join-Path $dest "erp_ops.py") check Write-Host "`n完成。以后直接: python `"$dest\erp_ops.py`" help"