Windows Updateを行うためのPowerShellスクリプト

先日、PowerShellを使ってWindows Updateを行うためのスクリプトを作った。
(関連記事「PowerShellによるWindows Updateが0x80240023で失敗する(EULAの同意問題)」)

しかし、これだと、Windows Updateで重要に表示されているのに、適用されないパッチがいろいろとあった。
理由はなんだろう?と思ったら、Windows Updateの設定にある「推奨される更新プログラムについても重要な更新プログラムと同様に通知する」という設定の問題だった。
これにチェックが入っている場合は、GUI上は重要な更新プログラムとして表示されるということだった。

しかし、このGUI表示での重要な更新プログラム扱い、というのは、PowerShellで取得できる重要な更新プログラム一覧には反映されない、というものだった。

では、何で見ているのか?
PowerShellで取得できる情報上は、更新プログラムは下記の3種類に分かれていた。
・重要な更新プログラム
・推奨する更新プログラム
・オプションの更新プログラム
GUI上では、「推奨する更新プログラム」を、どちらに表示するかが切り替わっているだけであるようだった。

PowerShell上で見分けるには「AutoSelectOnWebSites」と「BrowseOnly」の値を確認することで行う。

・重要な更新プログラム
  → AutoSelectOnWebSites が $True
・推奨する更新プログラム
  → BrowseOnly が$False
・オプションの更新プログラム
  → BrowseOnly が$True

というわけで、作成したWindows Updateを行うPowerShellは下記の様な感じになりました。

実行する際につけられるオプションは下記の3つです。

重要な更新のみ適用したい場合は「-importantonly」オプション
更新のダウンロードのみをおこないたい場合は「-downloadonly」オプション
オプションの更新でも適用したいものがある場合はテキストファイル内に適用したいKB番号を書いて「-kblistfile ファイル名」と指定

# Windows UpdateをPowerShellから実行するためのスクリプト
#
param(
[String]$kblistfile="c:\tmp\kblist.txt", # 適用するオプション更新のリスト -kblistfile ファイル名
[switch]$downloadonly, # アップデートのダウンロードまでで終了するオプション -downloadonly
[switch]$importantonly # 重要な更新のみ適用する -importantonly
)

[Int]$ReturnCode=0        #終了コード

##### 実行開始 #########################
$date_msg = Get-date -Format "yyyy/MM/dd HH:mm:ss"
Write-Host ("Windows Update更新処理開始: " + $date_msg)

#### KB適用リスト読み込み ####]
[Array]$KBlist=@()    #KBリスト
if (Test-Path $kblistfile){
    $KBlist= Get-Content $kblistfile
}

#### WindowsUpdateの情報取得処理 start ####
$UpdateCollection = New-Object -ComObject Microsoft.Update.UpdateColl	#適用するWindows Update一覧で使用
$Session = New-Object -ComObject Microsoft.Update.Session				#
$Searcher = New-Object -ComObject Microsoft.Update.Searcher				#更新プログラム検索
#### WindowsUpdateの情報取得処理 end ####

Write-Host ""

#### Windows Updateによる現在のWindowsUpdate適用済み一覧を作成 start ####
$date_msg = Get-date -Format "yyyy/MM/dd HH:mm:ss"
Write-Host ("Windows Updateによる現在のWindows Update適用状況検索中 "+$date_msg)
$BeforeWUList2=($Searcher.Search("IsInstalled=1")).Updates
[Array]$BeforeWUListArray=@()
Write-Host "実施前のWindows Update適用済み一覧(Windows Update)"
$BeforeWUList2 | Select-Object Title,Description | Sort-Object Title | ForEach-Object {
    Write-Host ("  "+$_.Title)
    $BeforeWUListArray+=[string]$_.Title
}
# https://social.technet.microsoft.com/Forums/en-US/057bb7f5-d014-4374-9699-296b56e64561/win32quickfixengineering-vs-gethotfix?forum=winserverpowershell
#### Windows Updateによる現在のWindowsUpdate適用済み一覧を作成 end ####

Write-Host ""

#### インストールされていないWindows Updateの検出 start ####
$date_msg = Get-date -Format "yyyy/MM/dd HH:mm:ss"
Write-Host ("適用されていないWindows Update一覧の検索開始 "+$date_msg)
$Result = $Searcher.Search("IsInstalled=0 and Type='Software'")

Write-Host ""
Write-Host "適用されていないWindows Update一覧"
Write-Host "  * 重要な更新, o 推奨される更新"
Write-Host "  x オプションの更新でKBlistで指定されたもの, - 指定されていないオプションの更新"
Write-Host "  各行末尾のTrue/Falseはダウンロード済みであるかどうか"

[int]$countrequire=0
[int]$countrecommend=0
[int]$countoptionapply=0
[int]$countoption=0
foreach ($Updates in $Result.Updates){
    if($Updates.AutoSelectOnWebSites){
        # 重要な更新
        if($Updates.EulaAccepted -eq 0){
            $Updates.AcceptEula()
        }
        $UpdateCollection.Add($Updates) | Out-Null
        Write-Host ("* "+$Updates.KBArticleIDs+" "+$Updates.Title+" "+$Updates.IsDownloaded)
        $countrequire++
    }elseif($Updates.BrowseOnly -eq $false){
        # 推奨される更新
        if($importantonly -eq $false){
            if($Updates.EulaAccepted -eq 0){
                $Updates.AcceptEula()
            }
            $UpdateCollection.Add($Updates) | Out-Null
        }
        Write-Host ("o "+$Updates.KBArticleIDs+" "+$Updates.Title+" "+$Updates.IsDownloaded)
        $countrecommend++
    }else{
        # それ以外
        if($KBlist -contains $Updates.KBArticleIDs){
            if($Updates.EulaAccepted -eq 0){
                $Updates.AcceptEula()
            }
            $UpdateCollection.Add($Updates) | Out-Null
            Write-Host ("x "+$Updates.KBArticleIDs+" "+$Updates.Title+" "+$Updates.IsDownloaded)
            $countoptionapply++
        }else{
            Write-Host ("- "+$Updates.KBArticleIDs+" "+$Updates.Title+" "+$Updates.IsDownloaded)
            $countoption++
        }
    }
}
#### インストールされていないWindows Updateの検出 end ####

Write-Host ""
Write-Host ("  重要な更新: "+$countrequire+" 個")
Write-Host ("  推奨する更新: "+$countrecommend+" 個")
Write-Host ("  適用するオプション更新: "+$countoptionapply+" 個")
Write-Host ("  適用しないオプション更新: "+$countoption+" 個")
if($importantonly){
    Write-Host ("    → 推奨する更新は適用しません")
}

Write-Host ""

#### インストールされていないWindows Updateがあるか確認 start ####
if($UpdateCollection.Count -eq 0){
    Write-Host "適用されていないアップデートはありません"
    $date_msg = Get-date -Format "yyyy/MM/dd HH:mm:ss"
    Write-Host ("Windows Update更新処理終了: " + $date_msg)
    return 0
}
#### インストールされていないWindows Updateがあるか確認 end ####

Write-Host ""

#### インストールされていないWindows Updateのダウンロード start ####
$date_msg = Get-date -Format "yyyy/MM/dd HH:mm:ss"
Write-Host ("Windows Updateのダウンロード開始 "+$date_msg)
$Downloader = $Session.CreateUpdateDownloader()
### 分割ダウンロード
$UpdateCollection | ForEach-Object {
    $Update=$_
    $date_msg = Get-date -Format "yyyy/MM/dd HH:mm:ss"
    Write-Host ("  "+$date_msg+" "+$Update.Title)
    $UpdateToDownload = New-object -com "Microsoft.Update.UpdateColl"
    $UpdateToDownload.Add($Update) | Out-Null
    $Downloader.Updates = $UpdateToDownload
    $DownloadResult = $Downloader.Download()
    Write-Host $("      ダウンロード処理終了コード" + $DownloadResult.ResultCode)
    if($DownloadResult.ResultCode -ne 2){
        Write-Host $Error[0]
    }
    [System.Runtime.Interopservices.Marshal]::ReleaseComObject($UpdateToDownload) | Out-Null
}
# 下記のエラーがでる場合は、実行者の権限が足りません。管理者権限を与えてください
# "0" 個の引数を指定して "Download" を呼び出し中に例外が発生しました: "HRESULT からの例外: 0x80240044"
#### インストールされていないWindows Updateのダウンロード end ####

Write-Host ""

#### ダウンロードが完了していないWindows Updateがないか確認 start ####
[Array]$FailedDownload=@()
foreach ($Updates in $UpdateCollection){
    if($Updates.IsDownloaded -eq $false){
        $FailedDownload+=$Updates.Title
    }
}
if($FailedDownload){
    Write-Host "ダウンロードが完了していないWindows Update"
    $FailedDownload
    $date_msg = Get-date -Format "yyyy/MM/dd HH:mm:ss"
    Write-Host ("Windows Update更新処理異常終了: " + $date_msg)
    return 1
}

Write-Host "適用予定のWindows Updateのダウンロードが完了しました"

#### ダウンロードが完了していないWindows Updateがないか確認 end ####

if($downloadonly){
    Write-Host "-downloadonly オプションのため、ダウンロード完了で終了します"
    $date_msg = Get-date -Format "yyyy/MM/dd HH:mm:ss"
    Write-Host ("Windows Update更新処理終了: " + $date_msg)
    return 0
}

Write-Host ""

#### Windows Updateの適用実施 start ####
$date_msg = Get-date -Format "yyyy/MM/dd HH:mm:ss"
Write-Host ("Windows Updateの適用開始 "+$date_msg)
$Installer = New-Object -ComObject Microsoft.Update.Installer
$Installer.Updates = $UpdateCollection
$InstallResult = $Installer.Install()
Write-Host $("更新プログラムインストール終了コード" + $InstallResult.ResultCode)
if($InstallResult.RebootRequired){
    Write-Host "*** 再起動が必要です ***"
}
if($InstallResult.ResultCode -eq 2){
    Write-Host "すべてのアップデートが適用されました"
}elseif($InstallResult.ResultCode -eq 3){
    Write-Host "アップデート適用しましたがエラーも発生しました"
    Write-Host $Error[0]
    $ReturnCode=1
}elseif($InstallResult.ResultCode -eq 4){
    Write-Host "アップデート適用に失敗しました"
    Write-Host $Error[0]
    $ReturnCode=1
}elseif($InstallResult.ResultCode -eq 5){
    Write-Host "アップデート適用を中断しました"
    Write-Host $Error[0]
    $ReturnCode=1
}else{
    Write-Host "アップデート適用がなんらかしらの理由で失敗しました"
    Write-Host $Error[0]
    $ReturnCode=1
}
#### Windows Updateの適用実施 end ####

Write-Host ""
$date_msg = Get-date -Format "yyyy/MM/dd HH:mm:ss"
Write-Host ("実行結果出力 "+$date_msg)

#### Windows Updateによる現在のWindowsUpdate適用済み一覧を作成 start ####
$date_msg = Get-date -Format "yyyy/MM/dd HH:mm:ss"
Write-Host ("Windows Updateによる現在のWindows Update適用状況検索中 "+$date_msg)
$AfterWUList2=($Searcher.Search("IsInstalled=1")).Updates
Write-Host "実施後のWindows Update適用済み一覧(Windows Update)"
[Array]$AfterWUListArray=@()
$AfterWUList2 | Select-Object Title,Description | Sort-Object Title | ForEach-Object {
    Write-Host ("  "+$_.Title)
    $AfterWUListArray+=[string]$_.Title
}
# https://social.technet.microsoft.com/Forums/en-US/057bb7f5-d014-4374-9699-296b56e64561/win32quickfixengineering-vs-gethotfix?forum=winserverpowershell
#### Windows Updateによる現在のWindowsUpdate適用済み一覧を作成 end ####

Write-Host ""
if($InstallResult.RebootRequired){
    Write-Host "*** 再起動が必要です ***"
}

if($ReturnCode -ne 0){
    New-Item $ErrorFile -ItemType file -Value "1" | Out-Null
    $date_msg = Get-date -Format "yyyy/MM/dd HH:mm:ss"
    Write-Host ("Windows Update更新処理異常終了: " + $date_msg)
    return 1    
}

$date_msg = Get-date -Format "yyyy/MM/dd HH:mm:ss"
Write-Host ("Windows Update更新処理終了: " + $date_msg)
return 0

ちなみに、「Compare-Object $BeforeWUList2 $AfterWUList2」をベースとして、今回追加された更新一覧を出力しようとしてたのですが、差分じゃないところが出力されていたりしたので、スクリプトから削除しました・・・


Windows7における実行例

PS C:\tmp> .\powershell-windowsupdate.ps1  -importantonly
Windows Update更新処理開始: 2017/03/24 19:48:33

Windows Updateによる現在のWindows Update適用状況検索中 2017/03/24 19:48:33
実施前のWindows Update適用済み一覧(Windows Update)
  2016年 12 月 x64 用 Windows 7 および Windows Server 2008 R2 の、.NET Framework 3.5.1、4.5.2、4.6、4.6.1、4.6.2 用セキ
ュリティおよび品質ロールアップ (KB3205402)
  Definition Update for Windows Defender - KB915597 (Definition 1.239.92.0)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2604115)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2656356)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2729452)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2736422)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2742599)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2789645)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2840631)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2861698)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2894844)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2911501)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2931356)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2937610)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2943357)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2968294)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2972100)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2972211)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2973112)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2978120)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB3023215)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB3037574)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB3072305)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB3074543)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB3097989)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB3163245)
  Windows 7 for x64-based Systems の ActiveX Killbits に対する累積的なセキュリティ更新プログラム (KB2900986)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2479943)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2491683)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2506212)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2509553)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2560656)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2564958)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2579686)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2585542)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2620704)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2621440)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2631813)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2653956)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2654428)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2667402)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2676562)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2685939)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2690533)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2698365)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2705219)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2706045)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2727528)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2758857)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2770660)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2807986)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2813430)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2840149)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2847927)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2862152)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2862330)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2862335)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2864202)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2868038)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2871997)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2884256)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2892074)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2893294)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2957189)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2965788)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2973201)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2973351)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2977292)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2978742)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2984972)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2991963)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2992611)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3003743)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3004361)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3004375)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3010788)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3011780)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3019978)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3021674)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3022777)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3030377)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3031432)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3042553)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3045685)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3046017)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3046269)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3055642)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3059317)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3060716)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3067903)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3067904)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3071756)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3075220)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3076895)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3080446)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3084135)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3086255)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3092601)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3093513)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3101722)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3108371)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3108381)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3108664)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3108670)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3109103)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3109560)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3115858)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3123479)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3126587)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3138910)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3139398)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3139914)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3146706)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3149090)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3150220)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3155178)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3156017)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3159398)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3161949)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3161958)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3170455)
  Windows 7 for x64-Based Systems 用更新プログラム (KB2506014)
  Windows 7 for x64-Based Systems 用更新プログラム (KB2552343)
  Windows 7 for x64-Based Systems 用更新プログラム (KB2729094)
  Windows 7 for x64-Based Systems 用更新プログラム (KB2786081)
  Windows 7 for x64-Based Systems 用更新プログラム (KB2798162)
  Windows 7 for x64-Based Systems 用更新プログラム (KB2868116)
  Windows 7 for x64-Based Systems 用更新プログラム (KB2882822)
  Windows 7 for x64-Based Systems 用更新プログラム (KB2888049)
  Windows 7 for x64-Based Systems 用更新プログラム (KB2929733)
  Windows 7 for x64-Based Systems 用更新プログラム (KB3024777)
  Windows 7 for x64-Based Systems 用更新プログラム (KB3138612)
  Windows 7 for x64-Based Systems 用更新プログラム (KB3177467)
  Windows 7 x64 Edition 用プラットフォーム更新プログラム (KB2670838)
  Windows 7 および Windows Server 2008 R2 SP1 x64 の、Microsoft .NET Framework 3.5.1 用セキュリティ更新プログラム (KB312
2648)
  Windows 7 および Windows Server 2008 R2 SP1 x64 の、Microsoft .NET Framework 3.5.1 用セキュリティ更新プログラム (KB312
7220)
  Windows 7 および Windows Server 2008 R2 SP1 x64 の、Microsoft .NET Framework 3.5.1 用セキュリティ更新プログラム (KB313
5983)
  Windows 7 および Windows Server 2008 R2 SP1 x64 の、Microsoft .NET Framework 3.5.1 用セキュリティ更新プログラム (KB314
2024)
  x64 ベース システム Windows 7 用 Internet Explorer 11
  x64 ベース システム Windows 7 用 Internet Explorer 11 言語パック
  x64 ベース システムの Windows 7 および Windows Server 2008 R2 SP1 用 Microsoft .NET Framework 3.5.1 更新プログラム (KB
2836942)
  x64 ベース システムの Windows 7 および Windows Server 2008 R2 SP1 用 Microsoft .NET Framework 3.5.1 更新プログラム (KB
2836943)
  x64 ベース システム用 Windows 7 Service Pack 1 (KB976932)
  悪意のあるソフトウェアの削除ツール x64 - 2017 年 3 月 (KB890830)
  日本語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139)

適用されていないWindows Update一覧の検索開始 2017/03/24 19:50:44

適用されていないWindows Update一覧
  * 重要な更新, o 推奨される更新
  x オプションの更新でKBlistで指定されたもの, - 指定されていないオプションの更新
  各行末尾のTrue/Falseはダウンロード済みであるかどうか
- 2483139 ラトビア語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 チェコ語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 ロシア語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 英語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 デンマーク語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 イタリア語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 ハンガリー語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 韓国語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 スウェーデン語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 ポーランド語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 クロアチア語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 ウクライナ語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 ノルウェー語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 ギリシャ語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 ブルガリア語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 ポルトガル語 (ポルトガル) パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 オランダ語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 ポルトガル語 (ブラジル) パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 スペイン語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 中国語 (簡体字) パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 スロベニア語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 中国語 (繁体字) パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 タイ語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 ドイツ語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 エストニア語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 リトアニア語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 スロバキア語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 フィンランド語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 アラビア語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 ヘブライ語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 セルビア語 (ラテン) パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 ルーマニア語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 フランス語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
- 2483139 トルコ語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139) False
o 982018 Windows 7 for x64-Based Systems 用更新プログラム (KB982018) False
o 982670 Windows 7 x64-based Systems 用の Microsoft .NET Framework 4 Client Profile (KB982670) True
o 2719857 Windows 7 for x64-Based Systems 用更新プログラム (KB2719857) True
o 2732059 Windows 7 for x64-Based Systems 用更新プログラム (KB2732059) True
o 2732487 Windows 7 for x64-Based Systems 用更新プログラム (KB2732487) False
o 2750841 Windows 7 for x64-Based Systems 用更新プログラム (KB2750841) True
o 2763523 Windows 7 for x64-Based Systems 用更新プログラム (KB2763523) True
o 2791765 Windows 7 for x64-Based Systems 用更新プログラム (KB2791765) True
- 2574819 Windows 7 for x64-Based Systems 用更新プログラム (KB2574819) False
- 2592687 Windows 7 for x64-Based Systems 用更新プログラム (KB2592687) False
o 2853952 Windows 7 for x64-Based Systems 用更新プログラム (KB2853952) True
o 2852386 Windows 7 for x64-Based Systems 用更新プログラム (KB2852386) True
o 2834140 Windows 7 for x64-Based Systems 用更新プログラム (KB2834140) True
o 2808679 Windows 7 for x64-Based Systems 用更新プログラム (KB2808679) True
o 2893519 Windows 7 for x64-Based Systems 用更新プログラム (KB2893519) True
o 2891804 Windows 7 for x64-Based Systems 用更新プログラム (KB2891804) True
* 2912390 Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2912390) True
- 2830477 Windows 7 for x64-Based Systems 用更新プログラム (KB2830477) False
o 2843630 Windows 7 for x64-Based Systems 用更新プログラム (KB2843630) True
o 2919469 Windows 7 for x64-Based Systems 用更新プログラム (KB2919469) True
o 2918077 Windows 7 for x64-Based Systems 用更新プログラム (KB2918077) True
o 2908783 Windows 7 for x64-Based Systems 用更新プログラム (KB2908783) True
o 2800095 Windows 7 for x64-Based Systems 用更新プログラム (KB2800095) True
o 2966583 Windows 7 for x64-Based Systems 用更新プログラム (KB2966583) True
o 2640148 Windows 7 for x64-Based Systems 用更新プログラム (KB2640148) True
o 2685813 x64 ベース システム Windows 7 用ユーザー モード ドライバー フレームワーク (バージョン 1.11) の更新プログラム (
KB2685813) True
o 2603229 Windows 7 for x64-Based Systems 用更新プログラム (KB2603229) True
o 2547666 Windows 7 for x64-Based Systems 用更新プログラム (KB2547666) True
o 2726535 Windows 7 for x64-Based Systems 用更新プログラム (KB2726535) True
o 2506928 Windows 7 for x64-Based Systems 用更新プログラム (KB2506928) True
o 2660075 Windows 7 for x64-Based Systems 用更新プログラム (KB2660075) True
* 2532531 Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2532531) True
o 2545698 Windows 7 for x64-Based Systems 用更新プログラム (KB2545698) True
o 2773072 Windows 7 for x64-Based Systems 用更新プログラム (KB2773072) True
o 2563227 Windows 7 for x64-Based Systems 用更新プログラム (KB2563227) True
o 2761217 Windows 7 for x64-Based Systems 用更新プログラム (KB2761217) True
o 2799926 Windows 7 for x64-Based Systems 用更新プログラム (KB2799926) True
o 2985461 Windows 7 for x64-Based Systems 用更新プログラム (KB2985461) True
o 2685811 x64 ベース システム Windows 7 用カーネル モード ドライバー フレームワーク (バージョン 1.11) の更新プログラム (
KB2685811) True
o 3006121 Windows 7 for x64-Based Systems 用更新プログラム (KB3006121) True
o 2901983 x64 ベース システム Windows 7 用の Microsoft .NET Framework 4.5.2 (KB2901983) True
o 3021917 Windows 7 for x64-Based Systems 用更新プログラム (KB3021917) True
o 3006137 Windows 7 for x64-Based Systems 用更新プログラム (KB3006137) True
* 3035132 Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3035132) True
* 3035126 Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3035126) True
o 3013531 Windows 7 for x64-Based Systems 用更新プログラム (KB3013531) True
o 3020370 Windows 7 for x64-Based Systems 用更新プログラム (KB3020370) True
o 3054476 Windows 7 for x64-Based Systems 用更新プログラム (KB3054476) True
o 3068708 Windows 7 for x64-Based Systems 用更新プログラム (KB3068708) True
* 3078601 Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3078601) True
o 3092627 Windows 7 for x64-Based Systems 用更新プログラム (KB3092627) True
o 3078667 Windows 7 for x64-Based Systems 用更新プログラム (KB3078667) True
o 3080149 Windows 7 for x64-Based Systems 用更新プログラム (KB3080149) True
- 3080079 Windows 7 for x64-Based Systems 用更新プログラム (KB3080079) False
o 3107998 Windows 7 for x64-Based Systems 用更新プログラム (KB3107998) True
* 3110329 Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3110329) True
- 3102429 Windows 7 for x64-Based Systems 用更新プログラム (KB3102429) False
o 3118401 Windows 7 for x64-Based Systems 用更新プログラム (KB3118401) True
o 3121255 Windows 7 for x64-Based Systems 用更新プログラム (KB3121255) True
o 3147071 Windows 7 for x64-Based Systems 用更新プログラム (KB3147071) True
o 3137061 Windows 7 for x64-Based Systems 用更新プログラム (KB3137061) True
o 3138901 Windows 7 for x64-Based Systems 用更新プログラム (KB3138901) True
o 3133977 Windows 7 for x64-Based Systems 用更新プログラム (KB3133977) True
o 3138378 Windows 7 for x64-Based Systems 用更新プログラム (KB3138378) True
* 3156016 Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3156016) True
* 3156019 Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3156019) True
o 3140245 Windows 7 for x64-Based Systems 用更新プログラム (KB3140245) True
o 3170735 Windows 7 for x64-Based Systems 用更新プログラム (KB3170735) True
o 3161102 Windows 7 for x64-Based Systems 用更新プログラム (KB3161102) True
o 3172605 Windows 7 for x64-Based Systems 用更新プログラム (KB3172605) True
o 3179573 Windows 7 for x64-Based Systems 用更新プログラム (KB3179573) True
o 3181988 Windows 7 for x64-Based Systems 用更新プログラム (KB3181988) True
o 3184143 Windows 7 for x64-Based Systems 用更新プログラム (KB3184143) True
o 3102433 Windows 7 x64 用 Microsoft .NET Framework 4.6.1 (KB3102433) True
* 4012215 2017 年 3 月 x64 ベース システム用 Windows 7 向けセキュリティ マンスリー品質ロールアップ (KB4012215) True
o 2952664 Windows 7 for x64-Based Systems 用更新プログラム (KB2952664) True
- 4012218 2017 年 3 月 x64 ベース システム用 Windows 7 向けマンスリー品質ロールアップのプレビュー (KB4012218) False

  重要な更新: 9 個
  推奨する更新: 62 個
  適用するオプション更新: 0 個
  適用しないオプション更新: 40 個
    → 推奨する更新は適用しません


Windows Updateのダウンロード開始 2017/03/24 19:51:19

適用予定のWindows Updateのダウンロードが完了しました

Windows Updateの適用開始 2017/03/24 19:51:43
更新プログラムインストール終了コード2
*** 再起動が必要です ***
すべてのアップデートが適用されました

実行結果出力 2017/03/24 19:52:41
Windows Updateによる現在のWindows Update適用状況検索中 2017/03/24 19:52:41
実施後のWindows Update適用済み一覧(Windows Update)
  2016年 12 月 x64 用 Windows 7 および Windows Server 2008 R2 の、.NET Framework 3.5.1、4.5.2、4.6、4.6.1、4.6.2 用セキ
ュリティおよび品質ロールアップ (KB3205402)
  2017 年 3 月 x64 ベース システム用 Windows 7 向けセキュリティ マンスリー品質ロールアップ (KB4012215)
  Definition Update for Windows Defender - KB915597 (Definition 1.239.92.0)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2604115)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2656356)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2729452)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2736422)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2742599)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2789645)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2840631)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2861698)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2894844)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2911501)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2931356)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2937610)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2943357)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2968294)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2972100)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2972211)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2973112)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB2978120)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB3023215)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB3037574)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB3072305)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB3074543)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB3097989)
  Microsoft .NET Framework 3.5.1 のセキュリティ更新プログラム (x64 ベース システム用 Windows 7 および x64 ベース システ
ム用 Windows Server 2008 R2 SP1 向け) (KB3163245)
  Windows 7 for x64-based Systems の ActiveX Killbits に対する累積的なセキュリティ更新プログラム (KB2900986)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2479943)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2491683)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2506212)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2509553)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2532531)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2560656)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2564958)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2579686)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2585542)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2620704)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2621440)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2631813)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2653956)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2654428)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2667402)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2676562)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2685939)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2690533)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2698365)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2705219)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2706045)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2727528)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2758857)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2770660)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2807986)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2813430)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2840149)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2847927)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2862152)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2862330)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2862335)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2864202)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2868038)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2871997)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2884256)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2892074)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2893294)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2912390)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2957189)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2965788)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2973201)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2973351)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2977292)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2978742)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2984972)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2991963)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB2992611)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3003743)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3004361)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3004375)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3010788)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3011780)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3019978)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3021674)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3022777)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3030377)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3031432)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3035126)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3035132)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3042553)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3045685)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3046017)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3046269)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3055642)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3059317)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3060716)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3067903)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3067904)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3071756)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3075220)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3076895)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3078601)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3080446)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3084135)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3086255)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3092601)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3093513)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3101722)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3108371)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3108381)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3108664)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3108670)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3109103)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3109560)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3110329)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3115858)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3123479)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3126587)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3138910)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3139398)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3139914)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3146706)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3149090)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3150220)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3155178)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3156016)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3156017)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3156019)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3159398)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3161949)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3161958)
  Windows 7 for x64-Based Systems 用セキュリティ更新プログラム (KB3170455)
  Windows 7 for x64-Based Systems 用更新プログラム (KB2506014)
  Windows 7 for x64-Based Systems 用更新プログラム (KB2552343)
  Windows 7 for x64-Based Systems 用更新プログラム (KB2729094)
  Windows 7 for x64-Based Systems 用更新プログラム (KB2786081)
  Windows 7 for x64-Based Systems 用更新プログラム (KB2798162)
  Windows 7 for x64-Based Systems 用更新プログラム (KB2868116)
  Windows 7 for x64-Based Systems 用更新プログラム (KB2882822)
  Windows 7 for x64-Based Systems 用更新プログラム (KB2888049)
  Windows 7 for x64-Based Systems 用更新プログラム (KB2929733)
  Windows 7 for x64-Based Systems 用更新プログラム (KB3024777)
  Windows 7 for x64-Based Systems 用更新プログラム (KB3138612)
  Windows 7 for x64-Based Systems 用更新プログラム (KB3177467)
  Windows 7 x64 Edition 用プラットフォーム更新プログラム (KB2670838)
  Windows 7 および Windows Server 2008 R2 SP1 x64 の、Microsoft .NET Framework 3.5.1 用セキュリティ更新プログラム (KB312
2648)
  Windows 7 および Windows Server 2008 R2 SP1 x64 の、Microsoft .NET Framework 3.5.1 用セキュリティ更新プログラム (KB312
7220)
  Windows 7 および Windows Server 2008 R2 SP1 x64 の、Microsoft .NET Framework 3.5.1 用セキュリティ更新プログラム (KB313
5983)
  Windows 7 および Windows Server 2008 R2 SP1 x64 の、Microsoft .NET Framework 3.5.1 用セキュリティ更新プログラム (KB314
2024)
  x64 ベース システム Windows 7 用 Internet Explorer 11
  x64 ベース システム Windows 7 用 Internet Explorer 11 言語パック
  x64 ベース システムの Windows 7 および Windows Server 2008 R2 SP1 用 Microsoft .NET Framework 3.5.1 更新プログラム (KB
2836942)
  x64 ベース システムの Windows 7 および Windows Server 2008 R2 SP1 用 Microsoft .NET Framework 3.5.1 更新プログラム (KB
2836943)
  x64 ベース システム用 Windows 7 Service Pack 1 (KB976932)
  悪意のあるソフトウェアの削除ツール x64 - 2017 年 3 月 (KB890830)
  日本語パック - x64 ベース システム用の Windows 7 Service Pack 1 (KB2483139)


*** 再起動が必要です ***
Windows Update更新処理終了: 2017/03/24 20:05:42
0
PS C:\tmp>

PowerShellによるWindows Updateが0x80240023で失敗する(EULAの同意問題)

PowerShellを使って、Windows Updateを行うスクリプトを作成中。

実物はいろんな細かい細工をしているので、似たようなものを作成すると下記のようなものとなる。

$UpdateCollection = New-Object -ComObject Microsoft.Update.UpdateColl
$Session = New-Object -ComObject Microsoft.Update.Session
$Searcher = New-Object -ComObject Microsoft.Update.Searcher
$Result = $Searcher.Search("IsInstalled=0 and Type='Software'")
foreach( $Update in $Result.Updates){
    if($Update.AutoSelectOnWebSites -eq $true){
        $UpdateCollection.Add($Update) | Out-Null
    }
}

$Downloader = $Session.CreateUpdateDownloader()
$Downloader.Updates = $UpdateCollection
$DownloadResult = $Downloader.Download()

$Installer = New-Object -ComObject Microsoft.Update.Installer
$Installer.Updates = $UpdateCollection
$InstallerResult = $Installer.Install()

これをWindows7環境で実験を行った。

まず、最初は下記のエラーが出力された。

"0" 個の引数を指定して "Download" を呼び出し中に例外が発生しました: "HRESULT からの例外: 0x80240044"

これは、スクリプトを管理者権限を持たずに実行していたためで、管理者権限を与えることで回避できた。

スクリプトを実行し再起動、ということを何回か行った後、最後の1つになったところで、以下のエラーが出力された。

"0" 個の引数を指定して "Install" を呼び出し中に例外が発生しました: "HRESULT からの例外: 0x80240023"

この「0x80240023」というものは「WU_E_EULAS_DECLINED」というエラー。

適用に失敗したものは「悪意のあるソフトウェアの削除ツール x64 – 2017 年 3月 (KB890830)」

そうです。
手動で適用しようとするとライセンスの同意画面が出てくるやつです。

で・・・探してたら「Windows Update PowerShell Module」というPowerShellでWindows Updateを行うためのモジュールが・・・
ヒントを探してみるとありました。

「$Update.EulaAccepted」が0だったら「$Update.AcceptEula() 」を実行、と

というわけで、修正したものが下記になります。

$UpdateCollection = New-Object -ComObject Microsoft.Update.UpdateColl
$Session = New-Object -ComObject Microsoft.Update.Session
$Searcher = New-Object -ComObject Microsoft.Update.Searcher
$Result = $Searcher.Search("IsInstalled=0 and Type='Software'")
foreach( $Update in $Result.Updates){
    if($Update.AutoSelectOnWebSites -eq $true){
        if($Update.EulaAccepted -eq 0){
            $Update.AcceptEula()
        }
        $UpdateCollection.Add($Update) | Out-Null
    }
}

$Downloader = $Session.CreateUpdateDownloader()
$Downloader.Updates = $UpdateCollection
$DownloadResult = $Downloader.Download()

$Installer = New-Object -ComObject Microsoft.Update.Installer
$Installer.Updates = $UpdateCollection
$InstallerResult = $Installer.Install()

(2018/02/05追記)
なお、この記事は同意が必要なものについての対応法だけを記載しています。
普通にWindows Updateを行おうとした場合、ここに書いてあるものだけ適用されないパッチがあります。
そのため「Windows Updateを行うためのPowerShellスクリプト」という記事で詳細を記載しています。

CentOS7上のPowerShell Coreで使えるコマンドレット群

2018/07/06修正
PowerShell Core 6.0からSend-MailMessageが搭載されました。
CentOS7環境でもWindows環境と同じSend-MailMessageでメール送信が可能でした。

他にも違いがあるのか、以前のPowerShell Coreから何が変わったのかと、Get-Module -ListAvailableの出力結果を比較してみると、下記の違いがありました。

追加されたもの
Cmdlet Get-PfxCertificate 3.0.0.0 M
Cmdlet Get-TimeZone 3.1.0.0 M
Alias gtz -> 3.1.0.0 M
Cmdlet Remove-Alias 3.1.0.0 M
Cmdlet Send-MailMessage 3.1.0.0 M
Cmdlet Test-Connection 3.1.0.0 M
Cmdlet Test-Json 3.1.0.0 M

削除もしくはモジュールでは無くなったもの
Function AfterAll 3.3.9 P
Function AfterEach 3.3.9 P
Function Assert-MockCalled 3.3.9 P
Function Assert-VerifiableMocks 3.3.9 P
Function BeforeAll 3.3.9 P
Function BeforeEach 3.3.9 P
Function Context 3.3.9 P
Function Describe 3.3.9 P
Alias gcfg -> 0.0 P
Alias gcfgs -> 0.0 P
Function Get-MockDynamicParameters 3.3.9 P
Function Get-TestDriveItem 3.3.9 P
Alias glcm -> 0.0 P
Function HookGetViewAutoCompleter 1.21 P
Function In 3.3.9 P
Function InModuleScope 3.3.9 P
Function Invoke-Mock 3.3.9 P
Function Invoke-Pester 3.3.9 P
Function It 3.3.9 P
Function Mock 3.3.9 P
Function New-Fixture 3.3.9 P
Alias pbcfg -> 0.0 P
Alias rtcfg -> 0.0 P
Alias sacfg -> 0.0 P
Function Set-DynamicParameterVariables 3.3.9 P
Function Setup 3.3.9 P
Function Should 3.3.9 P
Alias slcm -> 0.0 P
Alias tcfg -> 0.0 P
Alias ulcm -> 0.0 P
Alias upcfg -> 0.0 P

PS /root> Get-Module -ListAvailable | % { $_.ExportedCommands.Values } | Sort-Object Name

CommandType     Name                                               Version S
 o
 u
 r
 c
 e
-----------     ----                                               -------    -
Cmdlet          Add-Content                                        3.1.0.0    M
Cmdlet          Add-Member                                         3.1.0.0    M
Function        Add-NodeKeys                                       0.0        P
Cmdlet          Add-Type                                           3.1.0.0    M
Function        AddDscResourceProperty                             0.0        P
Function        AddDscResourcePropertyFromMetadata                 0.0        P
Function        CheckResourceFound                                 0.0        P
Cmdlet          Clear-Content                                      3.1.0.0    M
Cmdlet          Clear-Item                                         3.1.0.0    M
Cmdlet          Clear-ItemProperty                                 3.1.0.0    M
Cmdlet          Clear-Variable                                     3.1.0.0    M
Cmdlet          Compare-Object                                     3.1.0.0    M
Function        Compress-Archive                                   1.1.0.0    M
Function        Configuration                                      0.0        P
Cmdlet          Convert-Path                                       3.1.0.0    M
Cmdlet          ConvertFrom-Csv                                    3.1.0.0    M
Cmdlet          ConvertFrom-Json                                   3.1.0.0    M
Cmdlet          ConvertFrom-SecureString                           3.0.0.0    M
Cmdlet          ConvertFrom-StringData                             3.1.0.0    M
Cmdlet          ConvertTo-Csv                                      3.1.0.0    M
Cmdlet          ConvertTo-Html                                     3.1.0.0    M
Cmdlet          ConvertTo-Json                                     3.1.0.0    M
Function        ConvertTo-MOFInstance                              0.0        P
Cmdlet          ConvertTo-SecureString                             3.0.0.0    M
Cmdlet          ConvertTo-Xml                                      3.1.0.0    M
Cmdlet          Copy-Item                                          3.1.0.0    M
Cmdlet          Copy-ItemProperty                                  3.1.0.0    M
Cmdlet          Debug-Process                                      3.1.0.0    M
Cmdlet          Debug-Runspace                                     3.1.0.0    M
Cmdlet          Disable-PSBreakpoint                               3.1.0.0    M
Cmdlet          Disable-RunspaceDebug                              3.1.0.0    M
Cmdlet          Enable-PSBreakpoint                                3.1.0.0    M
Cmdlet          Enable-RunspaceDebug                               3.1.0.0    M
Function        Expand-Archive                                     1.1.0.0    M
Cmdlet          Export-Alias                                       3.1.0.0    M
Cmdlet          Export-Clixml                                      3.1.0.0    M
Cmdlet          Export-Csv                                         3.1.0.0    M
Cmdlet          Export-FormatData                                  3.1.0.0    M
Cmdlet          Export-PSSession                                   3.1.0.0    M
Alias           fhx ->                                             3.1.0.0    M
Alias           fimo ->                                            1.6.0      P
Function        Find-Command                                       1.6.0      P
Function        Find-DscResource                                   1.6.0      P
Function        Find-Module                                        1.6.0      P
Cmdlet          Find-Package                                       1.1.7.0    P
Cmdlet          Find-PackageProvider                               1.1.7.0    P
Function        Find-RoleCapability                                1.6.0      P
Function        Find-Script                                        1.6.0      P
Cmdlet          Format-Custom                                      3.1.0.0    M
Cmdlet          Format-Hex                                         3.1.0.0    M
Cmdlet          Format-List                                        3.1.0.0    M
Cmdlet          Format-Table                                       3.1.0.0    M
Cmdlet          Format-Wide                                        3.1.0.0    M
Function        Generate-VersionInfo                               0.0        P
Cmdlet          Get-Alias                                          3.1.0.0    M
Cmdlet          Get-ChildItem                                      3.1.0.0    M
Function        Get-CompatibleVersionAddtionaPropertiesStr         0.0        P
Function        Get-ComplexResourceQualifier                       0.0        P
Function        Get-ConfigurationErrorCount                        0.0        P
Cmdlet          Get-Content                                        3.1.0.0    M
Cmdlet          Get-Credential                                     3.0.0.0    M
Cmdlet          Get-Culture                                        3.1.0.0    M
Cmdlet          Get-Date                                           3.1.0.0    M
Function        Get-DscResource                                    0.0        P
Function        Get-DSCResourceModules                             0.0        P
Function        Get-EncryptedPassword                              0.0        P
Cmdlet          Get-Event                                          3.1.0.0    M
Cmdlet          Get-EventSubscriber                                3.1.0.0    M
Cmdlet          Get-ExecutionPolicy                                3.0.0.0    M
Cmdlet          Get-FileHash                                       3.1.0.0    M
Cmdlet          Get-FormatData                                     3.1.0.0    M
Cmdlet          Get-Host                                           3.1.0.0    M
Function        Get-InnerMostErrorRecord                           0.0        P
Function        Get-InstalledModule                                1.6.0      P
Function        Get-InstalledScript                                1.6.0      P
Cmdlet          Get-Item                                           3.1.0.0    M
Cmdlet          Get-ItemProperty                                   3.1.0.0    M
Cmdlet          Get-ItemPropertyValue                              3.1.0.0    M
Cmdlet          Get-Location                                       3.1.0.0    M
Cmdlet          Get-Member                                         3.1.0.0    M
Function        Get-MofInstanceName                                0.0        P
Function        Get-MofInstanceText                                0.0        P
Cmdlet          Get-Package                                        1.1.7.0    P
Cmdlet          Get-PackageProvider                                1.1.7.0    P
Cmdlet          Get-PackageSource                                  1.1.7.0    P
Cmdlet          Get-PfxCertificate                                 3.0.0.0    M
Function        Get-PositionInfo                                   0.0        P
Cmdlet          Get-Process                                        3.1.0.0    M
Cmdlet          Get-PSBreakpoint                                   3.1.0.0    M
Cmdlet          Get-PSCallStack                                    3.1.0.0    M
Function        Get-PSCurrentConfigurationNode                     0.0        P
Function        Get-PSDefaultConfigurationDocument                 0.0        P
Cmdlet          Get-PSDrive                                        3.1.0.0    M
Function        Get-PSMetaConfigDocumentInstVersionInfo            0.0        P
Function        Get-PSMetaConfigurationProcessed                   0.0        P
Cmdlet          Get-PSProvider                                     3.1.0.0    M
Cmdlet          Get-PSReadlineKeyHandler                           1.2        P
Cmdlet          Get-PSReadlineOption                               1.2        P
Function        Get-PSRepository                                   1.6.0      P
Function        Get-PSTopConfigurationName                         0.0        P
Function        Get-PublicKeyFromFile                              0.0        P
Function        Get-PublicKeyFromStore                             0.0        P
Cmdlet          Get-Random                                         3.1.0.0    M
Cmdlet          Get-Runspace                                       3.1.0.0    M
Cmdlet          Get-RunspaceDebug                                  3.1.0.0    M
Cmdlet          Get-TimeZone                                       3.1.0.0    M
Cmdlet          Get-TraceSource                                    3.1.0.0    M
Cmdlet          Get-TypeData                                       3.1.0.0    M
Cmdlet          Get-UICulture                                      3.1.0.0    M
Cmdlet          Get-Unique                                         3.1.0.0    M
Cmdlet          Get-Uptime                                         3.1.0.0    M
Cmdlet          Get-Variable                                       3.1.0.0    M
Cmdlet          Get-Verb                                           3.1.0.0    M
Function        GetCompositeResource                               0.0        P
Function        GetImplementingModulePath                          0.0        P
Function        GetModule                                          0.0        P
Function        GetPatterns                                        0.0        P
Function        GetResourceFromKeyword                             0.0        P
Function        GetSyntax                                          0.0        P
Cmdlet          Group-Object                                       3.1.0.0    M
Alias           gtz ->                                             3.1.0.0    M
Cmdlet          Import-Alias                                       3.1.0.0    M
Cmdlet          Import-Clixml                                      3.1.0.0    M
Cmdlet          Import-Csv                                         3.1.0.0    M
Cmdlet          Import-LocalizedData                               3.1.0.0    M
Cmdlet          Import-PackageProvider                             1.1.7.0    P
Function        Import-PowerShellDataFile                          3.1.0.0    M
Cmdlet          Import-PSSession                                   3.1.0.0    M
Function        ImportCimAndScriptKeywordsFromModule               0.0        P
Function        ImportClassResourcesFromModule                     0.0        P
Function        Initialize-ConfigurationRuntimeState               0.0        P
Alias           inmo ->                                            1.6.0      P
Function        Install-Module                                     1.6.0      P
Cmdlet          Install-Package                                    1.1.7.0    P
Cmdlet          Install-PackageProvider                            1.1.7.0    P
Function        Install-Script                                     1.6.0      P
Cmdlet          Invoke-Expression                                  3.1.0.0    M
Cmdlet          Invoke-Item                                        3.1.0.0    M
Cmdlet          Invoke-RestMethod                                  3.1.0.0    M
Cmdlet          Invoke-WebRequest                                  3.1.0.0    M
Function        IsHiddenResource                                   0.0        P
Function        IsPatternMatched                                   0.0        P
Cmdlet          Join-Path                                          3.1.0.0    M
Cmdlet          Measure-Command                                    3.1.0.0    M
Cmdlet          Measure-Object                                     3.1.0.0    M
Cmdlet          Move-Item                                          3.1.0.0    M
Cmdlet          Move-ItemProperty                                  3.1.0.0    M
Cmdlet          New-Alias                                          3.1.0.0    M
Function        New-DscChecksum                                    0.0        P
Cmdlet          New-Event                                          3.1.0.0    M
Cmdlet          New-Guid                                           3.1.0.0    M
Cmdlet          New-Item                                           3.1.0.0    M
Cmdlet          New-ItemProperty                                   3.1.0.0    M
Cmdlet          New-Object                                         3.1.0.0    M
Cmdlet          New-PSDrive                                        3.1.0.0    M
Function        New-ScriptFileInfo                                 1.6.0      P
Cmdlet          New-TemporaryFile                                  3.1.0.0    M
Cmdlet          New-TimeSpan                                       3.1.0.0    M
Cmdlet          New-Variable                                       3.1.0.0    M
Function        Node                                               0.0        P
Cmdlet          Out-File                                           3.1.0.0    M
Cmdlet          Out-String                                         3.1.0.0    M
Cmdlet          Pop-Location                                       3.1.0.0    M
Function        PSConsoleHostReadline                              1.2        P
Function        Publish-Module                                     1.6.0      P
Function        Publish-Script                                     1.6.0      P
Alias           pumo ->                                            1.6.0      P
Cmdlet          Push-Location                                      3.1.0.0    M
Cmdlet          Read-Host                                          3.1.0.0    M
Function        ReadEnvironmentFile                                0.0        P
Cmdlet          Register-EngineEvent                               3.1.0.0    M
Cmdlet          Register-ObjectEvent                               3.1.0.0    M
Cmdlet          Register-PackageSource                             1.1.7.0    P
Function        Register-PSRepository                              1.6.0      P
Cmdlet          Remove-Alias                                       3.1.0.0    M
Cmdlet          Remove-Event                                       3.1.0.0    M
Cmdlet          Remove-Item                                        3.1.0.0    M
Cmdlet          Remove-ItemProperty                                3.1.0.0    M
Cmdlet          Remove-PSBreakpoint                                3.1.0.0    M
Cmdlet          Remove-PSDrive                                     3.1.0.0    M
Cmdlet          Remove-PSReadlineKeyHandler                        1.2        P
Cmdlet          Remove-TypeData                                    3.1.0.0    M
Cmdlet          Remove-Variable                                    3.1.0.0    M
Cmdlet          Rename-Item                                        3.1.0.0    M
Cmdlet          Rename-ItemProperty                                3.1.0.0    M
Cmdlet          Resolve-Path                                       3.1.0.0    M
Function        Save-Module                                        1.6.0      P
Cmdlet          Save-Package                                       1.1.7.0    P
Function        Save-Script                                        1.6.0      P
Cmdlet          Select-Object                                      3.1.0.0    M
Cmdlet          Select-String                                      3.1.0.0    M
Cmdlet          Select-Xml                                         3.1.0.0    M
Cmdlet          Send-MailMessage                                   3.1.0.0    M
Cmdlet          Set-Alias                                          3.1.0.0    M
Cmdlet          Set-Content                                        3.1.0.0    M
Cmdlet          Set-Date                                           3.1.0.0    M
Cmdlet          Set-ExecutionPolicy                                3.0.0.0    M
Cmdlet          Set-Item                                           3.1.0.0    M
Cmdlet          Set-ItemProperty                                   3.1.0.0    M
Cmdlet          Set-Location                                       3.1.0.0    M
Function        Set-NodeExclusiveResources                         0.0        P
Function        Set-NodeManager                                    0.0        P
Function        Set-NodeResources                                  0.0        P
Function        Set-NodeResourceSource                             0.0        P
Cmdlet          Set-PackageSource                                  1.1.7.0    P
Cmdlet          Set-PSBreakpoint                                   3.1.0.0    M
Function        Set-PSCurrentConfigurationNode                     0.0        P
Function        Set-PSDefaultConfigurationDocument                 0.0        P
Function        Set-PSMetaConfigDocInsProcessedBeforeMeta          0.0        P
Function        Set-PSMetaConfigVersionInfoV2                      0.0        P
Cmdlet          Set-PSReadlineKeyHandler                           1.2        P
Cmdlet          Set-PSReadlineOption                               1.2        P
Function        Set-PSRepository                                   1.6.0      P
Function        Set-PSTopConfigurationName                         0.0        P
Cmdlet          Set-TraceSource                                    3.1.0.0    M
Cmdlet          Set-Variable                                       3.1.0.0    M
Cmdlet          Sort-Object                                        3.1.0.0    M
Cmdlet          Split-Path                                         3.1.0.0    M
Cmdlet          Start-Process                                      3.1.0.0    M
Cmdlet          Start-Sleep                                        3.1.0.0    M
Cmdlet          Start-Transcript                                   3.0.0.0    M
Cmdlet          Stop-Process                                       3.1.0.0    M
Cmdlet          Stop-Transcript                                    3.0.0.0    M
Function        StrongConnect                                      0.0        P
Cmdlet          Tee-Object                                         3.1.0.0    M
Function        Test-ConflictingResources                          0.0        P
Cmdlet          Test-Connection                                    3.1.0.0    M
Cmdlet          Test-Json                                          3.1.0.0    M
Function        Test-ModuleReloadRequired                          0.0        P
Function        Test-MofInstanceText                               0.0        P
Function        Test-NodeManager                                   0.0        P
Function        Test-NodeResources                                 0.0        P
Function        Test-NodeResourceSource                            0.0        P
Cmdlet          Test-Path                                          3.1.0.0    M
Function        Test-ScriptFileInfo                                1.6.0      P
Function        ThrowError                                         0.0        P
Cmdlet          Trace-Command                                      3.1.0.0    M
Function        Uninstall-Module                                   1.6.0      P
Cmdlet          Uninstall-Package                                  1.1.7.0    P
Function        Uninstall-Script                                   1.6.0      P
Cmdlet          Unregister-Event                                   3.1.0.0    M
Cmdlet          Unregister-PackageSource                           1.1.7.0    P
Function        Unregister-PSRepository                            1.6.0      P
Function        Update-ConfigurationDocumentRef                    0.0        P
Function        Update-ConfigurationErrorCount                     0.0        P
Function        Update-DependsOn                                   0.0        P
Cmdlet          Update-FormatData                                  3.1.0.0    M
Function        Update-LocalConfigManager                          0.0        P
Function        Update-Module                                      1.6.0      P
Function        Update-ModuleManifest                              1.6.0      P
Function        Update-ModuleVersion                               0.0        P
Function        Update-Script                                      1.6.0      P
Function        Update-ScriptFileInfo                              1.6.0      P
Cmdlet          Update-TypeData                                    3.1.0.0    M
Alias           upmo ->                                            1.6.0      P
Function        ValidateNoCircleInNodeResources                    0.0        P
Function        ValidateNodeExclusiveResources                     0.0        P
Function        ValidateNodeManager                                0.0        P
Function        ValidateNodeResources                              0.0        P
Function        ValidateNodeResourceSource                         0.0        P
Function        ValidateNoNameNodeResources                        0.0        P
Function        ValidateUpdate-ConfigurationData                   0.0        P
Cmdlet          Wait-Debugger                                      3.1.0.0    M
Cmdlet          Wait-Event                                         3.1.0.0    M
Cmdlet          Wait-Process                                       3.1.0.0    M
Cmdlet          Write-Debug                                        3.1.0.0    M
Cmdlet          Write-Error                                        3.1.0.0    M
Cmdlet          Write-Host                                         3.1.0.0    M
Cmdlet          Write-Information                                  3.1.0.0    M
Function        Write-Log                                          0.0        P
Function        Write-MetaConfigFile                               0.0        P
Function        Write-NodeMOFFile                                  0.0        P
Cmdlet          Write-Output                                       3.1.0.0    M
Cmdlet          Write-Progress                                     3.1.0.0    M
Cmdlet          Write-Verbose                                      3.1.0.0    M
Cmdlet          Write-Warning                                      3.1.0.0    M
Function        WriteFile                                          0.0        P
PS /root>

以下は2017/02/27時点の内容


CentOS7上で使えるPowerShell Coreでメールを送ろうとした。

スクリプトは「PowerShellを使って日本語メールを送信する方法(v2.0も対応する版)」で使ったものを使用・・・

しかし、Send-MailMessageが存在せず、メール送信に失敗した。

PS /root> Send-MailMessage
Send-MailMessage : The term 'Send-MailMessage' is not recognized as the name of
 a cmdlet, function, script file, or operable program. Check the spelling of th
e name, or if a path was included, verify that the path is correct and try agai
n.
At line:1 char:1
+ Send-MailMessage
+ ~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Send-MailMessage:String) [], Co
   mmandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS /root>

どうやら、使えないコマンドレットがそこそこあるようなんだけど、具体的に何なら使えるのかを書いてあるところを見つけられなかった。

しかし、「Get-Module」で取得できるモジュール情報の「ExportedCommands」には、そのモジュールで提供されているコマンドレット/関数一覧がある。
そこで、PowerShell Core環境で用意されているPowerShellでは、どのようなコマンドレットが使えるのか、リストアップしてみた。

PS /root> Get-Module -ListAvailable | % { $_.ExportedCommands.Values } | Sort-Object Name

CommandType     Name                                               Version    S
                                                                              o
                                                                              u
                                                                              r
                                                                              c
                                                                              e
-----------     ----                                               -------    -
Cmdlet          Add-Content                                        3.1.0.0    M
Cmdlet          Add-Member                                         3.1.0.0    M
Function        Add-NodeKeys                                       0.0        P
Cmdlet          Add-Type                                           3.1.0.0    M
Function        AddDscResourceProperty                             0.0        P
Function        AddDscResourcePropertyFromMetadata                 0.0        P
Function        AfterAll                                           3.3.9      P
Function        AfterEach                                          3.3.9      P
Function        Assert-MockCalled                                  3.3.9      P
Function        Assert-VerifiableMocks                             3.3.9      P
Function        BeforeAll                                          3.3.9      P
Function        BeforeEach                                         3.3.9      P
Function        CheckResourceFound                                 0.0        P
Cmdlet          Clear-Content                                      3.1.0.0    M
Cmdlet          Clear-Item                                         3.1.0.0    M
Cmdlet          Clear-ItemProperty                                 3.1.0.0    M
Cmdlet          Clear-Variable                                     3.1.0.0    M
Cmdlet          Compare-Object                                     3.1.0.0    M
Function        Compress-Archive                                   1.0.1.0    M
Function        Configuration                                      0.0        P
Function        Context                                            3.3.9      P
Cmdlet          Convert-Path                                       3.1.0.0    M
Cmdlet          ConvertFrom-Csv                                    3.1.0.0    M
Cmdlet          ConvertFrom-Json                                   3.1.0.0    M
Cmdlet          ConvertFrom-SecureString                           3.0.0.0    M
Cmdlet          ConvertFrom-StringData                             3.1.0.0    M
Cmdlet          ConvertTo-Csv                                      3.1.0.0    M
Cmdlet          ConvertTo-Html                                     3.1.0.0    M
Cmdlet          ConvertTo-Json                                     3.1.0.0    M
Function        ConvertTo-MOFInstance                              0.0        P
Cmdlet          ConvertTo-SecureString                             3.0.0.0    M
Cmdlet          ConvertTo-Xml                                      3.1.0.0    M
Cmdlet          Copy-Item                                          3.1.0.0    M
Cmdlet          Copy-ItemProperty                                  3.1.0.0    M
Cmdlet          Debug-Process                                      3.1.0.0    M
Cmdlet          Debug-Runspace                                     3.1.0.0    M
Function        Describe                                           3.3.9      P
Cmdlet          Disable-PSBreakpoint                               3.1.0.0    M
Cmdlet          Disable-RunspaceDebug                              3.1.0.0    M
Cmdlet          Enable-PSBreakpoint                                3.1.0.0    M
Cmdlet          Enable-RunspaceDebug                               3.1.0.0    M
Function        Expand-Archive                                     1.0.1.0    M
Cmdlet          Export-Alias                                       3.1.0.0    M
Cmdlet          Export-Clixml                                      3.1.0.0    M
Cmdlet          Export-Csv                                         3.1.0.0    M
Cmdlet          Export-FormatData                                  3.1.0.0    M
Cmdlet          Export-PSSession                                   3.1.0.0    M
Alias           fhx ->                                             3.1.0.0    M
Alias           fimo ->                                            1.1.2.0    P
Function        Find-Command                                       1.1.2.0    P
Function        Find-DscResource                                   1.1.2.0    P
Function        Find-Module                                        1.1.2.0    P
Cmdlet          Find-Package                                       1.1.2.0    P
Cmdlet          Find-PackageProvider                               1.1.2.0    P
Function        Find-RoleCapability                                1.1.2.0    P
Function        Find-Script                                        1.1.2.0    P
Cmdlet          Format-Custom                                      3.1.0.0    M
Function        Format-Hex                                         3.1.0.0    M
Cmdlet          Format-List                                        3.1.0.0    M
Cmdlet          Format-Table                                       3.1.0.0    M
Cmdlet          Format-Wide                                        3.1.0.0    M
Alias           gcfg ->                                            0.0        P
Alias           gcfgs ->                                           0.0        P
Function        Generate-VersionInfo                               0.0        P
Cmdlet          Get-Alias                                          3.1.0.0    M
Cmdlet          Get-ChildItem                                      3.1.0.0    M
Function        Get-CompatibleVersionAddtionaPropertiesStr         0.0        P
Function        Get-ComplexResourceQualifier                       0.0        P
Function        Get-ConfigurationErrorCount                        0.0        P
Cmdlet          Get-Content                                        3.1.0.0    M
Cmdlet          Get-Credential                                     3.0.0.0    M
Cmdlet          Get-Culture                                        3.1.0.0    M
Cmdlet          Get-Date                                           3.1.0.0    M
Function        Get-DscResource                                    0.0        P
Function        Get-DSCResourceModules                             0.0        P
Function        Get-EncryptedPassword                              0.0        P
Cmdlet          Get-Event                                          3.1.0.0    M
Cmdlet          Get-EventSubscriber                                3.1.0.0    M
Cmdlet          Get-ExecutionPolicy                                3.0.0.0    M
Cmdlet          Get-FileHash                                       3.1.0.0    M
Cmdlet          Get-FormatData                                     3.1.0.0    M
Cmdlet          Get-Host                                           3.1.0.0    M
Function        Get-InnerMostErrorRecord                           0.0        P
Function        Get-InstalledModule                                1.1.2.0    P
Function        Get-InstalledScript                                1.1.2.0    P
Cmdlet          Get-Item                                           3.1.0.0    M
Cmdlet          Get-ItemProperty                                   3.1.0.0    M
Cmdlet          Get-ItemPropertyValue                              3.1.0.0    M
Cmdlet          Get-Location                                       3.1.0.0    M
Cmdlet          Get-Member                                         3.1.0.0    M
Function        Get-MockDynamicParameters                          3.3.9      P
Function        Get-MofInstanceName                                0.0        P
Function        Get-MofInstanceText                                0.0        P
Cmdlet          Get-Package                                        1.1.2.0    P
Cmdlet          Get-PackageProvider                                1.1.2.0    P
Cmdlet          Get-PackageSource                                  1.1.2.0    P
Function        Get-PositionInfo                                   0.0        P
Cmdlet          Get-Process                                        3.1.0.0    M
Cmdlet          Get-PSBreakpoint                                   3.1.0.0    M
Cmdlet          Get-PSCallStack                                    3.1.0.0    M
Function        Get-PSCurrentConfigurationNode                     0.0        P
Function        Get-PSDefaultConfigurationDocument                 0.0        P
Cmdlet          Get-PSDrive                                        3.1.0.0    M
Function        Get-PSMetaConfigDocumentInstVersionInfo            0.0        P
Function        Get-PSMetaConfigurationProcessed                   0.0        P
Cmdlet          Get-PSProvider                                     3.1.0.0    M
Cmdlet          Get-PSReadlineKeyHandler                           1.2        P
Cmdlet          Get-PSReadlineOption                               1.2        P
Function        Get-PSRepository                                   1.1.2.0    P
Function        Get-PSTopConfigurationName                         0.0        P
Function        Get-PublicKeyFromFile                              0.0        P
Function        Get-PublicKeyFromStore                             0.0        P
Cmdlet          Get-Random                                         3.1.0.0    M
Cmdlet          Get-Runspace                                       3.1.0.0    M
Cmdlet          Get-RunspaceDebug                                  3.1.0.0    M
Function        Get-TestDriveItem                                  3.3.9      P
Cmdlet          Get-TraceSource                                    3.1.0.0    M
Cmdlet          Get-TypeData                                       3.1.0.0    M
Cmdlet          Get-UICulture                                      3.1.0.0    M
Cmdlet          Get-Unique                                         3.1.0.0    M
Cmdlet          Get-Uptime                                         3.1.0.0    M
Cmdlet          Get-Variable                                       3.1.0.0    M
Cmdlet          Get-Verb                                           3.1.0.0    M
Function        GetCompositeResource                               0.0        P
Function        GetImplementingModulePath                          0.0        P
Function        GetModule                                          0.0        P
Function        GetPatterns                                        0.0        P
Function        GetResourceFromKeyword                             0.0        P
Function        GetSyntax                                          0.0        P
Alias           glcm ->                                            0.0        P
Cmdlet          Group-Object                                       3.1.0.0    M
Function        HookGetViewAutoCompleter                           1.21       P
Cmdlet          Import-Alias                                       3.1.0.0    M
Cmdlet          Import-Clixml                                      3.1.0.0    M
Cmdlet          Import-Csv                                         3.1.0.0    M
Cmdlet          Import-LocalizedData                               3.1.0.0    M
Cmdlet          Import-PackageProvider                             1.1.2.0    P
Function        Import-PowerShellDataFile                          3.1.0.0    M
Cmdlet          Import-PSSession                                   3.1.0.0    M
Function        ImportCimAndScriptKeywordsFromModule               0.0        P
Function        ImportClassResourcesFromModule                     0.0        P
Function        In                                                 3.3.9      P
Function        Initialize-ConfigurationRuntimeState               0.0        P
Alias           inmo ->                                            1.1.2.0    P
Function        InModuleScope                                      3.3.9      P
Function        Install-Module                                     1.1.2.0    P
Cmdlet          Install-Package                                    1.1.2.0    P
Cmdlet          Install-PackageProvider                            1.1.2.0    P
Function        Install-Script                                     1.1.2.0    P
Cmdlet          Invoke-Expression                                  3.1.0.0    M
Cmdlet          Invoke-Item                                        3.1.0.0    M
Function        Invoke-Mock                                        3.3.9      P
Function        Invoke-Pester                                      3.3.9      P
Cmdlet          Invoke-RestMethod                                  3.1.0.0    M
Cmdlet          Invoke-WebRequest                                  3.1.0.0    M
Function        IsHiddenResource                                   0.0        P
Function        IsPatternMatched                                   0.0        P
Function        It                                                 3.3.9      P
Cmdlet          Join-Path                                          3.1.0.0    M
Cmdlet          Measure-Command                                    3.1.0.0    M
Cmdlet          Measure-Object                                     3.1.0.0    M
Function        Mock                                               3.3.9      P
Cmdlet          Move-Item                                          3.1.0.0    M
Cmdlet          Move-ItemProperty                                  3.1.0.0    M
Cmdlet          New-Alias                                          3.1.0.0    M
Function        New-DscChecksum                                    0.0        P
Cmdlet          New-Event                                          3.1.0.0    M
Function        New-Fixture                                        3.3.9      P
Cmdlet          New-Guid                                           3.1.0.0    M
Cmdlet          New-Item                                           3.1.0.0    M
Cmdlet          New-ItemProperty                                   3.1.0.0    M
Cmdlet          New-Object                                         3.1.0.0    M
Cmdlet          New-PSDrive                                        3.1.0.0    M
Function        New-ScriptFileInfo                                 1.1.2.0    P
Cmdlet          New-TemporaryFile                                  3.1.0.0    M
Cmdlet          New-TimeSpan                                       3.1.0.0    M
Cmdlet          New-Variable                                       3.1.0.0    M
Function        Node                                               0.0        P
Cmdlet          Out-File                                           3.1.0.0    M
Cmdlet          Out-String                                         3.1.0.0    M
Alias           pbcfg ->                                           0.0        P
Cmdlet          Pop-Location                                       3.1.0.0    M
Function        PSConsoleHostReadline                              1.2        P
Function        Publish-Module                                     1.1.2.0    P
Function        Publish-Script                                     1.1.2.0    P
Alias           pumo ->                                            1.1.2.0    P
Cmdlet          Push-Location                                      3.1.0.0    M
Cmdlet          Read-Host                                          3.1.0.0    M
Function        ReadEnvironmentFile                                0.0        P
Cmdlet          Register-EngineEvent                               3.1.0.0    M
Cmdlet          Register-ObjectEvent                               3.1.0.0    M
Cmdlet          Register-PackageSource                             1.1.2.0    P
Function        Register-PSRepository                              1.1.2.0    P
Cmdlet          Remove-Event                                       3.1.0.0    M
Cmdlet          Remove-Item                                        3.1.0.0    M
Cmdlet          Remove-ItemProperty                                3.1.0.0    M
Cmdlet          Remove-PSBreakpoint                                3.1.0.0    M
Cmdlet          Remove-PSDrive                                     3.1.0.0    M
Cmdlet          Remove-PSReadlineKeyHandler                        1.2        P
Cmdlet          Remove-TypeData                                    3.1.0.0    M
Cmdlet          Remove-Variable                                    3.1.0.0    M
Cmdlet          Rename-Item                                        3.1.0.0    M
Cmdlet          Rename-ItemProperty                                3.1.0.0    M
Cmdlet          Resolve-Path                                       3.1.0.0    M
Alias           rtcfg ->                                           0.0        P
Alias           sacfg ->                                           0.0        P
Function        Save-Module                                        1.1.2.0    P
Cmdlet          Save-Package                                       1.1.2.0    P
Function        Save-Script                                        1.1.2.0    P
Cmdlet          Select-Object                                      3.1.0.0    M
Cmdlet          Select-String                                      3.1.0.0    M
Cmdlet          Select-Xml                                         3.1.0.0    M
Cmdlet          Set-Alias                                          3.1.0.0    M
Cmdlet          Set-Content                                        3.1.0.0    M
Cmdlet          Set-Date                                           3.1.0.0    M
Function        Set-DynamicParameterVariables                      3.3.9      P
Cmdlet          Set-ExecutionPolicy                                3.0.0.0    M
Cmdlet          Set-Item                                           3.1.0.0    M
Cmdlet          Set-ItemProperty                                   3.1.0.0    M
Cmdlet          Set-Location                                       3.1.0.0    M
Function        Set-NodeExclusiveResources                         0.0        P
Function        Set-NodeManager                                    0.0        P
Function        Set-NodeResources                                  0.0        P
Function        Set-NodeResourceSource                             0.0        P
Cmdlet          Set-PackageSource                                  1.1.2.0    P
Cmdlet          Set-PSBreakpoint                                   3.1.0.0    M
Function        Set-PSCurrentConfigurationNode                     0.0        P
Function        Set-PSDefaultConfigurationDocument                 0.0        P
Function        Set-PSMetaConfigDocInsProcessedBeforeMeta          0.0        P
Function        Set-PSMetaConfigVersionInfoV2                      0.0        P
Cmdlet          Set-PSReadlineKeyHandler                           1.2        P
Cmdlet          Set-PSReadlineOption                               1.2        P
Function        Set-PSRepository                                   1.1.2.0    P
Function        Set-PSTopConfigurationName                         0.0        P
Cmdlet          Set-TraceSource                                    3.1.0.0    M
Cmdlet          Set-Variable                                       3.1.0.0    M
Function        Setup                                              3.3.9      P
Function        Should                                             3.3.9      P
Alias           slcm ->                                            0.0        P
Cmdlet          Sort-Object                                        3.1.0.0    M
Cmdlet          Split-Path                                         3.1.0.0    M
Cmdlet          Start-Process                                      3.1.0.0    M
Cmdlet          Start-Sleep                                        3.1.0.0    M
Cmdlet          Start-Transcript                                   3.0.0.0    M
Cmdlet          Stop-Process                                       3.1.0.0    M
Cmdlet          Stop-Transcript                                    3.0.0.0    M
Function        StrongConnect                                      0.0        P
Alias           tcfg ->                                            0.0        P
Cmdlet          Tee-Object                                         3.1.0.0    M
Function        Test-ConflictingResources                          0.0        P
Function        Test-ModuleReloadRequired                          0.0        P
Function        Test-MofInstanceText                               0.0        P
Function        Test-NodeManager                                   0.0        P
Function        Test-NodeResources                                 0.0        P
Function        Test-NodeResourceSource                            0.0        P
Cmdlet          Test-Path                                          3.1.0.0    M
Function        Test-ScriptFileInfo                                1.1.2.0    P
Function        ThrowError                                         0.0        P
Cmdlet          Trace-Command                                      3.1.0.0    M
Alias           ulcm ->                                            0.0        P
Function        Uninstall-Module                                   1.1.2.0    P
Cmdlet          Uninstall-Package                                  1.1.2.0    P
Function        Uninstall-Script                                   1.1.2.0    P
Cmdlet          Unregister-Event                                   3.1.0.0    M
Cmdlet          Unregister-PackageSource                           1.1.2.0    P
Function        Unregister-PSRepository                            1.1.2.0    P
Alias           upcfg ->                                           0.0        P
Function        Update-ConfigurationDocumentRef                    0.0        P
Function        Update-ConfigurationErrorCount                     0.0        P
Function        Update-DependsOn                                   0.0        P
Cmdlet          Update-FormatData                                  3.1.0.0    M
Function        Update-LocalConfigManager                          0.0        P
Function        Update-Module                                      1.1.2.0    P
Function        Update-ModuleManifest                              1.1.2.0    P
Function        Update-ModuleVersion                               0.0        P
Function        Update-Script                                      1.1.2.0    P
Function        Update-ScriptFileInfo                              1.1.2.0    P
Cmdlet          Update-TypeData                                    3.1.0.0    M
Alias           upmo ->                                            1.1.2.0    P
Function        ValidateNoCircleInNodeResources                    0.0        P
Function        ValidateNodeExclusiveResources                     0.0        P
Function        ValidateNodeManager                                0.0        P
Function        ValidateNodeResources                              0.0        P
Function        ValidateNodeResourceSource                         0.0        P
Function        ValidateNoNameNodeResources                        0.0        P
Function        ValidateUpdate-ConfigurationData                   0.0        P
Cmdlet          Wait-Debugger                                      3.1.0.0    M
Cmdlet          Wait-Event                                         3.1.0.0    M
Cmdlet          Wait-Process                                       3.1.0.0    M
Cmdlet          Write-Debug                                        3.1.0.0    M
Cmdlet          Write-Error                                        3.1.0.0    M
Cmdlet          Write-Host                                         3.1.0.0    M
Cmdlet          Write-Information                                  3.1.0.0    M
Function        Write-Log                                          0.0        P
Function        Write-MetaConfigFile                               0.0        P
Function        Write-NodeMOFFile                                  0.0        P
Cmdlet          Write-Output                                       3.1.0.0    M
Cmdlet          Write-Progress                                     3.1.0.0    M
Cmdlet          Write-Verbose                                      3.1.0.0    M
Cmdlet          Write-Warning                                      3.1.0.0    M
Function        WriteFile                                          0.0        P


PS /root>

PowerCLIとPowerCLI Coreの双方で動くPowerShellスクリプトの作り方

2018/07/06追記

PowerCLI Coreが無くなり、VMware PowerCLI本体の方でPowerShell Coreへの対応が行われるようになった結果、ここに書いたようなモジュール名の使い分けが不要になりました。
詳細は「CentOS7環境にPowerShell CoreとVMware PowerCLIをインストール」に記載しました。


Windows環境以外でも、動作するようになったPowerShellと、VMware PowerCLI
(Power Shell Core 6.0をCentOS7で使ってみる)
(Linux上のPowerShellでvSphereの操作を行うPowerCLI Coreを試す+CentOS7で使うための回避策)

いままで作ったPowerCLI用のスクリプトを使おうとして問題発覚。

PowerCLIモジュールを「Import-Module -Name VMware.VimAutomation.Core」で読み込ませていたのだが、PowerCLI Coreではモジュール名が「PowerCLI.ViCore」に変更されていた。

また、PoweCLI Coreの手順だと、モジュール名を特定しなくとも、条件にあてはまるものを全て読み込む、ということができるやり方が提示されていた。

そこで、PowerCLIとPowerCLI Coreのどちらでも、関連モジュールを全て読み込むような記述を考えて作成した。

Write-Host "初期のモジュール読み込み状況"
Get-Module
Write-Host ""

# Windows用PowerCLIがインストールされているか?
$modulelist=Get-Module -ListAvailable VMware.Vim*
if($modulelist -eq $null){
	# modulelist Coreがインストールされているか?
	$modulelist=Get-Module -ListAvailable PowerCLI*
}
if($modulelist -eq $null){
	Write-Host "PowerCLIがインストールされていません"
	exit 1
}
$modulelist | Import-Module
Write-Host ""
Write-Host "現在のモジュール読み込み状況"
Get-Module

Windows環境での実行結果

PS C:\tmp> .\importmodule.ps1
初期のモジュール読み込み状況

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Manifest   3.1.0.0    Microsoft.PowerShell.Management     {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Con...
Manifest   3.1.0.0    Microsoft.PowerShell.Utility        {Add-Member, Add-Type, Clear-Variable, Compare-Object...}


現在のモジュール読み込み状況
Script     0.0        Initialize-VMware.VimAutomation....
Script     0.0        Initialize-VMware.VimAutomation....
Script     0.0        Initialize-VMware_VimAutomation_Cis
Manifest   3.1.0.0    Microsoft.PowerShell.Management     {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Con...
Manifest   3.1.0.0    Microsoft.PowerShell.Utility        {Add-Member, Add-Type, Clear-Variable, Compare-Object...}
Binary     6.5.0.4... VMware.VimAutomation.Cis.Core       {Connect-CisServer, Disconnect-CisServer, Get-CisService}
Manifest   6.5.0.4... VMware.VimAutomation.Common
Binary     6.5.0.2... VMware.VimAutomation.Core           {Add-PassthroughDevice, Add-VirtualSwitchPhysicalNetworkAd...
Binary     6.0.0.0    VMware.VimAutomation.HA             Get-DrmInfo
Binary     6.5.0.4... VMware.VimAutomation.License        Get-LicenseDataManager
Manifest   6.5.0.4... VMware.VimAutomation.Sdk            Get-PSVersion
Binary     6.5.0.4... VMware.VimAutomation.Storage        {Copy-VDisk, Export-SpbmStoragePolicy, Get-NfsUser, Get-Sp...
Binary     6.5.0.4... VMware.VimAutomation.Vds            {Add-VDSwitchPhysicalNetworkAdapter, Add-VDSwitchVMHost, E...
Binary     6.5.0.4... VMware.VimAutomation.vROps          {Connect-OMServer, Disconnect-OMServer, Get-OMAlert, Get-O...


 C:\tmp>

CentOS7環境での実行例

# cat importmodule.ps1 |powershell
PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.

PS /root> Write-Host "初期のモジュール読み込み状況"
初期のモジュール読み込み状況
PS /root> Get-Module

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Manifest   3.1.0.0    Microsoft.PowerShell.Utility        {Add-Member, Add-T...
Script     1.2        PSReadLine                          {Get-PSReadlineKey...


PS /root> Write-Host ""

PS /root>
PS /root> # Windows用PowerCLIがインストールされているか?
PS /root> $modulelist=Get-Module -ListAvailable VMware.Vim*
PS /root> if($modulelist -eq $null){
>>      # modulelist Coreがインストールされているか?
>>      $modulelist=Get-Module -ListAvailable PowerCLI*
>> }
>> if($modulelist -eq $null){
>>      Write-Host "PowerCLIがインストールされていません"
>>      exit 1
>> }
>> $modulelist | Import-Module
>> Write-Host ""
>> Write-Host "現在のモジュール読み込み状況"
>> Get-Module
>>

現在のモジュール読み込み状況

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     0.0        Initialize
Script     0.0        Initialize-VMware_VimAutomation_Vds
Manifest   3.1.0.0    Microsoft.PowerShell.Management     {Add-Content, Clea...
Manifest   3.1.0.0    Microsoft.PowerShell.Utility        {Add-Member, Add-T...
Binary     1.21       PowerCLI.Vds                        {Add-VDSwitchPhysi...
Binary     1.21       PowerCLI.ViCore                     {Add-PassthroughDe...
Script     1.2        PSReadLine                          {Get-PSReadlineKey...


PS /root> #

Linux上のPowerShellでvSphereの操作を行うPowerCLI Coreを試す+CentOS7で使うための回避策

2018/07/06追記

PowerCLI Coreが無くなり、VMware PowerCLI本体の方でPowerShell Coreへの対応が行われるようになり、
RHEL7/CentOS7にも正式に対応したので、手順がだいぶ変わりました。
詳細は「CentOS7環境にPowerShell CoreとVMware PowerCLIをインストール」に記載しました。


2018/05/25 追記

時々アクセスがあるので、2018/05/25時点での状況を書いておきます。
・PowerCLIの公式ページは「https://code.vmware.com/web/dp/tool/vmware-powercli/
・PowerCLI Coreという単品はなくなり、PowerCLI本体でPowerShellとPowerShell Core双方に対応します。
・インストーラーによる配布はなくなり、「PowerShell Galleryでの配布」になりました。
PowerShellGalleryPowerShellGet moduleがインストールされている環境では「Install-Module -Name VMware.PowerCLI」を実行するだけでダウンロード&インストールを行います。
・PowerShell Core 6では標準でPowerShellGet moduleがインストールされているので、コマンドを実行するだけでした。
・パッケージ名は「VMware.PowerCLI」です。パッケージのインストール状況を確認する場合は「Get-Module -ListAvailable VMware*」でやります。


(以下、過去記事)
先日、インストールしてみたPowerShell Core(Power Shell Core 6.0をCentOS7で使ってみる)。

これ、もしかして、vSphere環境の操作を行うVMware PowerCLIが動かないかな?と思って調べてみると、開発中の「PowerCLI Core」というのがあるのを発見。

「October 17, 2016 v1.0」版では、かなりサポート範囲が狭い。まさに「Core」

Module Description PowerCLI for Windows PowerCLI Core
Core vCenter and ESXi Cmdlets
VDS vSphere Distributed Switch Cmdlets
Storage Storage Cmdlets ×
License License View Cmdlets ×
VUM Update Manager Cmdlets ×
Auto Deploy Auto Deploy Cmdlets ×
Image Builder Image Builder Cmdletes ×
VCD vCloud Director Cmdlets ×
vCloud Air vCloud Air Cmdlets ×
Content Library COntent Library Cmdlets ×

さて、インストール。

1. PowerCLI CoreからPowerCLI_Core.zipを入手
ファイルを展開し、中にある、PowerCLI.ViCore.zipとPowerCLI.Vds.zipを適当な場所に置く。
(今回は~/work/に置いた)

2. powershell Core上で「$env:PSModulePath」を実行し、モジュールを読み込むディレクトリを確認

# powershell "$env:PSModulePath"
:PSModulePath : The term ':PSModulePath' is not recognized as the name of a cmd
let, function, script file, or operable program. Check the spelling of the name
, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ :PSModulePath
+ ~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (:PSModulePath:String) [], Comma
   ndNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
#

ん?

# powershell
PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.

PS /root> $env:PSModulePath
PS /root> exit
#

どうやら、環境変数「PSModulePath」が定義されていないらしい。

3. 個人用のModuleインストール先として「~/.local/share/powershell/Modules」を作成

# mkdir -p ~/.local/share/powershell/Modules
#

4. 作成したディレクトリ内にPowerCLI.ViCore.zipとPowerCLI.Vds.zipを展開

# cd ~/.local/share/powershell/Modules
# unzip ~/work/PowerCLI.ViCore.zip
Archive:  ~/work/PowerCLI.ViCore.zip
  inflating: PowerCLI.ViCore/ComponentDescriptor-VMware.VimAutomation.Vds.xml
  inflating: PowerCLI.ViCore/ComponentDescriptor-VMware.VimAutomation.ViCore.Cmdlets.xml
  inflating: PowerCLI.ViCore/ComponentDescriptor-VMware.VimAutomation.ViCore.xml
  inflating: PowerCLI.ViCore/ICSharpCode.SharpZipLib.Tar.dll
  inflating: PowerCLI.ViCore/ICSharpCode.SharpZipLib.Tar.pdb
  inflating: PowerCLI.ViCore/Initialize.ps1
  inflating: PowerCLI.ViCore/InternalVimService50.dll
  inflating: PowerCLI.ViCore/InventoryService55.dll
  inflating: PowerCLI.ViCore/log4net.dll
  inflating: PowerCLI.ViCore/Newtonsoft.Json.dll
  inflating: PowerCLI.ViCore/phclient.dll
  inflating: PowerCLI.ViCore/PowerCLI.ViCore.psd1
  inflating: PowerCLI.ViCore/System.Drawing.Primitives.dll
  inflating: PowerCLI.ViCore/System.Management.Automation.dll
  inflating: PowerCLI.ViCore/System.Net.WebSockets.Client.dll
  inflating: PowerCLI.ViCore/System.Net.WebSockets.dll
  inflating: PowerCLI.ViCore/System.Runtime.Serialization.Formatters.dll
  inflating: PowerCLI.ViCore/VimService.dll
  inflating: PowerCLI.ViCore/VMware.AspNet.WebApi.Client.dll
  inflating: PowerCLI.ViCore/VMware.AspNet.WebApi.Client.pdb
  inflating: PowerCLI.ViCore/VMware.Binding.Ls2.dll
  inflating: PowerCLI.ViCore/VMware.Binding.Ls2.pdb
  inflating: PowerCLI.ViCore/VMware.Binding.Wcf.dll
  inflating: PowerCLI.ViCore/VMware.Binding.Wcf.pdb
  inflating: PowerCLI.ViCore/VMware.System.Private.ServiceModel.dll
  inflating: PowerCLI.ViCore/VMware.Vim.dll
  inflating: PowerCLI.ViCore/VMware.Vim.pdb
  inflating: PowerCLI.ViCore/VMware.VimAutomation.Ceip.dll
  inflating: PowerCLI.ViCore/VMware.VimAutomation.Ceip.pdb
  inflating: PowerCLI.ViCore/VMware.VimAutomation.Common.Interop.dll
  inflating: PowerCLI.ViCore/VMware.VimAutomation.Common.Interop.pdb
  inflating: PowerCLI.ViCore/VMware.VimAutomation.Common.Types.dll
  inflating: PowerCLI.ViCore/VMware.VimAutomation.Common.Types.pdb
  inflating: PowerCLI.ViCore/VMware.VimAutomation.Common.Util10.dll
  inflating: PowerCLI.ViCore/VMware.VimAutomation.Common.Util10.pdb
  inflating: PowerCLI.ViCore/VMware.VimAutomation.Common.Util10Ps.dll
  inflating: PowerCLI.ViCore/VMware.VimAutomation.Common.Util10Ps.pdb
  inflating: PowerCLI.ViCore/VMware.VimAutomation.Format.ps1xml
  inflating: PowerCLI.ViCore/VMware.VimAutomation.Sdk.Impl.dll
  inflating: PowerCLI.ViCore/VMware.VimAutomation.Sdk.Impl.pdb
  inflating: PowerCLI.ViCore/VMware.VimAutomation.Sdk.Interop.dll
  inflating: PowerCLI.ViCore/VMware.VimAutomation.Sdk.Interop.pdb
  inflating: PowerCLI.ViCore/VMware.VimAutomation.Sdk.Types.dll
  inflating: PowerCLI.ViCore/VMware.VimAutomation.Sdk.Types.pdb
  inflating: PowerCLI.ViCore/VMware.VimAutomation.Sdk.Util10.dll
  inflating: PowerCLI.ViCore/VMware.VimAutomation.Sdk.Util10.pdb
  inflating: PowerCLI.ViCore/VMware.VimAutomation.Sdk.Util10Ps.dll
  inflating: PowerCLI.ViCore/VMware.VimAutomation.Sdk.Util10Ps.pdb
  inflating: PowerCLI.ViCore/VMware.VimAutomation.Vds.Impl.dll
  inflating: PowerCLI.ViCore/VMware.VimAutomation.Vds.Impl.pdb
  inflating: PowerCLI.ViCore/VMware.VimAutomation.Vds.Interop.dll
  inflating: PowerCLI.ViCore/VMware.VimAutomation.Vds.Interop.pdb
  inflating: PowerCLI.ViCore/VMware.VimAutomation.Vds.Types.dll
  inflating: PowerCLI.ViCore/VMware.VimAutomation.Vds.Types.pdb
  inflating: PowerCLI.ViCore/VMware.VimAutomation.ViCore.Cmdlets.dll
  inflating: PowerCLI.ViCore/VMware.VimAutomation.ViCore.Cmdlets.dll-Help.xml
  inflating: PowerCLI.ViCore/VMware.VimAutomation.ViCore.Cmdlets.pdb
  inflating: PowerCLI.ViCore/VMware.VimAutomation.ViCore.Impl.dll
  inflating: PowerCLI.ViCore/VMware.VimAutomation.ViCore.Impl.pdb
  inflating: PowerCLI.ViCore/VMware.VimAutomation.ViCore.Interop.dll
  inflating: PowerCLI.ViCore/VMware.VimAutomation.ViCore.Interop.pdb
  inflating: PowerCLI.ViCore/VMware.VimAutomation.ViCore.Types.dll
  inflating: PowerCLI.ViCore/VMware.VimAutomation.ViCore.Types.pdb
  inflating: PowerCLI.ViCore/VMware.VimAutomation.ViCore.Util10.dll
  inflating: PowerCLI.ViCore/VMware.VimAutomation.ViCore.Util10.pdb
  inflating: PowerCLI.ViCore/VMware.VimAutomation.ViCore.Util10Ps.dll
  inflating: PowerCLI.ViCore/VMware.VimAutomation.ViCore.Util10Ps.pdb
  inflating: PowerCLI.ViCore/Scripts/GetVmGuestNetworkInterface_LinuxGuest
  inflating: PowerCLI.ViCore/Scripts/GetVmGuestNetworkInterface_windows7Server64Guest.bat
  inflating: PowerCLI.ViCore/Scripts/GetVmGuestNetworkInterface_windows7_64Guest.bat
  inflating: PowerCLI.ViCore/Scripts/GetVmGuestNetworkInterface_WindowsGuest.bat
  inflating: PowerCLI.ViCore/Scripts/GetVMGuestRoute_LinuxGuest
  inflating: PowerCLI.ViCore/Scripts/GetVMGuestRoute_WindowsGuest.bat
  inflating: PowerCLI.ViCore/Scripts/GuestDiskExpansion_LinuxGuest
  inflating: PowerCLI.ViCore/Scripts/GuestDiskExpansion_rhel5Guest
  inflating: PowerCLI.ViCore/Scripts/GuestDiskExpansion_WindowsGuest.bat
  inflating: PowerCLI.ViCore/Scripts/GuestDiskExpansion_winXPProGuest.bat
  inflating: PowerCLI.ViCore/Scripts/NewVMGuestRoute_LinuxGuest
  inflating: PowerCLI.ViCore/Scripts/NewVMGuestRoute_WindowsGuest.bat
  inflating: PowerCLI.ViCore/Scripts/RemoveVMGuestRoute_LinuxGuest
  inflating: PowerCLI.ViCore/Scripts/RemoveVMGuestRoute_WindowsGuest.bat
  inflating: PowerCLI.ViCore/Scripts/SetVMGuestNetworkInterface_LinuxGuest
  inflating: PowerCLI.ViCore/Scripts/SetVMGuestNetworkInterface_windows7Server64Guest.bat
  inflating: PowerCLI.ViCore/Scripts/SetVMGuestNetworkInterface_windows7_64Guest.bat
  inflating: PowerCLI.ViCore/Scripts/SetVMGuestNetworkInterface_WindowsGuest.bat
# unzip ~/work/PowerCLI.Vds.zip
Archive:  ~/work/PowerCLI.Vds.zip
  inflating: PowerCLI.Vds/ComponentDescriptor-VMware.VimAutomation.Vds.Commands.xml
  inflating: PowerCLI.Vds/Initialize-VMware_VimAutomation_Vds.ps1
  inflating: PowerCLI.Vds/PowerCLI.Vds.psd1
  inflating: PowerCLI.Vds/VMware.VimAutomation.Vds.Commands.dll
  inflating: PowerCLI.Vds/VMware.VimAutomation.Vds.Commands.dll-Help.xml
  inflating: PowerCLI.Vds/VMware.VimAutomation.Vds.Commands.pdb
  inflating: PowerCLI.Vds/VMware.VimAutomation.Vds.Format.ps1xml
# ls -F
PowerCLI.Vds/  PowerCLI.ViCore/
#

5. PowerShell上でモジュールが認識されていることを確認
「Get-Module -ListAvailable」の出力結果内に「PowerCLI.ViCore」と「PowerCLI.Vds」があることを確認。

# powershell
PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.

PS /root/work> $env:PSModulePath
PS /root/work> Get-Module -ListAvailable PowerCLI*


    Directory: /root/.local/share/powershell/Modules


ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Binary     1.21       PowerCLI.Vds
Binary     1.21       PowerCLI.ViCore                     HookGetViewAutoCom...


PS /root/work>

6. 上記のモジュールを読み込み利用可能状態とする

PS /root/work> Get-Module -ListAvailable PowerCLI* | Import-Module
PS /root/work>

(モジュール名がPowerCLIと異なるため注意。どちらでも動かすやり方→「PowerCLIとPowerCLI Coreの双方で動くPowerShellスクリプトの作り方」)

7. vCenterへの接続テストをしてみる

PS /root/work> Connect-VIServer -Server サーバ名 -User ユーザ名 -Password "パスワード"
Connect-VIServer : 2017/02/22 17:40:20  Connect-VIServer                The libcurl library in
 use (7.29.0) and its SSL backend ("NSS/3.21 Basic ECC") do not support custom
handling of certificates. A libcurl built with OpenSSL is required.
At line:1 char:1
+ Connect-VIServer -Server サーバ名 -User ユーザ名 -Password "パスワード"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Connect-VIServer], ViError
    + FullyQualifiedErrorId : Client20_ConnectivityServiceImpl_Reconnect_Excep
   tion,VMware.VimAutomation.ViCore.Cmdlets.Commands.ConnectVIServer

PS /root/work>

手順にある証明書の問題を無視する設定を飛ばしたせいかな?と次を実施。

8. 証明書の問題を無視する設定を実施
手順書では「Set-PowerCLIConfiguration -InvalidCertificateAction Ignore」、プロンプトを出したくないのであれば、「Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false」を実行

PS /root/work> Set-PowerCLIConfiguration -InvalidCertificateAction Ignore

Perform operation?
Performing operation 'Update PowerCLI configuration.'?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help
(default is "Y"):y

Scope    ProxyPolicy     DefaultVIServerMode InvalidCertificateAction  DisplayD
                                                                       eprecati
                                                                       onWarnin
                                                                       gs
-----    -----------     ------------------- ------------------------  --------
Session  UseSystemProxy  Multiple            Ignore                    True
User                                         Ignore
AllUsers


PS /root/work> Connect-VIServer -Server サーバ名 -User ユーザ名 -Password "パスワード"

Connect-VIServer : 2017/02/22 17:43:23  Connect-VIServer                The libcurl library in
 use (7.29.0) and its SSL backend ("NSS/3.21 Basic ECC") do not support custom
handling of certificates. A libcurl built with OpenSSL is required.
At line:1 char:1
+ Connect-VIServer -Server サーバ名 -User ユーザ名 -Password "パスワード"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Connect-VIServer], ViError
    + FullyQualifiedErrorId : Client20_ConnectivityServiceImpl_Reconnect_Excep
   tion,VMware.VimAutomation.ViCore.Cmdlets.Commands.ConnectVIServer

PS /root/work>

あれ?
証明書を無視するという問題ではなかった模様。

調べるとGithubのPowerShell Issue#2511と同じ状況
On CentOS Powershell uses the system libcurl that does not support custom SSL certificate validation #2511
現時点では、「CERN CentOS 7」に含まれている「libcurl-openssl」をインストールすると回避できるらしい。

CERN CentOS7を利用する回避手順
(1) 標準状態のCentOS7での「libcurl」関連パッケージの状況を確認

# yum search libcurl
読み込んだプラグイン:fastestmirror
Loading mirror speeds from cached hostfile
 * base: www.ftp.ne.jp
 * extras: www.ftp.ne.jp
 * updates: www.ftp.ne.jp
============================= N/S matched: libcurl =============================
libcurl-devel.i686 : Files needed for building applications with libcurl
libcurl-devel.x86_64 : Files needed for building applications with libcurl
libcurl.i686 : A library for getting files from web servers
libcurl.x86_64 : A library for getting files from web servers
perl-WWW-Curl.x86_64 : Perl extension interface for libcurl
python-pycurl.x86_64 : A Python interface to libcurl

  Name and summary matches only, use "search all" for everything.
#

(2) CERN CentOS 7のレポジトリ設定が含まれるcentos-release-~cern.rpmを取得
http://linuxsoft.cern.ch/cern/centos/7/cern/x86_64/Packages/から「centos-release-~.el7.cern.x86_64.rpm」の一番新しいものをダウンロード

(3) rpmファイルを展開し、CentOS-CERN.repoファイルを入手
「rpm2cpio centos-release-~.el7.cern.x86_64.rpm | cpio -ivd」で展開すると「./etc/yum.repos.d/CentOS-CERN.repo」などが作成される
2017/02/22の段階でのCentOS-CERN.repoファイルは下記の内容だった。

# CentOS-CERN.repo
#
# CERN CentOS 7 uses local repositories at http://linuxsoft.cern.ch distribution service
#

[cern]
name=CentOS-$releasever - CERN
baseurl=http://linuxsoft.cern.ch/cern/centos/$releasever/cern/$basearch/
gpgcheck=1
enabled=1
protect=1
priority=5
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-cern

[cern-testing]
name=CentOS-$releasever - CERN Testing
baseurl=http://linuxsoft.cern.ch/cern/centos/$releasever/cern-testing/$basearch/
gpgcheck=1
enabled=0
protect=1
priority=5
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-cern

[cernonly]
name=CentOS-$releasever - CERN Only
baseurl=http://linuxsoft.cern.ch/cern/centos/$releasever/cernonly/$basearch/
gpgcheck=1
enabled=0
protect=1
priority=5
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-cern

[cernonly-testing]
name=CentOS-$releasever - CERN Only Testing
baseurl=http://linuxsoft.cern.ch/cern/centos/$releasever/cernonly-testing/$basearch/
gpgcheck=1
enabled=0
protect=1
priority=5
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-cern

[cern-debug]
name=CentOS-7 - CERN - Debuginfo
baseurl=http://linuxsoft.cern.ch/cern/centos/$releasever/cern/Debug/$basearch/
gpgcheck=1
enabled=0
protect=1
priority=5
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-cern

[cernonly-debug]
name=CentOS-7 - CERN Only - Debuginfo
baseurl=http://linuxsoft.cern.ch/cern/centos/$releasever/cernonly/Debug/$basearch/
gpgcheck=1
enabled=0
protect=1
priority=5
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-cern

[cern-source]
name=CentOS-$releasever - CERN Sources
baseurl=http://linuxsoft.cern.ch/cern/centos/$releasever/cern/Sources/
gpgcheck=1
enabled=0
protect=1
priority=5
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-cern

[cernonly-source]
name=CentOS-$releasever - CERN Only Sources
baseurl=http://linuxsoft.cern.ch/cern/centos/$releasever/cernonly/Sources/
gpgcheck=1
enabled=0
enabled=0
protect=1
priority=5
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-cern

[cern-testing-source]
name=CentOS-$releasever - CERN Testing Sources
baseurl=http://linuxsoft.cern.ch/cern/centos/$releasever/cern-testing/Sources/
gpgcheck=1
enabled=0
protect=1
priority=5
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-cern

[cernonly-testing-source]
name=CentOS-$releasever - CERN Only Testing Sources
baseurl=http://linuxsoft.cern.ch/cern/centos/$releasever/cernonly-testing/Sources/
gpgcheck=1
enabled=0
enabled=0
protect=1
priority=5
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-cern

(4) ./etc/yum.repos.d/CentOS-CERN.repoを「/etc/yum.repos.d/」にコピー
(5) ./etc/pki/rpm-gpg/RPM-GPG-KEY-cernを「/etc/pki/rpm-gpg/」にコピー

(6) CERNレポジトリが登録されている状態で「libcurl」関連を検索

# yum search libcurl
読み込んだプラグイン:fastestmirror
Loading mirror speeds from cached hostfile
 * base: www.ftp.ne.jp
 * extras: www.ftp.ne.jp
 * updates: www.ftp.ne.jp
============================= N/S matched: libcurl =============================
libcurl-devel.i686 : Files needed for building applications with libcurl
libcurl-devel.x86_64 : Files needed for building applications with libcurl
libcurl-openssl-devel.x86_64 : Files needed for building applications with
                             : libcurl-openssl
libcurl.i686 : A library for getting files from web servers
libcurl.x86_64 : A library for getting files from web servers
libcurl-openssl.x86_64 : A library for getting files from web servers
perl-WWW-Curl.x86_64 : Perl extension interface for libcurl
python-pycurl.x86_64 : A Python interface to libcurl

  Name and summary matches only, use "search all" for everything.
#

(7) libcurl-opensslをインストール

# yum install libcurl-openssl
読み込んだプラグイン:fastestmirror
Loading mirror speeds from cached hostfile
 * base: www.ftp.ne.jp
 * extras: www.ftp.ne.jp
 * updates: www.ftp.ne.jp
依存性の解決をしています
--> トランザクションの確認を実行しています。
---> パッケージ libcurl-openssl.x86_64 0:7.51.0-2.1.el7.cern を インストール
--> 依存性解決を終了しました。

依存性を解決しました

================================================================================
 Package               アーキテクチャー
                                    バージョン                 リポジトリー
                                                                           容量
================================================================================
インストール中:
 libcurl-openssl       x86_64       7.51.0-2.1.el7.cern        cern       215 k

トランザクションの要約
================================================================================
インストール  1 パッケージ

合計容量: 215 k
インストール容量: 446 k
Is this ok [y/d/N]: y
Downloading packages:
警告: /var/cache/yum/x86_64/7/cern/packages/libcurl-openssl-7.51.0-2.1.el7.cern.x86_64.rpm: ヘッダー V4 DSA/SHA1 Signature、鍵 ID 1d1e034b: NOKEY
file:///etc/pki/rpm-gpg/RPM-GPG-KEY-cern から鍵を取得中です。
Importing GPG key 0x1D1E034B:
 Userid     : "CERN Linux Support (RPM signing key for CERN Linux Support) <linux.support@cern.ch>"
 Fingerprint: 86b5 5b37 12c1 e4a4 13c9 60e6 5e03 fde5 1d1e 034b
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-cern
上記の処理を行います。よろしいでしょうか? [y/N]y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
警告: RPMDB は yum 以外で変更されました。
  インストール中          : libcurl-openssl-7.51.0-2.1.el7.cern.x86_64      1/1
  検証中                  : libcurl-openssl-7.51.0-2.1.el7.cern.x86_64      1/1

インストール:
  libcurl-openssl.x86_64 0:7.51.0-2.1.el7.cern

完了しました!
#

(8)普段の運用に差し支える可能性があるので普段はCERNレポジトリを無効化する
「/etc/yum.repos.d/CentOS-CERN.repo」内にある「enabled=1」を「enabled=0」に変更する

(9) libcurl-opensslが/opt/shibboleth/lib64/にインストールされていることを確認

# ls /opt/shibboleth/lib64/
libcurl.so.4  libcurl.so.4.4.0
#

(10) LD_LIBRARY_PATHに「/opt/shibboleth/lib64/」を追加

# export LD_LIBRARY_PATH=/opt/shibboleth/lib64/:$LD_LIBRARY_PATH
#

9. 改めてPowerShellを起動しなおして接続

# powershell
PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.

PS /root> Get-Module -ListAvailable PowerCLI* | Import-Module
PS /root> Connect-VIServer -Server サーバ名 -User ユーザ名 -Password "パスワード"

Name                           Port  User
----                           ----  ----
サーバ名                       443   ユーザ名


PS /root>

問題なく成功

Get-VMとかも通常のPowerCLIと同様に可能

PS /root> Get-VM

Name                 PowerState Num CPUs MemoryGB
----                 ---------- -------- --------
仮想マシン名         PoweredOn  2        8.000


PS /root>

ということで、PowerCLI COREで利用可能なコマンドレットの一覧。

PS /root> Get-Module

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     0.0        Initialize
Script     0.0        Initialize-VMware_VimAutomation_Vds
Manifest   3.1.0.0    Microsoft.PowerShell.Management     {Add-Content, Clea...
Manifest   3.1.0.0    Microsoft.PowerShell.Utility        {Add-Member, Add-T...
Binary     1.21       PowerCLI.Vds                        {Add-VDSwitchPhysi...
Binary     1.21       PowerCLI.ViCore                     {Add-PassthroughDe...
Script     1.2        PSReadLine                          {Get-PSReadlineKey...


PS /root> (Get-Module PowerCLI.ViCore).ExportedCommands

Key                                        Value
---                                        -----
Add-PassthroughDevice                      Add-PassthroughDevice
Add-VirtualSwitchPhysicalNetworkAdapter    Add-VirtualSwitchPhysicalNetworkA...
Add-VMHost                                 Add-VMHost
Add-VMHostNtpServer                        Add-VMHostNtpServer
Connect-VIServer                           Connect-VIServer
Copy-DatastoreItem                         Copy-DatastoreItem
Copy-HardDisk                              Copy-HardDisk
Copy-VMGuestFile                           Copy-VMGuestFile
Disconnect-VIServer                        Disconnect-VIServer
Dismount-Tools                             Dismount-Tools
Export-VApp                                Export-VApp
Export-VMHostProfile                       Export-VMHostProfile
Format-VMHostDiskPartition                 Format-VMHostDiskPartition
Get-AdvancedSetting                        Get-AdvancedSetting
Get-AlarmAction                            Get-AlarmAction
Get-AlarmActionTrigger                     Get-AlarmActionTrigger
Get-AlarmDefinition                        Get-AlarmDefinition
Get-Annotation                             Get-Annotation
Get-CDDrive                                Get-CDDrive
Get-Cluster                                Get-Cluster
Get-ContentLibraryItem                     Get-ContentLibraryItem
Get-CustomAttribute                        Get-CustomAttribute
Get-Datacenter                             Get-Datacenter
Get-Datastore                              Get-Datastore
Get-DatastoreCluster                       Get-DatastoreCluster
Get-DrsRecommendation                      Get-DrsRecommendation
Get-DrsRule                                Get-DrsRule
Get-EsxCli                                 Get-EsxCli
Get-EsxTop                                 Get-EsxTop
Get-FloppyDrive                            Get-FloppyDrive
Get-Folder                                 Get-Folder
Get-HAPrimaryVMHost                        Get-HAPrimaryVMHost
Get-HardDisk                               Get-HardDisk
Get-Inventory                              Get-Inventory
Get-IScsiHbaTarget                         Get-IScsiHbaTarget
Get-Log                                    Get-Log
Get-LogType                                Get-LogType
Get-NetworkAdapter                         Get-NetworkAdapter
Get-NicTeamingPolicy                       Get-NicTeamingPolicy
Get-OSCustomizationNicMapping              Get-OSCustomizationNicMapping
Get-OSCustomizationSpec                    Get-OSCustomizationSpec
Get-OvfConfiguration                       Get-OvfConfiguration
Get-PassthroughDevice                      Get-PassthroughDevice
Get-PowerCLIConfiguration                  Get-PowerCLIConfiguration
Get-PowerCLIVersion                        Get-PowerCLIVersion
Get-ResourcePool                           Get-ResourcePool
Get-ScsiController                         Get-ScsiController
Get-ScsiLun                                Get-ScsiLun
Get-ScsiLunPath                            Get-ScsiLunPath
Get-SecurityPolicy                         Get-SecurityPolicy
Get-Snapshot                               Get-Snapshot
Get-Stat                                   Get-Stat
Get-StatInterval                           Get-StatInterval
Get-StatType                               Get-StatType
Get-Tag                                    Get-Tag
Get-TagAssignment                          Get-TagAssignment
Get-TagCategory                            Get-TagCategory
Get-Task                                   Get-Task
Get-Template                               Get-Template
Get-UsbDevice                              Get-UsbDevice
Get-VApp                                   Get-VApp
Get-VIAccount                              Get-VIAccount
Get-VIEvent                                Get-VIEvent
Get-View                                   Get-View
Get-VIObjectByVIView                       Get-VIObjectByVIView
Get-VIPermission                           Get-VIPermission
Get-VIPrivilege                            Get-VIPrivilege
Get-VIProperty                             Get-VIProperty
Get-VIRole                                 Get-VIRole
Get-VirtualPortGroup                       Get-VirtualPortGroup
Get-VirtualSwitch                          Get-VirtualSwitch
Get-VM                                     Get-VM
Get-VMGuest                                Get-VMGuest
Get-VMGuestNetworkInterface                Get-VMGuestNetworkInterface
Get-VMGuestRoute                           Get-VMGuestRoute
Get-VMHost                                 Get-VMHost
Get-VMHostAccount                          Get-VMHostAccount
Get-VMHostAdvancedConfiguration            Get-VMHostAdvancedConfiguration
Get-VMHostAuthentication                   Get-VMHostAuthentication
Get-VMHostAvailableTimeZone                Get-VMHostAvailableTimeZone
Get-VMHostDiagnosticPartition              Get-VMHostDiagnosticPartition
Get-VMHostDisk                             Get-VMHostDisk
Get-VMHostDiskPartition                    Get-VMHostDiskPartition
Get-VMHostFirewallDefaultPolicy            Get-VMHostFirewallDefaultPolicy
Get-VMHostFirewallException                Get-VMHostFirewallException
Get-VMHostFirmware                         Get-VMHostFirmware
Get-VMHostHardware                         Get-VMHostHardware
Get-VMHostHba                              Get-VMHostHba
Get-VMHostModule                           Get-VMHostModule
Get-VMHostNetwork                          Get-VMHostNetwork
Get-VMHostNetworkAdapter                   Get-VMHostNetworkAdapter
Get-VMHostNtpServer                        Get-VMHostNtpServer
Get-VMHostPatch                            Get-VMHostPatch
Get-VMHostPciDevice                        Get-VMHostPciDevice
Get-VMHostProfile                          Get-VMHostProfile
Get-VMHostProfileRequiredInput             Get-VMHostProfileRequiredInput
Get-VMHostRoute                            Get-VMHostRoute
Get-VMHostService                          Get-VMHostService
Get-VMHostSnmp                             Get-VMHostSnmp
Get-VMHostStartPolicy                      Get-VMHostStartPolicy
Get-VMHostStorage                          Get-VMHostStorage
Get-VMHostSysLogServer                     Get-VMHostSysLogServer
Get-VMQuestion                             Get-VMQuestion
Get-VMResourceConfiguration                Get-VMResourceConfiguration
Get-VMStartPolicy                          Get-VMStartPolicy
Import-VApp                                Import-VApp
Import-VMHostProfile                       Import-VMHostProfile
Install-VMHostPatch                        Install-VMHostPatch
Invoke-DrsRecommendation                   Invoke-DrsRecommendation
Invoke-VMHostProfile                       Invoke-VMHostProfile
Invoke-VMScript                            Invoke-VMScript
Mount-Tools                                Mount-Tools
Move-Cluster                               Move-Cluster
Move-Datacenter                            Move-Datacenter
Move-Datastore                             Move-Datastore
Move-Folder                                Move-Folder
Move-HardDisk                              Move-HardDisk
Move-Inventory                             Move-Inventory
Move-ResourcePool                          Move-ResourcePool
Move-Template                              Move-Template
Move-VApp                                  Move-VApp
Move-VM                                    Move-VM
Move-VMHost                                Move-VMHost
New-AdvancedSetting                        New-AdvancedSetting
New-AlarmAction                            New-AlarmAction
New-AlarmActionTrigger                     New-AlarmActionTrigger
New-CDDrive                                New-CDDrive
New-Cluster                                New-Cluster
New-CustomAttribute                        New-CustomAttribute
New-Datacenter                             New-Datacenter
New-Datastore                              New-Datastore
New-DatastoreCluster                       New-DatastoreCluster
New-DrsRule                                New-DrsRule
New-FloppyDrive                            New-FloppyDrive
New-Folder                                 New-Folder
New-HardDisk                               New-HardDisk
New-IScsiHbaTarget                         New-IScsiHbaTarget
New-NetworkAdapter                         New-NetworkAdapter
New-OSCustomizationNicMapping              New-OSCustomizationNicMapping
New-OSCustomizationSpec                    New-OSCustomizationSpec
New-ResourcePool                           New-ResourcePool
New-ScsiController                         New-ScsiController
New-Snapshot                               New-Snapshot
New-StatInterval                           New-StatInterval
New-Tag                                    New-Tag
New-TagAssignment                          New-TagAssignment
New-TagCategory                            New-TagCategory
New-Template                               New-Template
New-VApp                                   New-VApp
New-VIPermission                           New-VIPermission
New-VIProperty                             New-VIProperty
New-VIRole                                 New-VIRole
New-VirtualPortGroup                       New-VirtualPortGroup
New-VirtualSwitch                          New-VirtualSwitch
New-VM                                     New-VM
New-VMGuestRoute                           New-VMGuestRoute
New-VMHostAccount                          New-VMHostAccount
New-VMHostNetworkAdapter                   New-VMHostNetworkAdapter
New-VMHostProfile                          New-VMHostProfile
New-VMHostRoute                            New-VMHostRoute
Open-VMConsoleWindow                       Open-VMConsoleWindow
Remove-AdvancedSetting                     Remove-AdvancedSetting
Remove-AlarmAction                         Remove-AlarmAction
Remove-AlarmActionTrigger                  Remove-AlarmActionTrigger
Remove-CDDrive                             Remove-CDDrive
Remove-Cluster                             Remove-Cluster
Remove-CustomAttribute                     Remove-CustomAttribute
Remove-Datacenter                          Remove-Datacenter
Remove-Datastore                           Remove-Datastore
Remove-DatastoreCluster                    Remove-DatastoreCluster
Remove-DrsRule                             Remove-DrsRule
Remove-FloppyDrive                         Remove-FloppyDrive
Remove-Folder                              Remove-Folder
Remove-HardDisk                            Remove-HardDisk
Remove-Inventory                           Remove-Inventory
Remove-IScsiHbaTarget                      Remove-IScsiHbaTarget
Remove-NetworkAdapter                      Remove-NetworkAdapter
Remove-OSCustomizationNicMapping           Remove-OSCustomizationNicMapping
Remove-OSCustomizationSpec                 Remove-OSCustomizationSpec
Remove-PassthroughDevice                   Remove-PassthroughDevice
Remove-ResourcePool                        Remove-ResourcePool
Remove-Snapshot                            Remove-Snapshot
Remove-StatInterval                        Remove-StatInterval
Remove-Tag                                 Remove-Tag
Remove-TagAssignment                       Remove-TagAssignment
Remove-TagCategory                         Remove-TagCategory
Remove-Template                            Remove-Template
Remove-UsbDevice                           Remove-UsbDevice
Remove-VApp                                Remove-VApp
Remove-VIPermission                        Remove-VIPermission
Remove-VIProperty                          Remove-VIProperty
Remove-VIRole                              Remove-VIRole
Remove-VirtualPortGroup                    Remove-VirtualPortGroup
Remove-VirtualSwitch                       Remove-VirtualSwitch
Remove-VirtualSwitchPhysicalNetworkAdapter Remove-VirtualSwitchPhysicalNetwo...
Remove-VM                                  Remove-VM
Remove-VMGuestRoute                        Remove-VMGuestRoute
Remove-VMHost                              Remove-VMHost
Remove-VMHostAccount                       Remove-VMHostAccount
Remove-VMHostNetworkAdapter                Remove-VMHostNetworkAdapter
Remove-VMHostNtpServer                     Remove-VMHostNtpServer
Remove-VMHostProfile                       Remove-VMHostProfile
Remove-VMHostRoute                         Remove-VMHostRoute
Restart-VM                                 Restart-VM
Restart-VMGuest                            Restart-VMGuest
Restart-VMHost                             Restart-VMHost
Restart-VMHostService                      Restart-VMHostService
Set-AdvancedSetting                        Set-AdvancedSetting
Set-AlarmDefinition                        Set-AlarmDefinition
Set-Annotation                             Set-Annotation
Set-CDDrive                                Set-CDDrive
Set-Cluster                                Set-Cluster
Set-CustomAttribute                        Set-CustomAttribute
Set-Datacenter                             Set-Datacenter
Set-Datastore                              Set-Datastore
Set-DatastoreCluster                       Set-DatastoreCluster
Set-DrsRule                                Set-DrsRule
Set-FloppyDrive                            Set-FloppyDrive
Set-Folder                                 Set-Folder
Set-HardDisk                               Set-HardDisk
Set-IScsiHbaTarget                         Set-IScsiHbaTarget
Set-NetworkAdapter                         Set-NetworkAdapter
Set-NicTeamingPolicy                       Set-NicTeamingPolicy
Set-OSCustomizationNicMapping              Set-OSCustomizationNicMapping
Set-OSCustomizationSpec                    Set-OSCustomizationSpec
Set-PowerCLIConfiguration                  Set-PowerCLIConfiguration
Set-ResourcePool                           Set-ResourcePool
Set-ScsiController                         Set-ScsiController
Set-ScsiLun                                Set-ScsiLun
Set-ScsiLunPath                            Set-ScsiLunPath
Set-SecurityPolicy                         Set-SecurityPolicy
Set-Snapshot                               Set-Snapshot
Set-StatInterval                           Set-StatInterval
Set-Tag                                    Set-Tag
Set-TagCategory                            Set-TagCategory
Set-Template                               Set-Template
Set-VApp                                   Set-VApp
Set-VIPermission                           Set-VIPermission
Set-VIRole                                 Set-VIRole
Set-VirtualPortGroup                       Set-VirtualPortGroup
Set-VirtualSwitch                          Set-VirtualSwitch
Set-VM                                     Set-VM
Set-VMGuestNetworkInterface                Set-VMGuestNetworkInterface
Set-VMHost                                 Set-VMHost
Set-VMHostAccount                          Set-VMHostAccount
Set-VMHostAdvancedConfiguration            Set-VMHostAdvancedConfiguration
Set-VMHostAuthentication                   Set-VMHostAuthentication
Set-VMHostDiagnosticPartition              Set-VMHostDiagnosticPartition
Set-VMHostFirewallDefaultPolicy            Set-VMHostFirewallDefaultPolicy
Set-VMHostFirewallException                Set-VMHostFirewallException
Set-VMHostFirmware                         Set-VMHostFirmware
Set-VMHostHba                              Set-VMHostHba
Set-VMHostModule                           Set-VMHostModule
Set-VMHostNetwork                          Set-VMHostNetwork
Set-VMHostNetworkAdapter                   Set-VMHostNetworkAdapter
Set-VMHostProfile                          Set-VMHostProfile
Set-VMHostRoute                            Set-VMHostRoute
Set-VMHostService                          Set-VMHostService
Set-VMHostSnmp                             Set-VMHostSnmp
Set-VMHostStartPolicy                      Set-VMHostStartPolicy
Set-VMHostStorage                          Set-VMHostStorage
Set-VMHostSysLogServer                     Set-VMHostSysLogServer
Set-VMQuestion                             Set-VMQuestion
Set-VMResourceConfiguration                Set-VMResourceConfiguration
Set-VMStartPolicy                          Set-VMStartPolicy
Start-VApp                                 Start-VApp
Start-VM                                   Start-VM
Start-VMHost                               Start-VMHost
Start-VMHostService                        Start-VMHostService
Stop-Task                                  Stop-Task
Stop-VApp                                  Stop-VApp
Stop-VM                                    Stop-VM
Stop-VMGuest                               Stop-VMGuest
Stop-VMHost                                Stop-VMHost
Stop-VMHostService                         Stop-VMHostService
Suspend-VM                                 Suspend-VM
Suspend-VMGuest                            Suspend-VMGuest
Suspend-VMHost                             Suspend-VMHost
Test-VMHostProfileCompliance               Test-VMHostProfileCompliance
Test-VMHostSnmp                            Test-VMHostSnmp
Update-Tools                               Update-Tools
Wait-Task                                  Wait-Task
Wait-Tools                                 Wait-Tools


PS /root> (Get-Module PowerCLI.Vds).ExportedCommands

Key                                   Value
---                                   -----
Add-VDSwitchPhysicalNetworkAdapter    Add-VDSwitchPhysicalNetworkAdapter
Add-VDSwitchVMHost                    Add-VDSwitchVMHost
Export-VDPortGroup                    Export-VDPortGroup
Export-VDSwitch                       Export-VDSwitch
Get-VDBlockedPolicy                   Get-VDBlockedPolicy
Get-VDPort                            Get-VDPort
Get-VDPortgroup                       Get-VDPortgroup
Get-VDPortgroupOverridePolicy         Get-VDPortgroupOverridePolicy
Get-VDSecurityPolicy                  Get-VDSecurityPolicy
Get-VDSwitch                          Get-VDSwitch
Get-VDSwitchPrivateVlan               Get-VDSwitchPrivateVlan
Get-VDTrafficShapingPolicy            Get-VDTrafficShapingPolicy
Get-VDUplinkLacpPolicy                Get-VDUplinkLacpPolicy
Get-VDUplinkTeamingPolicy             Get-VDUplinkTeamingPolicy
New-VDPortgroup                       New-VDPortgroup
New-VDSwitch                          New-VDSwitch
New-VDSwitchPrivateVlan               New-VDSwitchPrivateVlan
Remove-VDPortGroup                    Remove-VDPortGroup
Remove-VDSwitch                       Remove-VDSwitch
Remove-VDSwitchPhysicalNetworkAdapter Remove-VDSwitchPhysicalNetworkAdapter
Remove-VDSwitchPrivateVlan            Remove-VDSwitchPrivateVlan
Remove-VDSwitchVMHost                 Remove-VDSwitchVMHost
Set-VDBlockedPolicy                   Set-VDBlockedPolicy
Set-VDPort                            Set-VDPort
Set-VDPortgroup                       Set-VDPortgroup
Set-VDPortgroupOverridePolicy         Set-VDPortgroupOverridePolicy
Set-VDSecurityPolicy                  Set-VDSecurityPolicy
Set-VDSwitch                          Set-VDSwitch
Set-VDTrafficShapingPolicy            Set-VDTrafficShapingPolicy
Set-VDUplinkLacpPolicy                Set-VDUplinkLacpPolicy
Set-VDUplinkTeamingPolicy             Set-VDUplinkTeamingPolicy
Set-VDVlanConfiguration               Set-VDVlanConfiguration


PS /root>

GithubのPowerShell Issue#2511の関連を調べたら、「PowervRA」と「PowervRO」があるのを発見。
どちらもPowerShell Core対応である模様。