ERROR the member if is not valid. valid members are dependon, name, value

Welcome Forums DSC (Desired State Configuration) ERROR the member if is not valid. valid members are dependon, name, value

This topic contains 1 reply, has 2 voices, and was last updated by

 
Participant
2 years, 7 months ago.

  • Author
    Posts
  • #38681

    Participant
    Points: 0
    Rank: Member

    Environment EnvironmentalPath
    {
    if ($Node.Environment -eq 'Dev')

    Ensure = 'Present'
    Name = "Path"
    Value = ";;c:\php\ext\"
    Path = $true
    }

  • #38696

    Participant
    Points: 0
    Rank: Member

    You have to use if outside of resource block something like this:

    if ($Node.Environment -eq 'Dev')
    {
    Environment EnvironmentalPath
    {
    Ensure = 'Present'
    Name = "Path"
    Value = ";;c:\php\ext\"
    Path = $true
    }
    }

    Only resource properties are allowed inside resource block.

The topic ‘ERROR the member if is not valid. valid members are dependon, name, value’ is closed to new replies.