Skip to content

Commit 1232b97

Browse files
committed
Resolve remarks
1 parent d289655 commit 1232b97

File tree

2 files changed

+23
-29
lines changed

2 files changed

+23
-29
lines changed

docs/reference/resources/DSC/PackageManagement/APT/examples/manage-packages-with-apt.md

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ that use the APT package manager.
1313

1414
## Test if package is installed
1515

16-
The following snippet shows how you can use the resource with the [dsc resource test][01] command
16+
The following snippet shows how you can use the resource with the [dsc resource test][00] command
1717
to check whether the `nginx` package exists.
1818

1919
```bash
@@ -23,14 +23,14 @@ dsc resource test --resource DSC.PackageManagement/Apt --input '{"packageName":"
2323
When the package is not installed, DSC returns the following result.
2424

2525
> [!NOTE]
26-
> Note that the version and source values can differ depending on your system's package repositories and available
27-
> package versions.
26+
> Note that the version and source values can differ depending on your system's package repositories
27+
> and available package versions.
2828
2929
```yaml
3030
desiredState:
3131
packageName: nginx
3232
actualState:
33-
_exist: "true"
33+
_exist: false
3434
packageName: nginx
3535
version: 1.24.0-2ubuntu7.3
3636
source: noble-updates,noble-security,now
@@ -39,43 +39,42 @@ differingProperties:
3939
- _exist
4040
```
4141
42-
## Ensure a package with version is installed
42+
## Ensure a package is installed
4343
44-
To ensure the system is in the desired state with a particular version, use the [dsc resource set][02]
44+
To ensure the system is in the desired state, use the [dsc resource set][01]
4545
command.
4646
4747
```bash
48-
dsc resource set --resource DSC.PackageManagement/Apt --input '{"packageName":"nginx", "version":"1.24.0-2ubuntu7"}'
48+
dsc resource set --resource DSC.PackageManagement/Apt --input '{"packageName":"nginx"}'
4949
```
5050

51-
When the resource install the package, DSC returns the following result:
51+
When the resource installs the package, DSC returns the following result:
5252

5353
```yaml
5454
beforeState:
5555
packageName: "nginx"
56-
version: "1.24.0-2ubuntu7"
5756
_exist: false
5857
afterState:
59-
keyPath: HKCU\DscExamples\ManagedKey
60-
version: "1.24.0-2ubuntu7"
58+
packageName: nginx
59+
version: "1.24.0-2ubuntu7.3"
60+
source: noble-updates,noble-security,now
6161
changedProperties:
6262
- _exist
6363
```
6464
6565
You can test the instance again to confirm that the package exists:
6666
6767
```bash
68-
dsc resource test --resource DSC.PackageManagement/Apt --input '{"packageName":"nginx", "version":"1.24.0-2ubuntu7"}'
68+
dsc resource test --resource DSC.PackageManagement/Apt --input '{"packageName":"nginx"}'
6969
```
7070

7171
```yaml
7272
desiredState:
7373
packageName: nginx
74-
version: 1.24.0-2ubuntu7
7574
actualState:
7675
_exist: true
7776
packageName: nginx
78-
version: 1.24.0-2ubuntu7
77+
version: 1.24.0-2ubuntu7.3
7978
source: noble-updates,noble-security,now
8079
inDesiredState: true
8180
differingProperties: []
@@ -89,9 +88,6 @@ To uninstall a package, set the `_exist` property to `false`:
8988
dsc resource set --resource DSC.PackageManagement/Apt --input '{"packageName":"nginx", "_exist": false}'
9089
```
9190

92-
The `DSC.PackageManagement/Apt` resource implements the [setHandleExist][03], indicating the resource
93-
will be deleted.
94-
9591
To verify the package no longer exists, use the `dsc resource get` command
9692

9793
```powershell
@@ -105,6 +101,5 @@ actualState:
105101
```
106102

107103
<!-- Link reference definitions -->
108-
[01]: ../../../../../cli/resource/test.md
109-
[02]: ../../../../../cli/resource/set.md
110-
[03]: ../../../../../../concepts/resources/capabilities.md#sethandlesexist
104+
[00]: ../../../../../cli/resource/test.md
105+
[01]: ../../../../../cli/resource/set.md

docs/reference/resources/DSC/PackageManagement/APT/index.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ The resource has the following capabilities:
6161
- `export` - You can use the resource to export the current state of the system.
6262

6363
For more information about resource capabilities, see
64-
[DSC resource capabilities][01].
64+
[DSC resource capabilities][00].
6565

6666
## Examples
6767

@@ -75,17 +75,16 @@ The following list describes the properties for the resource.
7575
- **Required properties:** <a id="required-properties"></a> The following properties are always
7676
required when defining an instance of the resource. An instance that doesn't define each of these
7777
properties is invalid. For more information, see the "Required resource properties" section in
78-
[DSC resource properties][02]
78+
[DSC resource properties][01]
7979

8080
- [packageName](#packagename) - The name of the package to query or install.
8181

8282
- **Key properties:** <a id="key-properties"></a> The following properties uniquely identify an
8383
instance. If two instances of a resource have the same values for their key properties, the
8484
instances are conflicting. For more information about key properties, see the "Key resource
85-
properties" section in [DSC resource properties][03].
85+
properties" section in [DSC resource properties][02].
8686

8787
- [packageName](#packagename) (required) - The name of the package to query or install.
88-
- [version](#version) (optional) - The version of the package to install.
8988

9089
- **Instance properties:** <a id="instance-properties"></a> The following properties are optional.
9190
They define the desired state for an instance of the resource.
@@ -95,7 +94,7 @@ The following list describes the properties for the resource.
9594

9695
- **Read-only properties:** <a id="read-only-properties"></a> The resource returns the following
9796
properties, but they aren't configurable. For more information about read-only properties, see
98-
the "Read-only resource properties" section in [DSC resource properties][04].
97+
the "Read-only resource properties" section in [DSC resource properties][03].
9998

10099
- [source](#source) - Indicates the source of the package.
101100

@@ -189,7 +188,7 @@ exit code, it also emits an error message with details about the invalid paramet
189188
- [For more information about APT](https://wiki.debian.org/Apt)
190189

191190
<!-- Link definitions -->
192-
[01]: ../../../../../concepts/resources/capabilities.md
193-
[02]: ../../../../../concepts/resources/properties.md#required-resource-properties
194-
[03]: ../../../../../concepts/resources/properties.md#key-resource-properties
195-
[04]: ../../../../../concepts/resources/properties.md#read-only-resource-properties
191+
[00]: ../../../../../concepts/resources/capabilities.md
192+
[01]: ../../../../../concepts/resources/properties.md#required-resource-properties
193+
[02]: ../../../../../concepts/resources/properties.md#key-resource-properties
194+
[03]: ../../../../../concepts/resources/properties.md#read-only-resource-properties

0 commit comments

Comments
 (0)