Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Don't Display "for" Output

$
0
0

Hi everyone,

i have a problem that i can't solve... this is my script:

param([string]$PktFile  = $( Read-Host "InputPkt" )
#[string]$MailFile = $( Read-Host "InputMail" )
)

$pos=$PktFile.IndexOf(".")
$CSV=$PktFile.Substring(0,$pos)
$CSV = $CSV + ".txt"
Rename-Item c:\$PktFile $CSV
$Import=@(Import-Csv C:\$CSV)
$Lista = New-Object System.Collections.ArrayList
for($i=0; $i -le ($Import.Length - 1);$i++){
$Lista.Add(($Import.Get($i) | ForEach-Object {$_.Pacchetti; $_.Azione; $_.Tipo_Dipendenza; $_.Pacchetti_Dipendenti}))
$Lista

}

And this is the output

0
SIRWEB_xxxxxxxxxxxxxxxxxxx
Promozione
Promozione
SITO_CARGO_xxxxxxxxxxxxxxx

why is displayed the value of $i of the for? How can i prevent this?

Thanks

Cristian



Viewing all articles
Browse latest Browse all 15028

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>