2016年7月20日水曜日

◆Windows10でのWindowsUpdateのログ

いつも苦労するWindowsUpdate

Windows10ではPowerShellコマンドを使わないとログが見れないのだとか。
http://www.atmarkit.co.jp/ait/articles/1607/15/news035_4.html

また、ログに吐かれたIDをWebから検索して詳細を表示する仕掛けらしいのだが、見つからないIDが結構ある。(UnKnownで表示される)

UnKnownは邪魔なのでスキップして表示するようにしてみた。

001
002
003
004
005
006
007
008
009
010
011
012
013
014

filter grep
{
 
param
(
 
$keyword,
  [switch]$notmatch
)
 
$_ | Out-String -Stream |
 
      
Select-String -Pattern $keyword -NotMatch:$notmatch
 
}


$logPath = "D:\desktop\WindowsUpdate.log"
Get-WindowsUpdateLog -LogPath $logPath
(Get-Content $logPath |
 
   
grep -keyword "Unknown" -notmatch)  | Out-File $logPath

結果は以下のような感じ。
image