Skip to content

Remove Environment Variable

Removes a Windows environment variable, or a single entry from a list style variable such as Path.\n\nUse it to clean up after an application, for example to remove the folder an application added to Path when it was installed. The whole Path variable can never be deleted by this brick, only single entries can be removed from it.\n\nEvery program started after the brick has run sees the variable as it is now. Programs a signed-in user already has open keep the old value until they are restarted, and signing out and back in is the reliable way to refresh all of them.

Required

The name of the environment variable to work on.\n\nExample: MYAPP_HOME\n\nTo clean up a folder that was added to the search path, enter Path here and turn on “Remove Entry Only”. The Path variable itself is never deleted.

Optional — Default: False

Enable to remove only the single entry given below from a list style variable such as Path or PSModulePath, and leave the rest of the value untouched.\n\nDisable to remove the whole variable. The variable named Path can never be removed as a whole, so this must be enabled when working on Path.

Optional

The single entry to strip out of the variable. Required when “Remove Entry Only” is enabled, and must be left empty otherwise.\n\nExample: C:\Program Files\MyApp\bin\n\nThe entry is matched without regard to upper or lower case and a trailing backslash is ignored, so C:\Program Files\MyApp\bin\ matches the example above. Every other entry keeps its original order.

Optional — Default: True

Enable to let the workflow continue when the variable, or the entry, is already gone. The step is written to the log and reported as a success.\n\nDisable to fail the workflow when there was nothing to remove. Keep this enabled in an uninstall workflow that may run on computers where the variable was never created.

  • Category: System
  • Brick ID: Environment-Variable-Remove