title: powershell: script to start a program with parameters?
body: <p>When i run the Powershell script below i receive the error below. How do i run programs through powershell with parameters? The script will be a group policy logon.</p>
  
  <blockquote>
    <p>Invoke-Expression : A positional parameter cannot be found that
    accepts argument '\TBHSERVER\NETLOGON\BGInfo\BGIFILE.bgi /timer:0 /s
    ilent /nolicprompt '. At
    X:\Systems\scripts\PowerShell\UpdateDesktopWithBGInfo.ps1:6 char:18
    + Invoke-Expression &lt;&lt;&lt;&lt;  $logonpath $ArguList
        + CategoryInfo          : InvalidArgument: (:) [Invoke-Expression], ParameterBindingException
        + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.InvokeExpressionCommand</p>
  </blockquote>
  
  <pre><code>$LogonPath = $env:LOGONSERVER + "\NETLOGON\BGInfo\Bginfo.exe" 
  $ArguList = $env:LOGONSERVER + '\NETLOGON\BGInfo\BGIFILE.bgi /timer:0 /silent /nolicprompt '
  invoke-command $LogonPath
  Invoke-Expression $logonpath $ArguList
  </code></pre>