1> Get-WmiObject Win32_Product
IdentifyingNumber : {8A7CAA24-7B23-410B-A7C3-F994B0944160}
Name : Microsoft Virtual PC 2007
Vendor : Microsoft Corporation
Version : 6.0.156.0
Caption : Microsoft Virtual PC 2007
Get-WmiObject : Generic failure
At line:1 char:14
+ Get-WmiObject <<<< Win32_Product
Any ideas what's going on here?
--
Keith
On my XP machine at work it took:
6> measure-command { gwmi win32_Product > InstalledProducts.txt }
Days : 0
Hours : 0
Minutes : 2
Seconds : 23
Milliseconds : 674
Ticks : 1436742418
TotalDays : 0.00166289631712963
TotalHours : 0.0399095116111111
TotalMinutes : 2.39457069666667
TotalSeconds : 143.6742418
TotalMilliseconds : 143674.2418
For about 141 installed products. If I use the registry it takes far less
time:
15> $selectExpr = @{Expression={(Get-ItemProperty $_.PSPath
DisplayName).DisplayName};Name='DisplayName'}
16> measure-command { dir
HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall | Select
PSChildName,$selectExpr }
Days : 0
Hours : 0
Minutes : 0
Seconds : 1
Milliseconds : 439
Ticks : 14394848
TotalDays : 1.66607037037037E-05
TotalHours : 0.000399856888888889
TotalMinutes : 0.0239914133333333
TotalSeconds : 1.4394848
TotalMilliseconds : 1439.4848
Of course, I get a bunch of duplicate entries...
--
Keith
"Keith Hill" <r_keit...@mailhot.nospamIdotcom> wrote in message
news:256A3BA9-BD1A-4815...@microsoft.com...
--
Jeffrey Snover [MSFT]
Windows PowerShell Architect
Microsoft Corporation
This posting is provided "AS IS" with no warranties, no confers rights.
Visit the Windows PowerShell Team blog at:
http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at:
http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx
The same seems to happen for several of the WMI classes related to this:
Win32_Product, Win32_ProductCheck, Win32_ProductResouce and
Win32_ProductSoftwareFeatures all take a surprisingly long time to complete.
Thanks. It's good to know that PowerShell isn't at fault with this issue.
--
Keith