The format of the resource in the requires list for resource is not valid

Welcome Forums DSC (Desired State Configuration) The format of the resource in the requires list for resource is not valid

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

 
Participant
3 years, 4 months ago.

  • Author
    Posts
  • #29282

    Participant
    Points: 0
    Rank: Member

    I believe this error is because the resource name has a period (.) in the name, I didn't have issues with this in PSv4 DSC but since I installed the PSv5 production preview I keep getting this error:

    Test-DependsOn : The format of the resource reference '[xWebAppPool]mysite.domain.com' in the Requires list for resource '[xWebSite]mysite.domain.com' is not valid. A required resource name should be in the format '[]', with no spaces.

    Has anyone else run across this yet? Also, does anyone have a regex for replacing invalid characters in a resource name or a link to the article I can't find that specifies what the character limitations are?

  • #29283

    Keymaster
    Points: 1,785
    Helping HandTeam Member
    Rank: Community Hero

    I believe you're correct about the period – I don't typically try to use that, and I don't think there's a public list of limitations. You might bug that in Connect and ask for a published list.

  • #29314

    Participant
    Points: 0
    Rank: Member

    Thanks, seems like if I just -replace '[^\w\d_]','_' its much happier.

    I've posted the feedback to connect: https://connect.microsoft.com/PowerShell/feedbackdetail/view/1748632/provide-a-list-of-supported-characters-for-dsc-resource-names

The topic ‘The format of the resource in the requires list for resource is not valid’ is closed to new replies.