I want to automatically add a header to every request in my whole collection using this pre-request script:
pm.request.headers.add({
\'key\': \"myvar\",
Looks like pm.request.headers.add()
doesn't currently update the request being sent. It's been marked as a feature request: https://github.com/postmanlabs/postman-app-support/issues/4631
You might already know that you can create pre-set headers (from the Presets dropdown) to make setting your headers a little bit easier. And there's a couple options under Settings to include specific headers. But these suggestions don't automatically add a header to every request in the whole collection like you're asking about.
UPDATE: Postman added support for this in Postman App (v7.0.9).