2015年1月9日金曜日

PSWindowsUpdate

Windows Update PowerShell Module

Windows Update をコマンドで実行できる方法を調べていたら、以下を見つけた。
【メモ】PSWindowsUpdate -コマンドラインでWindows Update- (Windows Server 2012 R2 Essentials) 白吉さん ありがとうございます。
Vagrant な Windows8.1 で実行した時のメモを残しとく。
  1. Windows PowerShell(管理者)にて PowerShell の 実行ポリシー を確認。
    PS C:\> Get-ExecutionPolicy
    RemoteSigned
  2. コマンドプロンプト(管理者)にて Chocolateyのインストール
  3. コマンドプロンプト(管理者)にて Windows Update PowerShell Moduleのインストール
    C:\> cinst PSWindowsUpdate
  4. Windows PowerShell(管理者)にて モジュールのImport
    PS C:\> Import-Module PSWindowsupdate
  5. Windows PowerShell(管理者)にて 動作確認
    Get-Command -Module PSWindowsupdate
    CommandType Name ModuleName
    ----------- ---- ----------
    Function Add-WUOfflineSync pswindowsupdate
    Function Add-WUServiceManager pswindowsupdate
    Function Get-WUHistory pswindowsupdate
    Function Get-WUInstall pswindowsupdate
    Function Get-WUInstallerStatus pswindowsupdate
    Function Get-WUList pswindowsupdate
    Function Get-WURebootStatus pswindowsupdate
    Function Get-WUServiceManager pswindowsupdate
    Function Get-WUUninstall pswindowsupdate
    Function Hide-WUUpdate pswindowsupdate
    Function Invoke-WUInstall pswindowsupdate
    Function Remove-WUOfflineSync pswindowsupdate
    Function Remove-WUServiceManager pswindowsupdate
    Function Update-WUModule pswindowsupdate
  6. Windows PowerShell(管理者)にて Windows Updateを実施
    C:\> Get-WUList
    :
    :
    C:\> Get-WUInstall
    :
    :

0 件のコメント: