Skip to content

Convert-String has incorrect example  #1257

@zjalexander

Description

@zjalexander

Issue Details

see #1236 : example #1 of convert-string.MD doesn't work

Convert-String -InputObject $Names -Example "Patti Fuller = Fuller, P."
Convert-String : Cannot convert 'System.Object[]' to the type 'System.String' required by parameter 'InputObject'.
Specified method is not supported.
At line:1 char:29
+ Convert-String -InputObject $Names -Example "Patti Fuller = Fuller, P ...
+                             ~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Convert-String], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgument,Microsoft.PowerShell.Commands.StringManipulation.ConvertStringComm
   and

'-InputObject' usually doesn't take a list, and you can't have blanks around the '=' sign.

PS> $Names | Convert-String -Example "Patti Fuller=Fuller, P."
Version(s) of document impacted

  • Impacts 6 document
  • Impacts 5.1 document
  • Impacts 5.0 document
  • Impacts 4.0 document
  • Impacts 3.0 document

Reason(s) for not selecting all version of documents

  • The documented feature was introduced in selected version of PowerShell
  • This issue only shows up in selected version of the document

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions