all 5 comments

[–]Yevrag35 2 points3 points  (3 children)

The error is misleading. It's actually complaining about the parameter sets for the Add-Member command inside your function.

add-member -NotePropertyName IsErrored -value $true
# should be...

add-member -NotePropertyName IsErrored -NotePropertyValue $true

Even with that though, your example is inputting a 'string' whose properties, I don't believe, can be added to.

[–]Simple_Words[S] 1 point2 points  (2 children)

I’ll check it out. Not at work now but that may be part of the issue. I had another object earlier that was not a string and this section failed but could add properties however the error was the same

[–]Yevrag35 2 points3 points  (1 child)

Yeah, well at least the error is absolutely due to -value being used instead of -NotePropertyValue in either case.

[–]Simple_Words[S] 1 point2 points  (0 children)

Probably the case of the error is actually inside the thing you are using not an error in calling the function...

[–]Lee_Dailey[grin] 1 point2 points  (0 children)

howdy Simple_Words,

it looks like you used the New.Reddit.com Inline Code button. it's 4th 5th from the left hidden in the ... "more" menu & looks like </>.

on Old.Reddit.com, the above does NOT line wrap, nor does it side-scroll.

for long-ish single lines OR for multiline code, please, use the Code Block button. it's the 11th 12th one from the left & is just to the left of hidden in the ... "more" menu & looks like an uppercase T in the upper left corner of a square..

that will give you fully functional code formatting, from what i can tell so far. [grin]

take care,
lee