Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

What can I do with the Method and Properties returned by Get-Member?

$
0
0

I’ve been using PowerShell for quite a while but came from a sysadmin route with no history of programming so have a lot of gaps in my knowledge.

I’m looking at WSUS at the moment and if I go $Update | Get Member for a particular update I get things like these:

Name MemberType Definition ---- ---------- ---------- AcceptLicenseAgreement Method void AcceptLicenseAgreement(), void IUpdate.AcceptLicenseAgreement() Approve Method Microsoft.UpdateServices.Administration.IUpdateApproval Approve(Microsoft.UpdateServices.Administration.Upda... Decline Method void Decline(), void Decline(bool failIfReplica), void IUpdate.Decline() IsApproved Property bool IsApproved {get;set;} IsBeta Property bool IsBeta {get;set;} IsDeclined Property bool IsDeclined {get;set;} IsEditable Property bool IsEditable {get;set;} 

I know that I can ‘Decline’ an update by running $update.Decline() but I can see that the IsApproved Property has bool IsApproved {get;set;} in the definition. Is this something I can use? Can I ‘set’ IsApproved to be ‘True’ somehow?

I’ve tried a few variations on guesses on how to use it, but they’ve failed me so far. Any help would be greatly appreciated.

submitted by /u/Suxtuby_Hugh
[link] [comments]

The post What can I do with the Method and Properties returned by Get-Member? appeared first on How to Code .NET.


Viewing all articles
Browse latest Browse all 8793

Trending Articles