unknown error after start of mof file execution

This topic contains 2 replies, has 2 voices, and was last updated by  KOSTIANTYN KHOMKO 3 months ago.

  • Author
    Posts
  • #94411

    KOSTIANTYN KHOMKO
    Participant

    Hello,
    I am starting to learn DSC but i have faced with an error and can not find the root cause of it:

    Syntax error:
    At line:1, char:13
    Buffer:
    Configuration^ IISWeb
    + CategoryInfo : SyntaxError: (root/Microsoft/...gurationManager:String) [], CimException
    + FullyQualifiedErrorId : MiClientApiError_Failed
    + PSComputerName : localhost

    i am using following mof template localhost.mof:

    Start-DscConfiguration -Force –Path .\IISWebsite –Wait –Verbose

    Configuration IISWebsite
    {
        param(
            localhost
        )
        Node localhost
        {
            WindowsFeature IIS
            {
                Ensure = "Present"
                Name = "Web-Server"
            }
            WindowsFeature ASP
            {
                Ensure = "Present"
                Name = "Web-Asp-Net45"
            }
            File WebContent
            {
                Ensure = "Present"
                Type = "Directory"
                SourcePath = "C:\Content\BakeryWebsite"
                DestinationPath = "C:\inetpub\wwwroot\"
                Recurse = $true
            }
        }
    } IISWebsite -NodeName "localhost"
    

    Tried it and another templates as well on several servers with os (windows 10, 2012 R2, 2016) and on powershell 4.0 and 5.1.
    This error repeats everywhere and i have no idea how to find the root cause.
    Please help to find the solution.
    Thanks.

  • #94488

    Don Jones
    Keymaster

    I'd probably start troubleshooting by stripping this down to exactly one thing, trying that, adding one thing back, and seeing where it broke. I'd also check the Debug and Operational event logs for DSC on the affected node.

  • #94495

    KOSTIANTYN KHOMKO
    Participant

    Found the root cause. My mistake. It should be ps1 file, not mof. That is why it has a syntax error. Please close.

You must be logged in to reply to this topic.