November 2018
Intermediate to advanced
566 pages
17h 15m
English
This recipe is simple. We simply add another cmdlet to the first line of the script. Here is the flow:
The following script will accomplish this:
$Names = Get-Content ./ch09/02-names.txt | Sort-Object
$NewNames = @()
foreach ($Name in $Names) {
$Name = $Name -split ' '
$NewName = $Name[1], $Name[0] -join ', '
$NewNames += $NewName
}
$NewNames
Read now
Unlock full access