Trying to export a customized WMI Namespace:
I know it is easy to query and use:
ROOT\CIMV2
Have a need to export the entire customized Namespace:
ROOT\CustomName
and then import on another computer.
Did find: https://stackoverflow.com/a/5363099/175063
I have tried the following in PowerShell:
Get-WMIObject -namespace "root" -class "__Namespace" | Select Name
But, now I need to export "CustomName" and it's class structure.
I am getting closer on this - testing (note: CIMV2, as I want to check for an export from known, good namespace. I will replace with CustomName later).
https://stackoverflow.com/a/32258127/175063
(GWMI -Namespace "root\CIMV2" -List).GetText('mof') |
Out-File c:\scripts\file.mof
On the machine in question, we will use:
(GWMI -Namespace "root\CustomName" -List).GetText('mof') |
Out-File c:\scripts\file.mof
Now, I need to figure out the import component.
UPDATE: It is a Windows 7 Machine and does not like the:
.GetText('mof')
And shows us:
Method invocation failed because [System.Object[]] doesn't contain a method named 'gettext
Checking the vesion of PowerShell, we have: 2.0
On my Windows 10 system (local) it shows: 5.1.14393.2248