Опитайте да зададете стойност на $pass преди тръбопровода:
$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)) }