Forum Discussion
TECH-JEFF
May 22, 2020Copper Contributor
Get-WUHistory freezes
Hi, Recently we compiled Powershell cmdlets to get the windows updates history and save it to our website. It works perfectly fine with Server 2016 and Win 10 but we also have customers with Win 8.1...
mscottford
Dec 18, 2020Copper Contributor
VasuWindows I ran into this as well. I went searching for the source code for the https://www.powershellgallery.com/packages/PSWindowsUpdate/2.0.0.4 module but I could not find a reliable source for that. Instead, I attached a debugger and tried to figure out what was going on. It looks like there's an infinite loop when the -Last parameter is not specified. So I'm working around this problem by making sure I specify -Last 100. The command reliably stops in that case.
Here's a full example for clarity:
Get-WUHistory -MaxDate (Get-Date).AddDays(-30) -Last 100
I wish that this module's source code was hosted somewhere like GitHub because then I would be able to dig in deeper and hopefully provide a root cause fix to the problem.
VasuWindows
Jan 04, 2021Copper Contributor
Thansk much, it worked like charm . Great job mscottford