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スクリプト」という記事で詳細を記載しています。

GPD Pocketのクラウドファンディングが開始されたので投資してみた


GPD社による、クラウドファンディングPCの第2弾。GPD Pocketが、先ほどより開始されました。

GPD Winの時は、国内最速クラスでネタにしていたけど、タイミングが悪くてクラウドファンディングに参加出来なかったけど、今回は大丈夫だったぜ!

当時の発言、twitter社により検索除外されちゃってるから、ここで再掲載しておくか・・・

Power Shell Core 6.0をCentOS7で使ってみる


2017/02/01にPowerShell Core 6.0がLinux環境向けにもリリースされた
Installing latest PowerShell Core 6.0 Release on Linux just got easier!

PowerShellの開発はGithubの「https://github.com/PowerShell/PowerShell」で行われており、導入手順も書かれている。
github上の「Linux向けインストール手順」では、直接RPMファイル/debファイルを指定してインストールする、というものが記載されている。

しかし、「Installing latest PowerShell Core 6.0 Release on Linux just got easier!」の記事の中では、yumやaptなどでプログラムの更新をサポートする形でのインストール手順が示されている。

CentOS7だと下記のようになる

# curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/microsoft.repo
# yum install powershell
#

実際に実行してみると下記の様になります。

[root@blog ~]# curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/microsoft.repo
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   193  100   193    0     0    209      0 --:--:-- --:--:-- --:--:--   210
[root@blog ~]# yum install powershell
読み込んだプラグイン:fastestmirror, langpacks
packages-microsoft-com-prod                              | 2.9 kB     00:00
packages-microsoft-com-prod/primary_db                     | 9.9 kB   00:00
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * epel: ftp.riken.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
依存性の解決をしています
--> トランザクションの確認を実行しています。
---> パッケージ powershell.x86_64 0:6.0.0_alpha.15-1.el7.centos を インストール
--> 依存性の処理をしています: uuid のパッケージ: powershell-6.0.0_alpha.15-1.el7.centos.x86_64
--> 依存性の処理をしています: libicu のパッケージ: powershell-6.0.0_alpha.15-1.el7.centos.x86_64
--> 依存性の処理をしています: libunwind のパッケージ: powershell-6.0.0_alpha.15-1.el7.centos.x86_64
--> トランザクションの確認を実行しています。
---> パッケージ libicu.x86_64 0:50.1.2-15.el7 を インストール
---> パッケージ libunwind.x86_64 2:1.1-5.el7_2.2 を インストール
---> パッケージ uuid.x86_64 0:1.6.2-26.el7 を インストール
--> 依存性解決を終了しました。

依存性を解決しました

================================================================================
 Package   アーキテクチャー
                  バージョン                  リポジトリー                 容量
================================================================================
インストール中:
 powershell
           x86_64 6.0.0_alpha.15-1.el7.centos packages-microsoft-com-prod  39 M
依存性関連でのインストールをします:
 libicu    x86_64 50.1.2-15.el7               base                        6.9 M
 libunwind x86_64 2:1.1-5.el7_2.2             base                         56 k
 uuid      x86_64 1.6.2-26.el7                base                         55 k

トランザクションの要約
================================================================================
インストール  1 パッケージ (+3 個の依存関係のパッケージ)

総ダウンロード容量: 46 M
インストール容量: 64 M
Is this ok [y/d/N]: y
Downloading packages:
(1/4): uuid-1.6.2-26.el7.x86_64.rpm                        |  55 kB   00:00
(2/4): libunwind-1.1-5.el7_2.2.x86_64.rpm                  |  56 kB   00:00
(3/4): libicu-50.1.2-15.el7.x86_64.rpm                     | 6.9 MB   00:04
warning: /var/cache/yum/x86_64/7/packages-microsoft-com-prod/packages/powershell-6.0.0_alpha.15-1.el7.centos.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID be1229cf: NOKEY
powershell-6.0.0_alpha.15-1.el7.centos.x86_64.rpm の公開鍵がインストールされていません
(4/4): powershell-6.0.0_alpha.15-1.el7.centos.x86_64.rpm   |  39 MB   00:21
--------------------------------------------------------------------------------
合計                                               2.2 MB/s |  46 MB  00:21
https://packages.microsoft.com/keys/microsoft.asc から鍵を取得中です。
Importing GPG key 0xBE1229CF:
 Userid     : "Microsoft (Release signing) <gpgsecurity@microsoft.com>"
 Fingerprint: bc52 8686 b50d 79e3 39d3 721c eb3e 94ad be12 29cf
 From       : https://packages.microsoft.com/keys/microsoft.asc
上記の処理を行います。よろしいでしょうか? [y/N]y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  インストール中          : uuid-1.6.2-26.el7.x86_64                        1/4
  インストール中          : 2:libunwind-1.1-5.el7_2.2.x86_64                2/4
  インストール中          : libicu-50.1.2-15.el7.x86_64                     3/4
  インストール中          : powershell-6.0.0_alpha.15-1.el7.centos.x86_64   4/4
  検証中                  : powershell-6.0.0_alpha.15-1.el7.centos.x86_64   1/4
  検証中                  : libicu-50.1.2-15.el7.x86_64                     2/4
  検証中                  : 2:libunwind-1.1-5.el7_2.2.x86_64                3/4
  検証中                  : uuid-1.6.2-26.el7.x86_64                        4/4

インストール:
  powershell.x86_64 0:6.0.0_alpha.15-1.el7.centos

依存性関連をインストールしました:
  libicu.x86_64 0:50.1.2-15.el7         libunwind.x86_64 2:1.1-5.el7_2.2
  uuid.x86_64 0:1.6.2-26.el7

完了しました!
[root@blog ~]#

が・・・
私の環境では、いつもの癖で「ls」と実行してしまったら・・・

bash-4.2$ ls
11-0-1-0048_SAS_FW_Image_1-40-342-1650.zip  MegaSAS.log  sql  web  work
bash-4.2$ powershell
PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.

PS /home/osakanataro> ls
11-0-1-0048_SAS_FW_Image_1-40-342-1650.zip  MegaSAS.log  sql  web  work
(ここで応答が無くなる)

ん???
UNIX系コマンドをPowerShellから実行した場合の動作に難有りなのかも?

PS /home/osakanataro> Get-Item *| ForEach-Object { $_ }


    Directory: /home/osakanataro


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-r---       2017/02/06     17:35                sql
d-----       2017/02/03     19:08                web
d-----       2017/02/03     19:19                work
------       2017/01/04     13:01        1528036 11-0-1-0048_SAS_FW_Image_1-40-
                                                 342-1650.zip
--r---       2017/01/04     13:07            390 MegaSAS.log

PS /home/osakanataro> dir


    Directory: /home/osakanataro


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-r---       2017/02/06     17:35                sql
d-----       2017/02/03     19:08                web
d-----       2017/02/03     19:19                work
------       2017/01/04     13:01        1528036 11-0-1-0048_SAS_FW_Image_1-40-
                                                 342-1650.zip
--r---       2017/01/04     13:07            390 MegaSAS.log


PS /home/osakanataro>

PwerShellらしいこと、ということで、下記の処理をやってみる

PS /home/osakanataro> $results=Get-Item *| ForEach-Object { $_ }
PS /home/osakanataro> $results | Export-Csv test.csv -Encoding UTF  (タブ補完で候補を出す)
UTF32  UTF7   UTF8
PS /home/osakanataro> $results | Export-Csv test.csv -Encoding UTF8 -No  (タブ補完で候補を出す)
NoClobber          NoOverwrite        NoTypeInformation
PS /home/osakanataro> $results | Export-Csv test.csv -Encoding UTF8 -NoTypeInformation
PS /home/osakanataro>

出力結果のcsvは、Windows上のPowerShellで実行した場合と同じ書式のモノとなりました。

$PSVersionTableの内容は下記のようになっていました。

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.0.0-alpha
PSEdition                      Core
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   3.0.0.0
GitCommitId                    v6.0.0-alpha.15
CLRVersion
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

以下はおまけ。
Microsoftのレポジトリとして指定されている「https://packages.microsoft.com/rhel/7/prod/」とか「https://packages.microsoft.com/config/rhel/7/」を見ていくとなかなか面白い
https://packages.microsoft.com/config/rhel/7/mssql-server.repo」という用にCentOS7向けのMSSQL Serverっぽいレポジトリファイルがある。RPMファイルは「https://packages.microsoft.com/rhel/7/mssql-server/」にある。

MSSQL Serverのインストール手順については「Install SQL Server on Linux」を参照のこと。

vSphere PowerCLIの一部コマンドがPowerShell ISEで動作しない 2016/12/15版


2017/02/27追記
Windows環境以外でも動作するPowerCLI Coreが登場し、この手順を行おうとしたら、モジュール名が異なり実施できませんでした。
PowerCLIとPowerCLI Coreの双方で動くPowerShellスクリプトの作り方」に、対処方法を記載しています。


1年前に「vSphere PowerCLIの一部コマンドがPowerShell ISEで動作しない」というのを書いた。

最近、環境を作り直すのと一緒にPowerShellを最新にして、そして、PowerCLIを最新の6.5にしてみた。(New Release: PowerCLI 6.5 R1)

以前と同じように、PowerShell ISE上で「Add-PSSnapin VMware.VimAutomation.Core」を実行すると、「Add-PSSnapin : No snap-ins have been registered for Windows PowerShell version 5.」というエラーが発生。
「Add-PSSnapin」は使わないようだ。

 C:\Users\test3> Add-PSSnapin VMware.VimAutomation.Core


Add-PSSnapin : No snap-ins have been registered for Windows PowerShell version 5.
At line:1 char:1
+ Add-PSSnapin VMware.VimAutomation.Core
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (VMware.VimAutomation.Core:String) [Add-PSSnapin], PSArgumentException
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand
 

 C:\Users\test3> 

代替はなんだろ?と確認すると「Import-Module -Name VMware.VimAutomation.Core」。

いままでスクリプトにAdd-PSSnapin~と書いていたところを、どちらでも対応できるように書き換えるとすると、下記のようになるだろうか?

if ( $PSVersionTable.PSVersion.Major -lt 5){
    Add-PSSnapin VMware.VimAutomation.Core
}else{
    Import-Module -Name VMware.VimAutomation.Core
}

下記は参考資料の実行ログ

PS C:\Users\test3> Get-Module

ModuleType Version    Name                                ExportedCommands                                                                           
---------- -------    ----                                ----------------                                                                           
Script     1.0.0.0    ISE                                 {Get-IseSnippet, Import-IseSnippet, New-IseSnippet}                                        
Manifest   3.1.0.0    Microsoft.PowerShell.Management     {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Content...}                         
Manifest   3.1.0.0    Microsoft.PowerShell.Utility        {Add-Member, Add-Type, Clear-Variable, Compare-Object...}                                  



PS C:\Users\test3> Get-Module -ListAvailable


    Directory: C:\Program Files\WindowsPowerShell\Modules


ModuleType Version    Name                                ExportedCommands                                                                           
---------- -------    ----                                ----------------                                                                           
Binary     1.0.0.1    PackageManagement                   {Find-Package, Get-Package, Get-PackageProvider, Get-PackageSource...}                     
Script     1.0.0.1    PowerShellGet                       {Install-Module, Find-Module, Save-Module, Update-Module...}                               


    Directory: C:\Windows\system32\WindowsPowerShell\v1.0\Modules


ModuleType Version    Name                                ExportedCommands                                                                           
---------- -------    ----                                ----------------                                                                           
Manifest   1.0.0.0    AppLocker                           {Set-AppLockerPolicy, Get-AppLockerPolicy, Test-AppLockerPolicy, Get-AppLockerFileInform...
Manifest   1.0.0.0    BitsTransfer                        {Add-BitsFile, Remove-BitsTransfer, Complete-BitsTransfer, Get-BitsTransfer...}            
Manifest   1.0.0.0    CimCmdlets                          {Get-CimAssociatedInstance, Get-CimClass, Get-CimInstance, Get-CimSession...}              
Script     1.0.0.0    ISE                                 {New-IseSnippet, Import-IseSnippet, Get-IseSnippet}                                        
Manifest   1.0.0.0    Microsoft.PowerShell.Archive        {Compress-Archive, Expand-Archive}                                                         
Manifest   3.0.0.0    Microsoft.PowerShell.Diagnostics    {Get-WinEvent, Get-Counter, Import-Counter, Export-Counter...}                             
Manifest   3.0.0.0    Microsoft.PowerShell.Host           {Start-Transcript, Stop-Transcript}                                                        
Manifest   3.1.0.0    Microsoft.PowerShell.Management     {Add-Content, Clear-Content, Clear-ItemProperty, Join-Path...}                             
Script     1.0        Microsoft.PowerShell.ODataUtils     Export-ODataEndpointProxy                                                                  
Manifest   3.0.0.0    Microsoft.PowerShell.Security       {Get-Acl, Set-Acl, Get-PfxCertificate, Get-Credential...}                                  
Manifest   3.1.0.0    Microsoft.PowerShell.Utility        {Format-List, Format-Custom, Format-Table, Format-Wide...}                                 
Manifest   3.0.0.0    Microsoft.WSMan.Management          {Disable-WSManCredSSP, Enable-WSManCredSSP, Get-WSManCredSSP, Set-WSManQuickConfig...}     
Manifest   1.0.0.0    NetworkSwitchManager                {Disable-NetworkSwitchEthernetPort, Enable-NetworkSwitchEthernetPort, Get-NetworkSwitchE...
Manifest   1.1        PSDesiredStateConfiguration         {Set-DscLocalConfigurationManager, Start-DscConfiguration, Test-DscConfiguration, Publis...
Script     1.0.0.0    PSDiagnostics                       {Disable-PSTrace, Disable-PSWSManCombinedTrace, Disable-WSManTrace, Enable-PSTrace...}     
Binary     1.1.0.0    PSScheduledJob                      {New-JobTrigger, Add-JobTrigger, Remove-JobTrigger, Get-JobTrigger...}                     
Manifest   2.0.0.0    PSWorkflow                          {New-PSWorkflowExecutionOption, New-PSWorkflowSession, nwsn}                               
Manifest   1.0.0.0    PSWorkflowUtility                   Invoke-AsWorkflow                                                                          
Manifest   1.0.0.0    TroubleshootingPack                 {Get-TroubleshootingPack, Invoke-TroubleshootingPack}                                      


    Directory: C:\Program Files (x86)\VMware\Infrastructure\PowerCLI\Modules


ModuleType Version    Name                                ExportedCommands                                                                           
---------- -------    ----                                ----------------                                                                           
Binary     6.0.0.0    VMware.DeployAutomation                                                                                                        
Binary     6.0.0.0    VMware.ImageBuilder                                                                                                            
Binary     6.5.0.4... VMware.VimAutomation.Cis.Core                                                                                                  
Binary     6.5.0.4... VMware.VimAutomation.Cloud                                                                                                     
Manifest   6.5.0.4... VMware.VimAutomation.Common                                                                                                    
Binary     6.5.0.2... VMware.VimAutomation.Core           HookGetViewAutoCompleter                                                                   
Binary     6.0.0.0    VMware.VimAutomation.HA                                                                                                        
Binary     7.0.2.4... VMware.VimAutomation.HorizonView                                                                                               
Binary     6.5.0.4... VMware.VimAutomation.License                                                                                                   
Binary     6.5.0.4... VMware.VimAutomation.PCloud                                                                                                    
Manifest   6.5.0.4... VMware.VimAutomation.Sdk            Get-PSVersion                                                                              
Binary     6.5.0.4... VMware.VimAutomation.Storage                                                                                                   
Binary     6.5.0.4... VMware.VimAutomation.Vds                                                                                                       
Binary     6.5.0.4... VMware.VimAutomation.vROps                                                                                                     
Binary     6.0.0.0    VMware.VumAutomation                                                                                                           



PS C:\Users\test3> Import-Module -Name VMware.VimAutomation.Core

 C:\Users\test3> Get-Module

ModuleType Version    Name                                ExportedCommands                                                                           
---------- -------    ----                                ----------------                                                                           
Script     0.0        Initialize-VMware_VimAutomation_Cis                                                                                            
Script     1.0.0.0    ISE                                 {Get-IseSnippet, Import-IseSnippet, New-IseSnippet}                                        
Manifest   3.1.0.0    Microsoft.PowerShell.Management     {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Content...}                         
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-VirtualSwitchPhysicalNetworkAdapter, Add-VMHost, Add-VMHostN...
Manifest   6.5.0.4... VMware.VimAutomation.Sdk            Get-PSVersion                                                                              



 C:\Users\test3> 

なお、PowerCLI 6.5を起動した場合に読み込まれているモジュール一覧は以下の通り

          Welcome to VMware PowerCLI!

Log in to a vCenter Server or ESX host:              Connect-VIServer
To find out what commands are available, type:       Get-VICommand
To show searchable help for all PowerCLI commands:   Get-PowerCLIHelp
Once you've connected, display all virtual machines: Get-VM
If you need more help, visit the PowerCLI community: Get-PowerCLICommunity

       Copyright (C) VMware, Inc. All rights reserved.


PowerCLI C:\> Get-Module

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     0.0        Initialize-VMware.VimAutomation....
Script     0.0        Initialize-VMware.VimAutomation....
Script     0.0        Initialize-VMware.VimAutomation....
Script     0.0        Initialize-VMware_DeployAutomation
Script     0.0        Initialize-VMware_VimAutomation_Cis
Script     0.0        Initialize-VMware_VumAutomation
Manifest   3.1.0.0    Microsoft.PowerShell.Management     {Add-Computer, Add...
Manifest   3.1.0.0    Microsoft.PowerShell.Utility        {Add-Member, Add-T...
Binary     6.0.0.0    VMware.DeployAutomation             {Add-DeployRule, A...
Binary     6.0.0.0    VMware.ImageBuilder                 {Add-EsxSoftwareDe...
Binary     6.5.0.4... VMware.VimAutomation.Cis.Core       {Connect-CisServer...
Binary     6.5.0.4... VMware.VimAutomation.Cloud          {Add-CIDatastore, ...
Manifest   6.5.0.4... VMware.VimAutomation.Common
Binary     6.5.0.2... VMware.VimAutomation.Core           {Add-PassthroughDe...
Binary     6.0.0.0    VMware.VimAutomation.HA             Get-DrmInfo
Binary     7.0.2.4... VMware.VimAutomation.HorizonView    {Connect-HVServer,...
Binary     6.5.0.4... VMware.VimAutomation.License        Get-LicenseDataMan...
Binary     6.5.0.4... VMware.VimAutomation.PCloud         {Connect-PIServer,...
Manifest   6.5.0.4... VMware.VimAutomation.Sdk            Get-PSVersion
Binary     6.5.0.4... VMware.VimAutomation.Storage        {Copy-VDisk, Expor...
Binary     6.5.0.4... VMware.VimAutomation.Vds            {Add-VDSwitchPhysi...
Binary     6.5.0.4... VMware.VimAutomation.vROps          {Connect-OMServer,...
Binary     6.0.0.0    VMware.VumAutomation                {Add-EntityBaselin...


PowerCLI C:\>