Hello,
at the moment i am trying to insert an element into an existing array. I already found this example:
$Names = @("Susan","Phil","Bob")
$Names = $Names[1] + "Sara" + $Names[2..3]
My current problem is that i try to insert an integer value into an array full of integers like:
get-process | sort-object ID | select-object CPU, Name, Description, ID | ForEach-Object {$StartCPU += ,$_.CPU; $StartID += ,$_.id}
#$i and $ end are just variables for an integer value
$StartID = $StartID[$i]+ '0' +$StartID[($+1)..($end-$i)]
I always get the message: Cannot convert "System.Object[]" to "System.Int32".
Is there a workaround for?
Thanks and greetz
Danny
I hope the software doesnt destroy the code this time 