Fjärilsmannen
❔ C# Powershell, pipe one script to another?
it doesn't seem to follow the position rules that strictly,
so I don't know when i can actually trust it. It says it will use the parameter at position 0, but it seems to only care about that if it's the same type (i tested with int and string). If i know what rules it's working on then i would feel safer using it
8 replies
How do you get the output type from a powershell script with System.Management.Automation?
hmm, is there some better way to se the output type?
It's meant to be read from C# and i'm in control of the scripts, so just having a way to set a real type that can be read would be best.
The same way you can with normal parameters.
For example a dummy variable perhaps, not sure if those can be read though.
21 replies
How do you get the output type from a powershell script with System.Management.Automation?
@jothay Not sure what the property is here?
@jcotton42
That's basically how i find it right now, though it's not a function but the script itself.
But as you can see it doesn't show the proper type, it's seen as
System.Type
and TypeName
is simply just the text it shows,
so it will show whatever you write and doesn't indicate the actual type here it seems.21 replies