Howdy Spicy and Powershelling friends,
I'm (still ... gosh) working with PS and Excel to write down reports of folder analysis with robocopy.
It's all working, but now I want to speed up the process.
I've found a really good way to create the initial values (I mean, the first time the sheet is created and filled with robocopy values), using a .net array then throw it in the actual sheet :
Powershell
$count=$values.Countif($values.Count-eq$null){$count=1$rowtogo=2}else{$rowtogo=$values.Count+1}$arraynet=New-Object'object[,]'$count,3$i=0foreach($entryin$values){try{$arraynet[$i,0]=$entry.Root}catch{"!!!"}$arraynet[$i,1]=$entry.Directory$arraynet[$i,2]=$([string]$entry.size).replace(",",".")-as[double]$i++}$range=$sheetname.cells.range("A2:C$($rowtogo)")$range.value2=$arraynet
This...