Skip to content

Commit efbb28f

Browse files
committed
Resolve remarks Mikey
1 parent 1a5ac30 commit efbb28f

File tree

1 file changed

+61
-48
lines changed

1 file changed

+61
-48
lines changed

docs/troubleshooting/known-issues.md

Lines changed: 61 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,24 @@ This article lists known issues and troubleshooting guidance for Microsoft Desir
1414

1515
The following table lists known issues with Microsoft DSC v3:
1616

17-
| Issue | Description | Status | Reported on |
18-
|:---------------------------------------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------|:----------|:-----------------------------------------------------|
19-
| [Unable to parse content from `<manifestUrl>`](#unable-to-parse-content-from-manifesturl) | When authoring a resource manifest in VSCode, you may encounter parsing errors. | Confirmed | [#917](https://github.com/PowerShell/DSC/issues/917) |
20-
| [Resource not found when using Windows PowerShell adapter](#resource-not-found-when-using-windows-powershell-adapter) | A resource cannot be found when running DSC configuration using WinPS adapter. | Confirmed | [#765](https://github.com/PowerShell/DSC/issues/765) |
17+
| Issue | Description | Status | Reported on |
18+
|:--------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------|:---------:|:------------:|
19+
| [Unable to parse content from `<manifestUrl>`](#t01) | When authoring a resource manifest in VS Code, you may encounter parsing errors. | Confirmed | [#917][#917] |
20+
| [Resource not found when using Windows PowerShell adapter](#t02) | A resource can't be found when using the `Microsoft.Windows/WindowsPowerShell` adapter. | Confirmed | [#765][#765] |
21+
| [Validation errors when executing dsc.exe in Windows PowerShell sessions](#t03) | DSC raises input validation errors when invoked in Windows PowerShell | Confirmed | [#965][#965] |
2122

22-
For the most up-to-date information on known issues, visit the [DSC GitHub repository issues page](https://github.com/PowerShell/DSC/issues).
23+
For the most up-to-date information on known issues, see the [DSC GitHub repository issues][01].
2324

2425
## Unable to parse content from `<manifestUrl>`
2526

27+
<a id="t01"></a>
28+
2629
When authoring a resource manifest in Visual Studio Code (VSCode), you may encounter a parsing error:
2730

2831
> Unable to parse content from `<manifestUrl>`
2932
30-
This error occurs because canonical schema bundling is not fully supported in the 2020-12 JSON
31-
schema specification. It applies to Microsoft DSC v3.0 and above.
33+
This error occurs because canonical schema bundling isn't fully supported in VS Code. Canonical
34+
schema bundling was introduced with the 2020-12 JSON schema specification.
3235

3336
### Prerequisites
3437

@@ -38,53 +41,59 @@ schema specification. It applies to Microsoft DSC v3.0 and above.
3841
### Troubleshooting steps
3942

4043
To resolve this issue, use `manifest.vscode.json` in the schema URI for your resource manifest.
41-
This enables enhanced authoring support in VSCode.
44+
This enables enhanced authoring support in VS Code.
4245

43-
For more information, see [Enhanced authoring][00].
46+
For more information, see [Enhanced authoring][02].
4447

4548
### Possible causes
4649

47-
- The resource manifest references a schema that is not compatible with the VSCode JSON schema parser.
48-
- The canonical schema bundling feature is not yet supported in the 2020-12 JSON schema version
49-
used by VSCode.
50+
- The resource manifest references a schema that isn't compatible with the VS Code JSON schema parser.
51+
- VS Code doesn't currently support parsing canonically bundled schemas.
5052

5153
## Resource not found when using Windows PowerShell adapter
5254

53-
When running DSC configurations with the Windows PowerShell (WinPS) adapter,
54-
you may encounter errors indicating that a required resource cannot be found.
55+
<a id="t02"></a>
56+
57+
When running DSC configurations with the `Microsoft.Windows/WindowsPowerShell` adapter, you may
58+
encounter errors indicating that a required resource cannot be found.
5559

5660
### Prerequisites
5761

5862
- Windows PowerShell DSC (PSDSC) 1.1 (included with Windows)
59-
- DSC configuration using the WinPS adapter
63+
- Using the `Microsoft.Windows/WindowsPowerShell` adapter in a configuration document or to
64+
directly invoke a resource
6065

6166
### Issue description
6267

63-
The WinPS adapter relies on PSDSC 1.1, which uses the Local Configuration Manager (LCM) running
64-
as a Windows service. By design, the LCM service only accesses resources installed for "AllUsers"
65-
under the Program Files directory. If a DSC resource is installed for the current user only,
66-
the service cannot detect or use it, resulting in a "resource not found" error.
68+
The [Microsoft.Windows/WindowsPowerShell][03] adapter relies on PSDSC 1.1, which uses the Local
69+
Configuration Manager (LCM) running as a Windows service. By design, the LCM service only accesses
70+
resources installed in the **AllUsers** scope under the Program Files directory. If a PSDSC module
71+
is installed for the current user only, the service cannot detect or use it, resulting in a
72+
"resource not found" error.
6773

68-
This limitation is specific to PSDSC 1.1. PSDSC v2 addresses this issue, but it is not
69-
included with Windows and requires separate installation.
74+
This limitation is specific to the `Microsoft.Windows/WindowsPowerShell` adapter. It doesn't affect
75+
the `Microsoft.DSC/PowerShell` adapter, which doesn't rely on PSDSC 1.1.
7076

7177
### Troubleshooting steps
7278

73-
- Ensure all DSC resources required by your configuration are installed for "AllUsers" scope.
74-
- Reinstall any missing resources using an elevated prompt to guarantee system-wide availability.
79+
- Ensure all PSDSC modules required by your configuration are installed in the **AllUsers** scope.
80+
- Reinstall the PowerShell module for any missing PSDSC resources using an elevated prompt to
81+
guarantee system-wide availability.
7582

7683
### Possible causes
7784

78-
- DSC resources installed only for the current user, not for all users.
79-
- Using PSDSC 1.1, which restricts resource visibility to the "AllUsers" scope.
85+
- A PSDSC resource module is installed only for the current user, not for all users.
86+
- Using PSDSC 1.1, which restricts resource visibility to the **AllUsers** scope.
8087

8188
### Recommendation
8289

83-
Install all DSC resources, whether script-based and binary resources, for all users
84-
("AllUsers" scope) to ensure they are available for the WinPS adapter.
90+
Install all PSDSC resource modules in the **AllUsers** scope to ensure they;re available for the
91+
`Microsoft.Windows/WindowsPowerShell` adapter.
8592

8693
## Validation errors when executing dsc.exe in Windows PowerShell sessions
8794

95+
<a id="t03"></a>
96+
8897
When executing `dsc.exe` commands in Windows PowerShell sessions, you may encounter
8998
validation errors when using manually crafted JSON input or the `ConvertTo-Json` cmdlet
9099
with the `-Compress` parameter. This issue is related to how Windows PowerShell handles
@@ -94,7 +103,7 @@ string encoding and JSON formatting.
94103

95104
- Windows PowerShell session
96105
- Direct execution of `dsc.exe` commands
97-
- Use of JSON input via `--input` parameter
106+
- Use of JSON input with the `--input` parameter
98107

99108
### Problem details
100109

@@ -109,40 +118,44 @@ Commands that work correctly:
109118

110119
Common error symptoms include:
111120

112-
- JSON parsing failures when using compressed JSON output
113-
- Property validation errors with valid JSON input
114-
- Cannot validate argument on parameter `<parameterName>`. The argument is null
121+
- JSON parsing failures when using compressed JSON output.
122+
- Property validation errors with valid JSON input.
123+
- Cannot validate argument on parameter `<parameterName>`. The argument is null
115124
or empty, or an element of the argument collection contains a null value.
116125

117126
### Resolution steps
118127

119-
1. **Avoid the `-Compress` parameter**: Use `ConvertTo-Json` without the `-Compress` parameter
120-
for better compatibility.
121-
2. **Use properly formatted JSON**: Ensure JSON strings are properly quoted and formatted.
122-
3. **Test with uncompressed JSON**: When using PowerShell hashtables, convert to JSON
123-
without compression:
128+
Recommend piping JSON over stdin with the --file - syntax:
124129

125-
```powershell
126-
$input = @{Name = 'bits'} | ConvertTo-Json
127-
dsc resource get -r PSDesiredStateConfiguration/Service --input $input
128-
```
130+
```powershell
131+
@{ Name = 'bits' } |
132+
ConvertTo-Json -Compress |
133+
dsc resource get -r PSDesiredStateConfiguration/Service --file -
134+
```
129135

130136
### Root causes
131137

132-
- Windows PowerShell's handling of compressed JSON may introduce formatting issues
133-
- String encoding differences between Windows PowerShell and `dsc.exe`
134-
- JSON parsing inconsistencies when using the `-Compress` parameter with `ConvertTo-Json`
138+
- Windows PowerShell's handling of compressed JSON may introduce formatting issues.
139+
- String encoding differences between Windows PowerShell and `dsc.exe`.
140+
- JSON parsing inconsistencies when using the `-Compress` parameter with `ConvertTo-Json`.
135141

136142
### Recommendation
137143

138144
When executing `dsc.exe` commands in Windows PowerShell:
139145

140-
- Use `ConvertTo-Json` without the `-Compress` parameter
141-
- Consider using PowerShell 7+ for improved JSON handling compatibility
146+
- Recommend piping JSON over stdin with the --file - syntax.
147+
- Use `ConvertTo-Json` without the `-Compress` parameter.
148+
- Consider using PowerShell 7+ for improved JSON handling compatibility.
142149

143150
## See also
144151

145-
- [Microsoft Desired State Configuration overview](../overview.md)
152+
- [Microsoft Desired State Configuration overview][04]
146153

147-
<!-- Link references -->
148-
[00]: https://learn.microsoft.com/en-us/powershell/dsc/concepts/enhanced-authoring?view=dsc-3.0
154+
<!-- Link references -->
155+
[01]: https://github.com/PowerShell/DSC/issues
156+
[02]: ../concepts/enhanced-authoring.md
157+
[03]: ../reference/resources/Microsoft/Windows/WindowsPowerShell/index.md
158+
[04]: ../overview.md
159+
[#917]: https://github.com/PowerShell/DSC/issues/917
160+
[#765]: https://github.com/PowerShell/DSC/issues/765
161+
[#965]: https://github.com/PowerShell/DSC/issues/965

0 commit comments

Comments
 (0)