export-env
for env
Run a block and preserve its environment in a current scope.
Signature
> export-env (block)
Parameters
block
: the block to run to set the environment
Input/output types:
input | output |
---|---|
nothing | nothing |
Examples
Set an environment variable
> export-env { $env.SPAM = 'eggs' }
Set an environment variable and examine its value
> export-env { $env.SPAM = 'eggs' }; $env.SPAM
eggs