powershell - How can I specify the type of a parameter when the object type is from a web service? -
i'm writing powershell module. have get-myperson function accepts identity parameter, calls web service , returns object of type person (the return type web service).
i'm working on set-myperson object update couple of properties. want able is:
set-myperson 1234 -golfhandicap 22 get-myperson jdoe | set-myperson -golfhandicap 22
(the latter following get-aduser | set-aduser usage)
this requires set-myperson accept parameter of type string former , parameter of type person latter, using parameter sets distinguish.
i have basic functionality working string struggling parameter person objects.
[parameter(parametersetname="person",mandatory=$true,valuefrompipeline=$true,valuefrompipelinebypropertyname=$true)] [person]$person,
won't work because powershell doesn't recognize person (as expected):
set-myperson : unable find type [person]: make sure assembly containing type loaded.
how can powershell recognize person class?
do try [object]
or [psbject]
?
Comments
Post a Comment