Home Forums Programming Powershell How to get list of pending HotfixID from a remote server using Powershell RE: How to get list of pending HotfixID from a remote server using Powershell

  • PS C:\Windows\System32\WindowsPowerShell\v1.0> $upd = new-object -com Microsoft.Update.Session "MyServerName"

    $searcher = $upd.CreateUpdateSearcher()

    $searcher

    New-Object : A positional parameter cannot be found that accepts argument 'MyServerName'.

    At line:1 char:8

    + $upd = new-object -com Microsoft.Update.Session "MyServerName"

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo : InvalidArgument: (:) [New-Object], ParameterBindingException

    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.NewObjectCommand

    You cannot call a method on a null-valued expression.

    At line:2 char:1

    + $searcher = $upd.CreateUpdateSearcher()

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo : InvalidOperation: (:) [], RuntimeException

    + FullyQualifiedErrorId : InvokeMethodOnNull