Updated Display Name string builder to more flexible format. {0}
and {1}
are positional indicators.
-f $FirstName,$LastName
defines an array of objects to pass into the string in whatever positions desired.
Example Usage:
PS> $FirstName = 'Nate'
PS> $LastName = 'Webb'
PS> "{0} {1}" -f $FirsName,$LastName
Nate Webb
PS>
If you wanted the Display Name to be reversed ('Webb Nate') simply reverse the positional indicators {1}
and {0}
like so:
PS> $FirstName = 'Nate'
PS> $LastName = 'Webb'
PS> "{1} {0}" -f $FirsName,$LastName
Webb Nate
PS>
You can also mix and match, or duplicate:
PS> $FirstName = 'Austin'
PS> $MiddleName = 'Danger'
PS> $LastName = 'Powers'
PS> "{0}...{1} {2}. (awkward silence)...'Yeah Baby!' `n`n -{0} {2}" -f $FirstName,$MiddleName,$LastName
Austin...Danger Powers. (awkward silence)...'Yeah Baby!'
-Austin Powers
PS>