I am trying to run a PowerShell script using the information contained within a .csv file.
My script is below:
Import-CSV \\chem-fp01\shared areas\IT\New IT Folder (Do Not Delete \\Powershell Scripts\Create New User.csv | ForEach-Object {
$Password = ConvertTo-SecureString $_.password -AsPlainText -Force
New-Mailbox -Name $_.Name
-FirstName $_.FirstName
-LastName $_.LastName
-Alias $_.Alias
-UserPrincipalName $_.UserPrincipalName
-Password $password
-ResetPasswordOnNextLogon $false
}
I am getting the error below and don't know what it means
Missing expression after unary operator '-'.
At C:\Scripts\CreateNewUser.psl:7 char:3
+ - <<<<LastName $_.LastName
+ CategoryInfo : ParserError: (-:String) [], ParseException
+ FullyQualifiedErrorId : MissingExpressionAfterOperator