Powershell cheat sheet

From Coolscript
Revision as of 14:08, 22 March 2021 by Admin (talk | contribs) (Created page with " $allscopes = @() $cnt++ $allscopes += ,($cnt,"Val1-1","Val1-2","Val1-3") $cnt++ $allscopes += ,($cnt,"Val2-1","Val2-2","Val2-3") $cnt++ $allscopes += ,($cnt,"Val3-1"...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
$allscopes = @() 
$cnt++
$allscopes += ,($cnt,"Val1-1","Val1-2","Val1-3") 
$cnt++
$allscopes += ,($cnt,"Val2-1","Val2-2","Val2-3") 
$cnt++
$allscopes += ,($cnt,"Val3-1","Val3-3","Val3-3") 


foreach ($row in @($allscopes)) {
 write-output "->$($row[0]) <--> $($row[1]) <--> $($row[2])  <--> $($row[3]) <-"
}


#Modify cell
for ( $index = 0; $index -lt $allscopes.count; $index++ )  {
   $allscopes[$index][0] = "X"
}
write-output "------------"
foreach ($row in @($allscopes)) {
 write-output "->$($row[0]) <--> $($row[1]) <--> $($row[2])  <--> $($row[3]) <-"
}