How to save each line of text file as array through powershell

The Get-Content command returns each line from a text file as a separate string, so will give you an array (so long as you don’t use the -Raw parameter; which causes all lines to be combined to a single string). [string[]]$arrayFromFile = Get-Content -Path ‘C:\USER\Documents\Collections\collection.txt’ In his excellent answer, mklement0 gives a lot more detail … Read more

How to get all 24 rotations of a 3-dimensional array?

A die (half a pair of dice) is handy for observing the 24 different orientations, and can suggest operation sequences to generate them. You will see that any of six faces can be uppermost, and the sides below can be rotated into four different cardinal directions. Let us denote two operations: “turn” and “roll”, where … Read more

tech