×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

parameters/ Arguments using powershell

parameters/ Arguments using powershell

parameters/ Arguments using powershell

(OP)
How can I install the parameters/ Arguments using powershell

Start-Process 'server\software$\Agent-6.11.1-x64.msi' -ArgumentList "/i /qn" "Agent='GROUP' SERVER=cloud.work.com:443 KEY=4cehdahdihaifdiahfidhfaduhfdjhf" -Wait
I get the same error in this website, but when I try his solution it does not work, the box still appears

https://stackoverflow.com/questions/46699870/how-t...



MCSE NT to 2012, MCITP:EA/SA, MCSA, MCDBA, MCTS, MCP+I, MCP

RE: parameters/ Arguments using powershell

(OP)
found one that works

$cmdhash=@{}
$cmdhash['FilePath'] = 'C:\Windows\System32\msiexec.exe'
$cmdhash['Wait'] = $true
$cmdhash['NoNewWindow'] = $true
$cmdhash['ArgumentList']=@()
$cmdhash['ArgumentList'] += '/i \\esd189.org\dfs\wpkg\software\Google\GAPS\googleappspasswordsync64.msi'
$cmdhash['ArgumentList'] += '/l*vx C:\programdata\gaps_msi_log.txt'
$cmdhash['ArgumentList'] += '/quiet'
$cmdhash['ArgumentList'] += 'DOMAIN="example.org"'
$cmdhash['ArgumentList'] += 'ADMIN_EMAIL="googlesync@example.org"'
$cmdhash['ArgumentList'] += 'CREDENTIALS_FILE="\\ds-01\c$\Users\svc-googlesync\Documents\example.json"'
$cmdhash['ArgumentList'] += 'BASE_DN="DC=example,DC=org"'
$cmdhash['ArgumentList'] += 'MAIL_ATTRIBUTE="userPrincipalName"'
# using splatting, run the process
Start-Process @cmdhash

MCSE NT to 2012, MCITP:EA/SA, MCSA, MCDBA, MCTS, MCP+I, MCP

RE: parameters/ Arguments using powershell

are you interested in if the MSI was successful or not?

I Hear, I Forget
I See, I Remember
I Do, I Understand

Ronald McDonald

RE: parameters/ Arguments using powershell

(OP)
it works on ssome msi files but I have others this does not work on

MCSE NT to 2012, MCITP:EA/SA, MCSA, MCDBA, MCTS, MCP+I, MCP

RE: parameters/ Arguments using powershell

historically i resorted to:

$WshShell = New-Object -ComObject Wscript.Shell
$objTask.ReturnCode = $WshShell.Run($objTask.Command + " " + $strParameters, 2, $TRUE)
Write-Log ("------ Task(" + $objTask.Name + ").ReturnCode = " + $objTask.ReturnCode) -AsInfo

Pretty ugly, but it was the early days of powershell and i was struggling to get it to wait and give me the returncode.
The above is bomb proof, clunky as you like though smile

This is an alternative (but i still stick with the above as it has never caused me issues):

Function ExecuteProc ($filename, $parms, $parms2)
{
$proc = New-Object System.Diagnostics.ProcessStartInfo
$proc.FileName = $filename
$proc.RedirectStandardError = $true
$proc.RedirectStandardOutput = $true
$proc.UseShellExecute = $false
$proc.Arguments = $parms,$parms2
$p = New-Object System.Diagnostics.Process
$p.StartInfo = $proc
$p.Start() | Out-Null
$p.WaitForExit()
return $p.ExitCode
}

I Hear, I Forget
I See, I Remember
I Do, I Understand

Ronald McDonald

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close