Get-TypeName writes to host!?


It seems like Get-TypeName is writing to the host output, rather than the default output. For example:
$a = Get-TypeName 3
Prints 'Int32' to the screen, rather than assigning it to the variable $a. Reading the help, this may be by design, but if so the cmdlet is misnamed: a Get- cmdlet shouldn't behave like that. Perhaps it should be Show-TypeName.
Closed Jul 29, 2015 at 5:56 AM by r_keith_hill


wrote Jul 29, 2015 at 5:56 AM

Resolved with changeset 107796: Fixed issue where Get-TypeName only every outputs directly to the host. Now it only writes the typename to the host if -PassThru is used. This allows you to inject Get-TypeName into the middle of a pipeline with -PassThru which allows the pipeline to behave as it did before but you get to see the types flowing in the pipeline.