Every object has a view registered to it. The particular view defines which formatter to use. We discuss output more in depth in another tutorial. For additional Windows PowerShell Commands Please see following links..

There are many ways in which one can manipulate the objects. The simplest object to deal with and the one we are going to be working with in this tutorial is a string. The following code displays, Dan Daman:


$firstname = "Dan"
$lastname = "Daman"
$fullname = $firstname + " " + $lastname
write-output $fullname

Copy and Try it

Concatenate strings and variables in PowerShell?


$myObj = New-Object psobject -Property @{
    Id = 31
    Name = "Vinod Shitole"
    Owner = "XYZ"

Write-Host "$($myObj.Id) - $($myObj.Name) - $($myObj.Owner)"

31 - Vinod Shitole - XYZ