Skip to content

Issue when trying to configure windows service with PsDesiredStateConfiguration/Service #1416

@matt6697

Description

@matt6697

The Process 'powershell' id 20844 exited with code 1error is returned when trying to configure a Windows Service as described below.

Despite running the dsc.exe -l trace config set --file ./service.config.dsc.yaml with level trace,I can't get the windows powershell error details.

Is winrm still required to use Microsoft.Windows/WindowsPowerShell ressources ?

How can I get the windows powershell error ?

There seems to be a regression somewhere. You don't specify the adapter as that's determined at runtime and automatically used, but alternatively you can be explicit this way:

# Example configuration mixing native app resources with classic PS resources
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
resources:
- name: Use Windows PowerShell resources
  type: Microsoft.Windows/WindowsPowerShell
  properties:
    resources:
    - name: Check Spooler service
      type: PsDesiredStateConfiguration/Service
      properties:
        Name: Spooler
        State: Running

However, I noticed some other problems I'll fix at the same time.

Originally posted by @SteveL-MSFT in #693

Metadata

Metadata

Assignees

No one assigned

    Labels

    Waiting 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