Versuchen Sie, $pass vor dem Piping einen Wert zuzuweisen:
$pass = convertto-securestring "abc123"-asplaintext -force
Import-Csv C:\sl.csv | ForEach-Object {New-Item $(Encode-Sqlname $_.Name) -ItemType Registration -Value ("server=$($_.Name);integrated security=true") -Credential (New-Object System.Management.Automation.PSCredential("sa", $pass)) }