[Install‐2] Online install - rin309/Wsustainable GitHub Wiki

現在プレビュー版として公開しており、今後仕様を大きく変更する可能性があります

ご利用は自己責任にてお願いします。

注意事項

  • 今まで PowerShellGet を使用していなかった環境にてインストールをした場合、AllowPrerelease に関するエラーが表示されることがあります。詳しくは https://github.com/rin309/Wsustainable/issues/3 をご覧ください。
  • 更新機能は搭載されていないため、既存バージョンからのアップグレードも本ページのインストール手順にて可能です。
  • ただし、旧バージョンの設定ファイルがそのまま動作することを保証していません。更新後に想定通りの動作をしなくなった場合、https://github.com/rin309/Wsustainable/wiki/HowToUse の画面より、設定ファイルを再構築してください。

インターネット接続あり (推奨)

Set-ExecutionPolicy Unrestricted -Scope Process -Force
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force | Out-Null
If (@(Get-PackageSource | Where-Object Name -eq nuget.org).Count -eq 0){
    Import-PackageProvider -Name NuGet
    Register-PackageSource -Name nuget.org -ProviderName NuGet -Location https://api.nuget.org/v3/index.json
}
Install-Module -Name PowerShellGet -RequiredVersion 2.2.5 -AllowClobber -Force | Out-Null
If (@(Get-PackageSource | Where-Object Name -eq PSGallery).Count -eq 0){
    Register-PSRepository -Default
}
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Install-Module -Name SqlServer -Repository PSGallery -AllowClobber -Force | Out-Null
# ↓ FS-Resource-Manager は Show-WsustainableSettings のウィザード途中でもインストールできますが、事前にインストールしておくとスムーズです
Install-WindowsFeature FS-Resource-Manager -IncludeManagementTools

Get-InstalledModule | Where-Object Name -eq Wsustainable | Uninstall-Module -Force | Out-Null
Invoke-Expression -Command 'Install-Module -Name Wsustainable -Repository PSGallery -AllowClobber -AllowPrerelease -Force | Out-Null'
#↑現在プレリリース版のみ公開しているため、AllowPrerelease スイッチを有効にしている
#Install-Module -Name Wsustainable -Repository PSGallery -AllowClobber -Force | Out-Null

インストールの流れ

https://github.com/rin309/Wsustainable/assets/760251/ef901ff0-bc24-4f23-8d7f-fa80151c80d9