Skip to content

The RebootPending resource cannot be used in Microsoft.DSC/Assertion #858

Closed
@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 using the RebootPending DSC resource, it cannot be used in an assertion to check for a pending reboot.

Steps to reproduce

  1. Create the following configuration document:
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
resources:
- name: Managed key
  type: Microsoft.Windows/Registry
  properties:
    _exist: true
    keyPath: HKCU\DscExamples\ManagedKey
  dependsOn:
  - "[resourceId('Microsoft.DSC/Assertion','Assert pending reboot')]"
- name: Assert pending reboot
  type: Microsoft.DSC/Assertion
  properties:
    $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
    resources:
    - name: Check pending reboot
      type: Microsoft.Windows/RebootPending
  1. Execute the document by running dsc config test -f pendingReboot.config.dsc.yaml

An error occurs.

Expected behavior

The assertion would succeeds.

Actual behavior

2025-06-03T05:26:04.602215Z ERROR trace_message="PID 31604: JSON: EOF while parsing a value at line 1 column 0"
2025-06-03T05:26:04.604962Z ERROR Command: Resource 'dsc' [exit code 2] manifest description: Resource error

Error details

Environment data

Name                           Value
----                           -----
PSVersion                      7.5.1
PSEdition                      Core
GitCommitId                    7.5.1
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Version

dsc 3.1.0-preview.6

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions