Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ failure.
<!-- Link references -->
[01]: ../WindowsPowerShell/index.md
[02]: ../../DSC/PowerShell/index.md
[03]: ../../../../schemas/config/resource.md#requireAdapter
[03]: ../../../../schemas/config/resource.md#requireadapter
[04]: /powershell/scripting/install/installing-powershell
[05]: examples/invoke-a-resource.md
[06]: examples/configure-a-machine.md
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ description: >
Example showing how to manage a Windows service using the PSDesiredStateConfiguration module
with the Microsoft.Adapter/WindowsPowerShell adapter in a DSC configuration document.

ms.date: 03/23/2026
ms.date: 08/13/2026
ms.topic: reference
title: Manage a Windows service
title: Manage a Windows service with the Windows PowerShell adapter
---

# Manage a Windows service
# Manage a Windows service with the Windows PowerShell adapter

This example shows how to use the `Microsoft.Adapter/WindowsPowerShell` adapter with the
`PSDesiredStateConfiguration/Service` adapted PSDSC resource to manage a Windows service. These
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ an error message with details about the failure.
<!-- Link references -->
[01]: ../PowerShell/index.md
[02]: ../../Windows/WindowsPowerShell/index.md
[03]: ../../../../schemas/config/resource.md#requireAdapter
[03]: ../../../../schemas/config/resource.md#requireadapter
[04]: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/enable-psremoting?view=powershell-5.1&preserveView=true
[05]: examples/manage-a-windows-service.md
[06]: ../../../../schemas/definitions/resourceType.md
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ instance did modify system state.

<!-- Link reference definitions -->
[01]: ../index.md
[02]: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_output_streams?view=powershell-7.6#success-stream
[02]: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_output_streams#success-stream
[03]: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/write-output
[04]: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/write-output#-noenumerate
[05]: ../index.md#emitting-messages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ instance did modify system state.

<!-- Link reference definitions -->
[01]: ../index.md
[02]: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_output_streams?view=powershell-7.6#success-stream
[02]: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_output_streams#success-stream
[03]: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/write-output
[04]: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/write-output#-noenumerate
[05]: ../index.md#emitting-messages
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Microsoft.Windows/OptionalFeatureList resource reference documentation
ms.date: 04/21/2026
ms.date: 08/13/2026
ms.topic: reference
title: Microsoft.Windows/OptionalFeatureList
---
Expand Down Expand Up @@ -364,4 +364,4 @@ Common causes include:
[04]: ./examples/export-optional-features.md
[05]: ../../../../../concepts/resources/properties.md#read-only-resource-properties
[06]: ../FeatureOnDemandList/index.md
[07]: /windows-server/administration/windows-commands/dism/dism-operating-system-package-servicing-command-line-options
[07]: /windows-hardware/manufacture/desktop/dism-operating-system-package-servicing-command-line-options
44 changes: 43 additions & 1 deletion docs/reference/schemas/config/resource.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: JSON schema reference for a resource instance in a Desired State Configuration document.
ms.date: 07/03/2025
ms.date: 08/13/2026
ms.topic: reference
title: DSC Configuration document resource instance schema
---
Expand Down Expand Up @@ -143,6 +143,48 @@ ItemsType: string
ItemsPattern: ^\[resourceId\(\s*'\w+(\.\w+){0,2}\/\w+'\s*,\s*'[a-zA-Z0-9 ]+'\s*\)\]$
```

### directives

The `directives` property of a resource instance defines per-instance overrides for how DSC should
process the resource. This property was added in DSC version 3.2.

```yaml
Type: object
Required: false
```

You can define the following directives for a resource instance:

#### requireAdapter

The `requireAdapter` directive indicates that DSC should use the specified adapter to invoke the
adapted resource instance. The value for this directive must be the fully qualified type name of
the adapter resource, like `Microsoft.Adapter/PowerShell`.

When this directive isn't specified, DSC invokes the adapted resource through the first discovered
adapter that indicates it can invoke the resource. This directive has no effect on nonadapted
resource instances.

```yaml
Type: string
Required: false
Pattern: ^\w+(\.\w+){0,2}\/\w+$
```

#### securityContext

The `securityContext` directive indicates that DSC should validate the current security context
against this directive before invoking the resource. This value overrides the
`metadata.Microsoft.DSC.securityContext` setting for the top level of the configuration document.
This enables you to selectively require or forbid elevated security contexts for a specific
resource instance.

```yaml
Type: string
Required: false
ValidValues: [Current, Elevated, Restricted]
```

[01]: ../definitions/resourceType.md
[02]: functions/resourceId.md
[03]: ../../../glossary.md#nested-resource-instance
Expand Down