Windows Vista Forums

XML and WMI
  1. #1


    fixitchris Guest

    XML and WMI

    This code works great...
    (get-WMIObject win32_operatingsystem).psbase.gettext("WmiDtd20") |
    Add-Content c:\test.xml



    How can I do the same with win32_systemdriver namespace? GETTEXT is not
    there..???



      My System SpecsSystem Spec

  2. #2


    Nigel Sharples Guest

    Re: XML and WMI

    Get-WmiObject win32_systemdriver returns an array, so you'll need to call
    gettext on the array elements, e.g. for the first one:

    (Get-WmiObject win32_systemdriver)[0].psbase.gettext("WmiDtd20")

    or for all of them:

    Get-WmiObject win32_systemdriver | %{$_.psbase.gettext("WmiDtd20")} |
    add-content test.xml

    --
    Nigel Sharples [MSFT]
    Windows PowerShell Test
    Microsoft Corporation
    This posting is provided "AS IS" with no warranties, and confers no rights.

    "fixitchris" <fixitchris@discussions.microsoft.com> wrote in message
    news:9736BE61-BF0A-4E76-A76B-F3A7A081DBB2@microsoft.com...
    > This code works great...
    > (get-WMIObject win32_operatingsystem).psbase.gettext("WmiDtd20") |
    > Add-Content c:\test.xml
    >
    > How can I do the same with win32_systemdriver namespace? GETTEXT is not
    > there..???
    >
    >



      My System SpecsSystem Spec

XML and WMI problems?