diff --git a/setup.ps1 b/setup.ps1 index 33ab217..ea3d0e1 100644 --- a/setup.ps1 +++ b/setup.ps1 @@ -53,7 +53,19 @@ $slnPath = Join-Path $PSScriptRoot "TIASshot.sln" if (Test-Path $slnPath) { - nuget restore $slnPath + # nuget.exe が PATH になければリポジトリルートにダウンロードして使用する + $nugetCmd = Get-Command nuget.exe -ErrorAction SilentlyContinue + if ($nugetCmd) { + $nugetExe = "nuget.exe" + } else { + $nugetExe = Join-Path $PSScriptRoot "nuget.exe" + if (-not (Test-Path $nugetExe)) { + Write-Host " nuget.exe をダウンロードします..." -ForegroundColor White + Invoke-WebRequest -Uri "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" ` + -OutFile $nugetExe + } + } + & $nugetExe restore $slnPath Write-Host " NuGet パッケージの復元が完了しました." -ForegroundColor Green } else { Write-Host " TIASshot.sln が見つかりません.手動で復元してください." -ForegroundColor Red