I want to execute all of the scripts (.ps1 files) inside a specific directory.
My script is as follows:
$fileEntries = [IO.Directory]::GetFiles("c:\scripts");
foreach($fileName in $fileEntries)
{
$fileName
}
The body of the loop would have to change. What should I change it to execute the scripts?
Thanks
Use the call operator (&) to execute the scripts: