title: separate list of parameter into different file in Powershell
body: <p>I have a powershell script with 2 funtions:</p>
  
  <pre><code>function Stonebrach.Connect {
  param(
      [Parameter(Mandatory=$true)]
      $Sb_uri,
      [Parameter(Mandatory=$true)]
      $Auth_filename,
      [Parameter(Mandatory=$true)]
      $Method,
      [Parameter(Mandatory=$false)]
      $Body
  )
  
  $basicAuth=Get-Content "C:\$auth_filename"
  $headers = @{
          "Authorization" = $basicAuth
          "Content-Type"="application/json"
  }
  $RSP=$null
  
  try{
      if ( $body -eq $null ) {
          $response = invoke-restmethod -Uri $Sb_uri -Method $Method -Headers $headers
      }
      else {
          $response = invoke-restmethod -Uri $sb_uri -Method $method -Headers $headers -Body $body
      }
      return $response
  }
  catch{
     $RSP = $_.Exception.Message
     return $RSP
  }
  }
  
  function Stonebranch.Create.Task.Windows {
  param(
      [Parameter(Mandatory=$true)]
      $Sb_base_uri,
      [Parameter(Mandatory=$true)]
      $Auth_filename,
      [Parameter(Mandatory=$true)]
      $Method,
      [Parameter(Mandatory=$true)]
      $Body
  )
      Stonebrach.Connect -SB_uri $Sb_base_uri/task -Auth_filename $Auth_filename -Method $Method -Body $Body
  </code></pre>
  
  <p>}</p>
  
  <p>the body param is hardcoded as below:</p>
  
  <pre><code>$body = '
  {
  "type" : "taskWindows",
  "actions" : {
    "abortActions" : [],
    "emailNotifications" : [],
    "setVariableActions" : [],
    "snmpNotifications" : [],
    "systemOperations" : []
  },
  "agent" : "test",
  "name" : "Test Create",
  "summary" : "Test Create"
  }
  '
  </code></pre>
  
  <p>Call the function:</p>
  
  <pre><code>$response = Stonebranch.Create.Task.Windows -Sb_base_uri $Sb_base_uri -Auth_filename $Auth_filename -Method POST -Body $body
  </code></pre>
  
  <p>Here's the question: <strong>i want to separate the $body into a different file (prefer YAML file)</strong>. Anyone know how to separate and pass the list of param to the script so i can use them? I find it hard to pass the list of param and call the function.</p>
  
  <p>Please help me, thanks.</p>