Table of Contents
$var = -join(“Hello”, ” “, “world”);
Stores “Hello world” to $var.
So to output, in one line:
Write-Host (-join(“Hello”, ” “, “world”))
Write-Host “$($products.Id) – $($products.Name) – $($products.Owner)”
Write-Host (“{0} – {1} – {2}” -f $products.Id,$products.Name,$products.Owner )
Or just (but I don’t like it 😉 ):
Write-Host $products.Id ” – ” $products.Name ” – ” $products.Owner
$string = $products.ID
$string += ” – ”
$string += $products.Name
$string += ” – ”
$string += $products.Owner
Write-Host $string
Write-Host “$($products.Id) – $($products.Name) – $($products.Owner)”
I will add more ways for below soon and comment you would like to be soon rather than later
How to install of FireFox browser using PowerShell Sometimes you would like to install Firefox…
Quick way to install chrome on windows with Powershell? Launch the Powershell and run below…
How to Fix PowerShell Script Not Digitally Signed Error? When a script with a .ps1…
Powershell Cheat Sheet for beginners PowerShell has become something of an ace in the hole…
Today we discuss one of a few questions a lot of sysadmins and IT Admins…
Backing Up an SQL Database with PowerShell Before making any changes in the production environment,…
This website uses cookies.