What is the proper way to specify the Name
part of the object after a pipe?
Actual Answer Remove the Select
from the pipe and go direct such as
dir $staging | Write-Host -ForegroundColor DarkCyan
Setup
I am doing a directory listing to the output and I want to use Write-Host
to achieve that, but what is need to discriminate out the object boxing and just show Name
.
Command dir | select Name | Write-Host -ForegroundColor DarkCyan
but the output to the console looks like this
How can this be done to show just the values of Name
?