I am Very new to Powershell scripting.I have script to get folder details from share network path as below. (eg.\\INTBMCELB\Transport_Admin
)
$infile = 'C:\Paths\PathList.txt'
$outdir = 'C:\Export\'
foreach ($dir in (Get-Content $infile))
{
$outfile = Join-Path $outdir($dir -split '\\')[-1]
$outfilecsv=$outfile+'.csv'
Get-ChildItem -Path $dir -Filter *.* -Recurse | Select-Object FullName,CreationTime,@
{Name="Size";Expression={$_.Length}
} | Export-Csv -Path $outfilecsv -Encoding ascii -NoTypeInformation}
In each network path which is reading from text file, contain lots of data. There are around 2500 share paths needs to read. Currently it takes around 2 days time to complete it. Can I improve the performance better?
Can I add any changes to above script which makes execution time less than the current total execution time?