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

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -