Now, I've been working on this problem for a couple days now and seem to have hit a wall due to my limited knowledge on PowerShell. For the first part of the code, I take the msi and copy it to the computer i intend to install it on remotely ($computer is the computer i remote to):
Get-Service remoteregistry -ComputerName $computer | start-service
Copy-item "path\to\msi\file.msi" -destination "\\$computer\c$\windows\temp\" -recurse
After that, I remote to the computer in question:
Enter-PSSession -ComputerName $computer -Credential domain\user
All the above commands work flawlessly and I can search to the directory and find the copied msi file on the remote computer. The problem is the installation step, if I run it on the computer directly, it works. However, if I run it remotely, like i planned to, it won't work:
$Arguments = "/i C:\Windows\Temp\file.msi /qb MO_B_MOINSTALL=0 MO_B_QDBINSTALL=1 MO_B_SQLSVR_WINAUTH=0 MO_SQLSVR_USER=user MO_SQLSVR_PWD=password MO_SQLSVR_NAME=$computer\SQL2008 MO_QDBNAME=QDBname /l c:\ProgramData\pslog.log"
Start-Process -FilePath "msiexec.exe" -ArgumentList $Arguments
MO_SQLSVR_WINAUTH is where i set it to use either windows auth (1) or sql auth (0), both work when run locally. When I run with sql auth, the installer seems to freeze and quit, as I can see in the log file for it's installation. When running with windows auth, the installer fails to install the section for sql, thus as far as I'm concerned, it fails overall. I also have the same windows logins on both computers. Is there something I'm missing or is maybe PowerShell not able to do what I'm wanting to do?
edit: I also have used on both computers: Enable-WSManCredSSP -Role server
Note: i have changed some parts from what they were originally (due to not wanting to give out my logins and passwords, ya know?).