Skip to content

Unexpected argument on dependsOn #752

@Gijsreyn

Description

@Gijsreyn

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Summary

When working on #748, the following YAML string input throws an error:

$yaml = @'
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
resources:
  - name: File
    type: Microsoft.Windows/WindowsPowerShell
    properties:
      resources:
        - name: File
          type: PSDesiredStateConfiguration/File
          properties:
            DestinationPath: C:\temp\testfile.txt
  - name: File present
    type: Microsoft.DSC/Assertion
    properties:
      `$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
      resources:
        - name: Use powershell adapter
          type: Microsoft.Windows/WindowsPowerShell
          properties:
            resources:
              - name: File present
                type: PSDesiredStateConfiguration/File
                properties:
                  DestinationPath: C:\temp\testfile.txt
    dependsOn:
      - "[resourceId('Microsoft.Windows/WindowsPowerShell', 'File')]"
'@

Steps to reproduce

Load the YAML string in the description into a Windows PowerShell session and run dsc config test --input $yaml

Expected behavior

The configuration document is tested.

Actual behavior

error: unexpected argument ''File')]' found

Error details

Environment data

Name                           Value
----                           -----
PSVersion                      5.1.19041.5737
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.5737
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Version

dsc 3.0.2

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugSomething isn't workingWaiting on AuthorThe PR was reviewed and requires changes or comments from the author before being accept

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions