Answered by:
Windows Update List Query

Question
-
Hello.
I'm developing WindowsUpdate Custom Control Function of Windows10.(and the lower versions already completed.
I'm using IUpdateSearcher2, and the code is below.
sQuery = _T("isinstalled=1");
pUpdateSearcher->Search(CComBSTR(sQuery), &pResult);
I thought, this function is usable in the Windows Power Shell, so, I found the script, and execute the query in Windows 7, and it worked!
But, I run the query in Windows 10, but it didn't worked.
So, I'm just qurious. Is there any method to query Windows Core Update List using PowerShell or any other methods in Windows 10?
$Session
=
New-Object
-ComObject
Microsoft.Update.Session
$Searcher
=
$Session
.CreateUpdateSearcher()
$Criteria
=
"IsInstalled=1"
$SearchResult
=
$Searcher
.Search(
$Criteria
)
$SearchResult
.Updates
It works in Windows 7(return update list), but dosen't work in Windows 10.(return 0 list)
- Moved by Jack Zhai-MSFTMicrosoft contingent staff Wednesday, February 3, 2016 5:30 AM Not the debugger tool issue.
Monday, February 1, 2016 2:51 AM
Answers
-
Hi yangil06,
Thank you for posting in the MSDN forum. It seems that it is not the correct forum for this issue, since this forum is to discuss Visual Studio debugger tool. I am moving your question to the moderator forum ("Where is the forum for..?"). The owner of the forum will direct you to a right forum.
In addition, it seems that the windows or the windows PowerShell has his own supported site:
http://answers.microsoft.com/en-us/windows/forum/windows_10?tab=Threads
https://social.technet.microsoft.com/Forums/office/en-US/home?forum=winserverpowershell
I think we would make sure that whether it is related to the project itself or the PowserShell or the windows firstly.
Thanks,
Jack
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Proposed as answer by Mike Laughlin Wednesday, February 3, 2016 2:07 PM
- Marked as answer by Just Karl Wednesday, February 10, 2016 8:21 PM
Wednesday, February 3, 2016 5:30 AM -
Or also try over here.
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows]
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.- Proposed as answer by Mike Laughlin Wednesday, February 3, 2016 2:07 PM
- Marked as answer by Just Karl Wednesday, February 10, 2016 8:21 PM
Wednesday, February 3, 2016 2:05 PM
All replies
-
Hi yangil06,
Thank you for posting in the MSDN forum. It seems that it is not the correct forum for this issue, since this forum is to discuss Visual Studio debugger tool. I am moving your question to the moderator forum ("Where is the forum for..?"). The owner of the forum will direct you to a right forum.
In addition, it seems that the windows or the windows PowerShell has his own supported site:
http://answers.microsoft.com/en-us/windows/forum/windows_10?tab=Threads
https://social.technet.microsoft.com/Forums/office/en-US/home?forum=winserverpowershell
I think we would make sure that whether it is related to the project itself or the PowserShell or the windows firstly.
Thanks,
Jack
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Proposed as answer by Mike Laughlin Wednesday, February 3, 2016 2:07 PM
- Marked as answer by Just Karl Wednesday, February 10, 2016 8:21 PM
Wednesday, February 3, 2016 5:30 AM -
Or also try over here.
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows]
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.- Proposed as answer by Mike Laughlin Wednesday, February 3, 2016 2:07 PM
- Marked as answer by Just Karl Wednesday, February 10, 2016 8:21 PM
Wednesday, February 3, 2016 2:05 PM -
I suggest asking in the Win10 forums first. The PowerShell forum that has been linked to does not make any distinction of what OS you're running and we may not be as equipped to help with OS-specific quirks. I don't run Win10, so even though I'm very active in that forum I would not be able to help you with this question.
If you run out of options though, try posting there anyway.
Good luck.
Wednesday, February 3, 2016 2:10 PM -
Hello,
For what it's worth, your script produces results on my Windows 10 Enterprise system.
Karl
When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
My Blog: Unlock PowerShell
My Book: Windows PowerShell 2.0 Bible
My E-mail: -join('6D73646E5F6B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})Wednesday, February 10, 2016 8:26 PM