Convertfrom-csv

Powershell is a very object oriented scripting language, so recommend trying to understand that concept:

Understanding PowerShell Objects | Petri IT Knowledgebase

A CSV is a flat-file data structure. The main purpose is getting external data into Powershell so that cmdlets can use it. All the developer is doing is trying to get data converted into something that Powershell can use, a PSObject, these all do the same thing:

#Older method
$psObject = @()
$psObject += New-Object -TypeName psobject -Property @{FirstName='John';LastName='Smith'}
$psObject += New-Object -TypeName psobject -Property @{FirstName='Sally';LastName='Wu'}


#Newer method with pscustomobject accelerator
$psObject = @()
$psObject += [pscustomobject]@{FirstName='John';LastName='Smith'}
$psObject += [pscustomobject]@{FirstName='Sally';LastName='Wu'}

#csv method
$psObject = @"
FirstName,LastName
John,Smith
Sally,Wu
"@ | ConvertFrom-Csv

In that example provided, they are using a Here-String with just the data and adding a Name header (Same thing as FirstName and LastName above):

#Same thing, different way of doing it
@'
Name
MSSQLSvc/W1092T0071.domainl:tst_01
MSSQLSvc/W1092T0097.domain.nl:1433
MSSQLSvc/W1092T0097.domain.nl:tst_01
'@  | ConvertFrom-CSV

Here is another more structured way of doing the same thing (except removed Select -First 1 to process all rows, not just the first):

$myInstances = @'
Name
MSSQLSvc/W1092T0071.domainl:tst_01
MSSQLSvc/W1092T0097.domain.nl:1433
MSSQLSvc/W1092T0097.domain.nl:tst_01
'@ | ConvertFrom-Csv 

foreach ($spn in $myInstances) {
    $command = "setspn.exe -D $($spn.Name) sacicappsql"
    Write-Host "Executing command: $command"
    # Invoke-Expression $command
}

Results in the same end result (except removed Select -First 1 to process all rows, not just the first):

Executing command: setspn.exe -D MSSQLSvc/W1092T0071.domainl:tst_01 sacicappsql
Executing command: setspn.exe -D MSSQLSvc/W1092T0097.domain.nl:1433 sacicappsql
Executing command: setspn.exe -D MSSQLSvc/W1092T0097.domain.nl:tst_01 sacicappsql