Afternoon all.
I’m trying to update csv cells after finding the right one… It works on small files but my sheet is 15,000 rows and my script hangs…
Is there anyway to improve it?
function bookINGEM { $Eng = (get-qaduser $user).displayName $DelDate = (Get-Date -format d) $Refe = $SerialRef.text $file = "C:\temp\Tracker.csv" $csv = Import-Csv $file foreach($row in $csv) { if ($row.SerialNo -eq $Refe) { $row.HostName = $BoxHost.text $row.Asset = $BoxAsset.text $row.Location = "LOCXXXXXX" $row.LifeCycleStatus = "In Stock" $row.SubStatus = "Available" $row.Date = $DelDate $row.Updated = $Eng } $csv | Export-Csv $file -NoTypeInformation; } $StatusBarPanel.text = "Updated" }