Skip to content

Instantly share code, notes, and snippets.

@oliverlabs
Forked from denelon/setenvironment.dsc.yaml
Created June 20, 2023 12:05
Show Gist options
  • Select an option

  • Save oliverlabs/4cde356474f86696197bb32e24ae406b to your computer and use it in GitHub Desktop.

Select an option

Save oliverlabs/4cde356474f86696197bb32e24ae406b to your computer and use it in GitHub Desktop.
Sample configuration to set a machine scoped environment variable
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.1
# Requires administrator
# Checks for absences of environment variable and sets it if it's not present.
properties:
configurationVersion: '0.1.0'
assertions:
- resource: Environment
directives:
module: PSDscResources
settings:
Name: 'DSC_EXAMPLE'
Ensure: 'Absent'
Value: 'Desired State Configuration'
Target: 'Machine'
resources:
- resource: Environment
directives:
module: PSDscResources
settings:
Name: 'DSC_EXAMPLE'
Ensure: 'Present'
Value: 'Desired State Configuration'
Target: 'Machine'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment