r/PowerShell • u/Dirty_Panda715 • Dec 04 '25
Scripting Help
Hello everyone. I am trying to create a script that creates new ad users by using a csv file. I am struggling with the display name variable. I am setting display name has a variable. I have $DisplayName = “($user.’FIRST NAME’) + ($user.’LAST NAME’)”. Can someone help me figure out why it’s not working?
2
Upvotes
View all comments
Show parent comment
1
u/BlackV Dec 04 '25 edited Dec 04 '25
Downvotes cause
$DisplayName = "$($user.'FIRST NAME') $($user.'LAST NAME')"would achieve the same-fformat operator would likely have worked better'{0} {1}' -f $user.'FIRST NAME', $user.'LAST NAME'Would be my guesses, nothing you wrote is "wrong" for sure
No one is