Please test if below code works for you.
$PortFil = 'C:\data\ScriptLAB\SwitchType_C2960G_8port.txt'
$CSVports = Import-Csv -Path $PortFil -Delimiter ' '
Please test if below code works for you.
$PortFil = 'C:\data\ScriptLAB\SwitchType_C2960G_8port.txt'
$CSVports = Import-Csv -Path $PortFil -Delimiter ' '