- Qbs Manual
- Environment Service
- Qbs 1.6.0

# Environment Service

The `Environment` service offers access to the system environment or process environment.

## Available Operations

### currentEnv

    Environment.currentEnv(): { [key: string]: string; }

Returns the environment of Qbs in the current context as an object whose properties are the environment variables.

### getEnv

    Environment.getEnv(key: string): string

Tries to find a variable with the given name in the current context's environment and returns its value. If no such variable could be found, `undefined` is returned.

### putEnv

    Environment.putEnv(key: string, value: string): void

Sets the value of the environment variable with the given name in the build or run environment. This method is only available in the `Module.setupBuildEnvironment` and `Module.setupRunEnvironment` scripts.

### unsetEnv

    Environment.unsetEnv(key: string): void

Unsets the environment variable with the given name from the build or run environment. This method is only available in the `Module.setupBuildEnvironment` and `Module.setupRunEnvironment` scripts.