title: Do helper functions in a NuGet Packages init.ps1 have to be global?
body: <p>I'm wanting to write a couple commands for the <a href="http://nuget.org" rel="nofollow">NuGet package manager</a> console to insert <a href="http://gist.github.com" rel="nofollow">Gists from GitHub</a>.  I have 4 basic commands</p>
  
  <ul>
  <li><strong>List-Gists</strong> 'user' </li>
  <li><strong>Gist-Info</strong> 'gistId'</li>
  <li><strong>Gist-Contents</strong> 'gistId' 'fileName'</li>
  <li><strong>Gist-Insert</strong> 'gistId' 'fileName'</li>
  </ul>
  
  <p>All of my commands depend on a couple utility functions, and I'm struggling with whether they need to be global or not.</p>
  
  <pre><code># Json Parser
  function parseJson([string]$json, [bool]$throwError = $true) {    
      try {
          $result = $serializer.DeserializeObject( $json );    
          return $result;
      } catch {                
          if($throwError) { throw "ERROR: Parsing Error"}
          else { return $null }            
      }
  }
  
  function downloadString([string]$stringUrl) {
      try {        
          return $webClient.DownloadString($stringUrl)
      } catch {         
          throw "ERROR: Problem downloading from $stringUrl"
      }
  }
  
  function parseUrl([string]$url) {
      return parseJson(downloadString($url));
  }
  </code></pre>
  
  <p>Can I just have these utility functions outside of my global functions, or will I need to include them in each of the global functions definition scope somehow?</p>