====== Hyper-V上にESXiをインストールする ====== ESXi検証用にHyper-V上に環境を構築する方法 まず、PowerCLIをインストールする。 PowerShellを起動し、以下のコマンドを実行する。 Install-Module -Name VMware.PowerCLI or Install-Module VMware.PowerCLI -Scope CurrentUser -AllowClobber デジタル署名されていないとエラーが出る場合は以下のファイルを作成 # 署名用の証明書を作成 $cert = New-SelfSignedCertificate ` -Subject "CN=PowerShellスクリプト署名用証明書" ` -KeyAlgorithm RSA ` -KeyLength 2048 ` -Type CodeSigningCert ` -CertStoreLocation Cert:\CurrentUser\My\ ` -NotAfter ([datetime]"2099/01/01") # 信頼済みのルートとして使用 Move-Item "Cert:\CurrentUser\My\$($cert.Thumbprint)" Cert:\CurrentUser\Root # 証明書への参照を取得 $rootcert = @(Get-ChildItem cert:\CurrentUser\Root -CodeSigningCert)[0] # スクリプトに署名 Set-AuthenticodeSignature D:\MyScript.ps1 $rootcert