title: How do I set a global function in Postman?
body: <p>I'd like to declare a function once in the pre-request script of my first postman request and then use it in every request thereafter. I've set plenty of variables on the postman object and as environment variables but I haven't found a way to do the same with functions.</p>
  
  <p>In the pre-request script:</p>
  
  <pre><code>function wrapTest(param1, param2, param3) {
  ...
  }
  </code></pre>
  
  <p>Then I've tried</p>
  
  <ol>
  <li><pre><code>postman.prototype.wrap = wrapTest;
  </code></pre></li>
  <li><pre><code>postman.wrap = wrapTest;
  </code></pre></li>
  <li><pre><code>postman.setGlobalVariable("wrap", wrapTest);
  </code></pre></li>
  </ol>
  
  <p>In the request I'm attempting to use this function:</p>
  
  <pre><code>postman.wrap(one,two,three);
  </code></pre>
  
  <p>which results in "postman.wrap is not a function" in all cases.</p>