Hi,
iam currently having trouble to execute my Start-Process with another user. I have to start the .exe with a specific Service User since it needs Access to a SQL Server
$credential = Get-Credential -Message "Service-User:"
Start-Process -FilePath "$PSScriptRoot\packages\installer.exe" -Credential $credential -WorkingDirectory "$PSScriptRoot\packages\" -ArgumentList "<my Arguments for the installer>" -Wait
When executing the Start-Process without “-Credential” it works perfectly (if the powershell is started with the named ServiceUser). But I want to execute this script with a diffrent admin user, who doesnt have SQL Server Access. And this just doesnt seem to work. I do get the followig Error:
Start-Process : This command cannot be run due to the error: The parameter is incorrect.
At C:<path>\Test.ps1:8 char:1
- Start-Process -FilePath “$PSScriptRoot\LicenseModuleSetup.exe” -Worki …
-
+ CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
Does someone know what Iam doing wrong?
Thanks!