Using PowerShell, I need to loop on all the files in a folder and for each file run a command.
For example:
In folder C:\Users\Administrator\Documents\scripts
I have these files: user_1.csv, user_2.csv, ... user_N.csv
For each file I need to run this command:
Import-Csv .\user_N.csv | New-ADUser -Enabled $True -AccountPassword (ConvertTo-SecureString Pass123 -AsPlainText -force)
This command should be inside a loop that iterates all the files in the folder Any suggestion?