Avatar of Fr. Vandecan
Fr. Vandecan
Flag for Belgium

asked on 

powershell : what's wrong ?

function ManageAdUsers($CsvFile)
{
$MyVariable = 99
$SAM = ""
$bAlreadyProcessed = $false

$Items = Import-Csv -path "$CsvFile" –delimiter ";" | foreach ($Item in $Items) {Write-Host $Item}

--> give this error
PS M:\ICT Manager\Scripts\PS1> .\importad.ps1
Unexpected token 'in' in expression or statement.
At M:\ICT Manager\Scripts\PS1\ImportAD.ps1:18 char:72
+ $Items = Import-Csv -path "$CsvFile" -delimiter ";" | foreach ($Item in <<<<
 $Items) {Write-Host $Item}
    + CategoryInfo          : ParserError: (in:String) [], ParseException
    + FullyQualifiedErrorId : UnexpectedToken
Powershell

Avatar of undefined
Last Comment
Daryl Bamforth

8/22/2022 - Mon