title: Powershell Invoke-Command Function within a Script
body: <p>I have a Powershell script file called "ExecutBizTalkAppMSI.ps1" This contains a single function called "Install-BizTalkApplication". I need to execute the function on a remote server, so I use the "Invoke-Command" cmdlet as follows:</p>
  
  <pre><code>Invoke-Command -Computer $TargetServer -FilePath .\ExecuteBizTalkAppMSI.ps1 -argumentlist $MSI, $InstallFolderOnTargetServer, $Environment
  </code></pre>
  
  <p>Problem is, although the target script runs (I added a Write-Host directly after the Param() section), the function "Install-BizTalkApplication" is not executed.</p>
  
  <p>Can anyone please let me know what I need to do to make this happen?</p>