Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

Creating some PowerShell cmdlets for managing windows updates via WUApiLib

$
0
0

Ok, I have written a pure windows powershell module that allows me to manage updates from the command-line. You can find it here https://code.google.com/p/mod-posh/source/browse/powershell/production/includes/WindowsUpdateLibrary.psm1 and it works pretty well. I've recently, as of this past week, decided to start porting those all over to C#.

So since the windowsupdate one was my most recent, I decided I would start with it. It's rather small, and not terribly complicated, at least when apparently powershell does all the heavy lifting. The code for this can be found here https://code.google.com/p/mod-posh/source/browse/C-Sharp/WindowsUpdateLibrary/WindowsUpdateLibrary/Class1.cs.

The issue i'm having is that when I run my cmdlet get-wuupdate I get a list of updates back. In fact, my code if you look outputs those as wuapilib.iupdate updates. Then the idea is that those would be passed along the pipe to start-wudownload, as it accepts wuapilib.iupdate update as a param.

problem is that these appear to be spit out as System.__ComObject's and i'm unable to figure out how to receive them as a paramm, I think if I fix that I can just cast them as wuapilib.iupdates.

Thanks,.


Jeffrey S. Patton Jeffrey S. Patton Systems Specialist, Enterprise Systems University of Kansas 1001 Sunnyside Ave. Lawrence, KS. 66045 (785) 864-0242 | http://patton-tech.com


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>