On server 2012 R2, I'm mounting SQLServer media as a drive (works), but every time I launch the install using "Start-Process", the error "A positional parameter cannot be found that accepts argument '$null'" is always generated even though my paths and argumebnts are good (the install completes successfully).
$sqlreturn = Start-Process -FilePath "$DVDDriveLetter`\Setup.exe" -ArgumentList "$ArgumentList" -Wait
The install works, I do have a long Argument list, as a collection, which is also recognized correctly (all paramenters work for SQL). I have it write out the arguments using a foreach loop with Write-Verbose and eveything is recognized by Start-Process parameter "-ArgumentList" properly:
Write-Verbose "--- Full Argument List:"
foreach ($arg in $ArgumentList) {Write-Verbose $arg}
VERBOSE: --- Full Argument List:
VERBOSE: /ACTION=Install
VERBOSE: /IACCEPTSQLSERVERLICENSETERMS
VERBOSE: /X86=False
VERBOSE: /TCPENABLED=1
VERBOSE: /SQLSYSADMINACCOUNTS=DOMAIN\server_admins DOMAIN\SQLServer_admins
VERBOSE: /QS
VERBOSE: /FEATURES=SQLENGINE,REPLICATION,FULLTEXT,BIDS,CONN,IS,BC,SDK,BOL,SSMS,ADV_SSMS,SNAC_SDK
VERBOSE: /INSTANCENAME=MSSQLSERVER
VERBOSE: /INSTANCEID=MSSQLSERVER
VERBOSE: /SQLBACKUPDIR=C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Backup
VERBOSE: /SQLUSERDBDIR=C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Data
VERBOSE: /SQLUSERDBLOGDIR=C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Data
VERBOSE: /SQLTEMPDBDIR=C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Data
VERBOSE: /SQLTEMPDBLOGDIR=C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Data
VERBOSE: /SQLSVCACCOUNT=DOMAIN\MSAAccount1$
VERBOSE: /AGTSVCACCOUNT=DOMAIN\MSAAccount2$
VERBOSE: /ISSVCACCOUNT=DOMAIN\MSAAccount3$
VERBOSE: /SAPWD=System.Security.SecureString
VERBOSE: /SECURITYMODE=SQL
So why do I always get the error "A positional parameter cannot be found that accepts argument '$null'" with Start-Process even though the install works correctly?