Skip to content

Commit

Permalink
Sync reference docs and CL for preview.7 release
Browse files Browse the repository at this point in the history
This change syncs the changes and new reference documentation for the `preview.7`
release of DSC. It also updates the changelog for the release.

This change:

- Fixes AB#243046
- Fixes AB#250844
- Fixes AB#250845
  • Loading branch information
michaeltlombardi committed May 9, 2024
1 parent 55271ee commit 87518ce
Show file tree
Hide file tree
Showing 56 changed files with 4,105 additions and 537 deletions.
5 changes: 5 additions & 0 deletions .openpublishing.redirection.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
"source_path": "dsc/docs-conceptual/dsc-2.0/concepts/terminology.md",
"redirect_url": "/powershell/dsc/concepts/glossary?view=dsc-2.0",
"redirect_document_id": true
},
{
"source_path": "dsc/dsc-3.0/docs-conceptual/reference/schemas/resource/manifest/provider.md",
"redirect_url": "/powershell/dsc/reference/schemas/resource/manifest/adapter?view=dsc-3.0",
"redirect_document_id": true
}
]
}
872 changes: 742 additions & 130 deletions dsc/docs-conceptual/dsc-3.0/changelog.md

Large diffs are not rendered by default.

13 changes: 6 additions & 7 deletions dsc/docs-conceptual/dsc-3.0/reference/cli/config/command.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Command line reference for the 'dsc config' command
ms.date: 02/05/2024
ms.date: 05/09/2024
ms.topic: reference
title: dsc config
---
Expand Down Expand Up @@ -110,15 +110,14 @@ Mandatory: false

## Environment variables

The `dsc config *` subcommands create the `DSCConfigRoot` environment variable when you call a
The `dsc config *` subcommands create the `DSC_CONFIG_ROOT` environment variable when you call a
command with the `--path` option to specify the configuration document to use for the command. DSC
sets the value of the `DSCConfigRoot` environment variable to the folder containing the specified
configuration document.
sets the value of the `DSC_CONFIG_ROOT` environment variable to the full path of the folder
containing the specified configuration document.

> [!NOTE]
> If you use a relative path, DSC doesn't expand the value into a full path before setting the
> environment variable. Always specify the full path to the configuration document when you want to
> use the `DSCConfigRoot` environment variable.
> If you define the `DSC_CONFIG_ROOT` variable outside of DSC, DSC raises a warning when it
> overrides the existing environment variable's value for an operation.
You can use the [envvar][08] configuration function to reference that folder path for resource
instances in the configuration.
Expand Down
6 changes: 3 additions & 3 deletions dsc/docs-conceptual/dsc-3.0/reference/cli/config/get.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Command line reference for the 'dsc config get' command
ms.date: 03/06/2024
ms.date: 05/09/2024
ms.topic: reference
title: dsc config get
---
Expand Down Expand Up @@ -49,12 +49,12 @@ document saved as `example.dsc.config.yaml`.

```yaml
# example.dsc.config.yaml
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
resources:
- name: Windows only
type: DSC/AssertionGroup
properties:
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
resources:
- name: os
type: Microsoft/OSInfo
Expand Down
6 changes: 3 additions & 3 deletions dsc/docs-conceptual/dsc-3.0/reference/cli/config/set.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Command line reference for the 'dsc config set' command
ms.date: 03/06/2024
ms.date: 05/09/2024
ms.topic: reference
title: dsc config set
---
Expand Down Expand Up @@ -50,12 +50,12 @@ The command inspects the resource instances defined in the configuration documen

```yaml
# example.dsc.config.yaml
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
resources:
- name: Windows only
type: DSC/AssertionGroup
properties:
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
resources:
- name: os
type: Microsoft/OSInfo
Expand Down
6 changes: 3 additions & 3 deletions dsc/docs-conceptual/dsc-3.0/reference/cli/config/test.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Command line reference for the 'dsc config test' command
ms.date: 03/06/2024
ms.date: 05/09/2024
ms.topic: reference
title: dsc config test
---
Expand Down Expand Up @@ -49,12 +49,12 @@ resource instances defined in the configuration document saved as `example.dsc.c

```yaml
# example.dsc.config.yaml
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
resources:
- name: Windows only
type: DSC/AssertionGroup
properties:
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
resources:
- name: os
type: Microsoft/OSInfo
Expand Down
158 changes: 158 additions & 0 deletions dsc/docs-conceptual/dsc-3.0/reference/cli/resource/delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
---
description: Command line reference for the 'dsc resource delete' command
ms.date: 05/09/2024
ms.topic: reference
title: dsc resource delete
---

# dsc resource delete

## Synopsis

Invokes the delete operation of a resource.

## Syntax

### Without instance properties

```sh
dsc resource delete [Options] --resource <RESOURCE>
```

### Instance properties from stdin

```sh
<instance-properties> | dsc resource delete [Options] --resource <RESOURCE>
```

### Instance properties from input option

```sh
dsc resource delete --input '<instance-properties>' --resource <RESOURCE>
```

### Instance properties from file

```sh
dsc resource delete --path <instance-properties-filepath> --resource <RESOURCE>
```

## Description

The `delete` subcommand removes a resource instance.

Any properties the resource requires for discerning which instance to delete must be passed to this
command as a JSON or YAML object. The object can be passed to this command from stdin or with the
`--input` option. You can also use the `--path` option to read the object from a JSON or YAML file.

This command returns no output when successful. If it encounters an error, it surfaces the error to
the caller on stderr and exits with a non-zero exit code.

## Examples

### Example 1 - delete resource instance with input option

If a resource requires one or more property values to return the actual state of the instance, the
instance properties can be passed with the **input** option as either JSON or YAML.

```sh
dsc resource delete --resource Microsoft.Windows/Registry --input '{
"keyPath": "HKCU\\DSC\\Example"
}'
```

### Example 2 - delete resource instance with input from stdin

If a resource requires one or more property values to return the actual state of the instance, the
instance properties can be passed over stdin as either JSON or YAML.

```sh
'{
"keyPath": "HKCU\\DSC\\Example"
}' | dsc resource delete --resource Microsoft.Windows/Registry
```

### Example 3 - delete resource instance with input from a YAML file

If a resource requires one or more property values to return the actual state of the instance, the
instance properties can be retrieved from a saved JSON or YAML file.

```sh
cat ./example.delete.yaml
```

```yaml
keyPath: HKCU\\DSC\\Example
```

```sh
dsc resource delete --resource Microsoft.Windows/Registry --path ./example.delete.yaml
```

## Options

### -r, --resource

Specifies the fully qualified type name of the DSC Resource to use, like
`Microsoft.Windows/Registry`.

The fully qualified type name syntax is: `<owner>[.<group>][.<area>]/<name>`, where:

- The `owner` is the maintaining author or organization for the resource.
- The `group` and `area` are optional name components that enable namespacing for a resource.
- The `name` identifies the component the resource manages.

```yaml
Type: String
Mandatory: true
```

### -i, --input

Specifies a JSON or YAML object with the properties needed for retrieving an instance of the DSC
Resource. DSC validates the object against the resource's instance schema. If the validation fails,
DSC raises an error.

This option can't be used with instance properties over stdin or the `--path` option. Choose
whether to pass the instance properties to the command over stdin, from a file with the `--path`
option, or with the `--input` option.

DSC ignores this option when the `--all` option is specified.

```yaml
Type: String
Mandatory: false
```

### -p, --path

Defines the path to a text file to read as input for the command instead of piping input from stdin
or passing it as a string with the `--input` option. The specified file must contain JSON or YAML
that represents valid properties for the resource. DSC validates the object against the resource's
instance schema. If the validation fails, or if the specified file doesn't exist, DSC raises an
error.

This option is mutually exclusive with the `--input` option. When you use this option, DSC
ignores any input from stdin.

DSC ignores this option when the `--all` option is specified.

```yaml
Type: String
Mandatory: false
```

### -h, --help

Displays the help for the current command or subcommand. When you specify this option, the
application ignores all options and arguments after this one.

```yaml
Type: Boolean
Mandatory: false
```

## Output

This command returns no output when successful. When the resource errors, DSC surfaces the error on
stderr and exits with a non-zero exit code.
Loading

0 comments on commit 87518ce

Please sign in to comment.