title: PowerShell running functions from .ps1 with multiple parameters
body: <p>I'm trying to run a function that is located within a .ps1 file. The function accepts two parameters that could be either a string or int. Here is my code:</p>
  
  <p>Filename: SetFarmProp.ps1</p>
  
  <pre><code>Function SetFarm ($property_name, $property_value) `
  {
      $farm = Get-SPFarm
  
      $farm.Properties.Add($property_name, $property_value)
  
      $farm.properties
  }
  </code></pre>
  
  <p>When I go into my PowerShell session and type in</p>
  
  <pre><code>.\SetFarmProp.ps1
  SetFarm "testkey" "testvalue1"
  </code></pre>
  
  <p>I get an error saying that the "SetFarm" is not a recognized name of a cmdlet, function, script file, or operable program.</p>