Below is the code I\'m using to find users created date and last logon date which is then written to a .csv file.
$users=Get-ADuser -SearchBase \"OU=testou1,dc=U
Just so you know echo
in PowerShell is actually an alias for Write-Output
.
PS Z:\> get-alias echo
CommandType Name ModuleName
----------- ---- ----------
Alias echo -> Write-Output
If you look at the TechNet article it does not natively support any append type parameter or newline suppression. That does not mean you can't do it. Just not without any help.
echo
/Write-Output
would just be sending data to the output stream. Is there a reason you need your text to do that? Is there by chance a better example you can provide of what you are trying to accomplish? FYI there are other cmdlets at work behind the scenes that being used as well like Out-Default
Write-Host
is really what you want. Yes I am aware you said you didn't want it but I wanted you to see for sure.
PS Z:\> Write-host "Hai" -NoNewline; Write-Host "Hello"
HaiHello