You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[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)|
|[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]|
21
22
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].
23
24
24
25
## Unable to parse content from `<manifestUrl>`
25
26
27
+
<aid="t01"></a>
28
+
26
29
When authoring a resource manifest in Visual Studio Code (VSCode), you may encounter a parsing error:
27
30
28
31
> Unable to parse content from `<manifestUrl>`
29
32
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.
32
35
33
36
### Prerequisites
34
37
@@ -38,53 +41,59 @@ schema specification. It applies to Microsoft DSC v3.0 and above.
38
41
### Troubleshooting steps
39
42
40
43
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.
42
45
43
-
For more information, see [Enhanced authoring][00].
46
+
For more information, see [Enhanced authoring][02].
44
47
45
48
### Possible causes
46
49
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.
50
52
51
53
## Resource not found when using Windows PowerShell adapter
52
54
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
+
<aid="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.
55
59
56
60
### Prerequisites
57
61
58
62
- 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
60
65
61
66
### Issue description
62
67
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.
67
73
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.
70
76
71
77
### Troubleshooting steps
72
78
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.
75
82
76
83
### Possible causes
77
84
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.
80
87
81
88
### Recommendation
82
89
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.
85
92
86
93
## Validation errors when executing dsc.exe in Windows PowerShell sessions
87
94
95
+
<aid="t03"></a>
96
+
88
97
When executing `dsc.exe` commands in Windows PowerShell sessions, you may encounter
89
98
validation errors when using manually crafted JSON input or the `ConvertTo-Json` cmdlet
90
99
with the `-Compress` parameter. This issue is related to how Windows PowerShell handles
@@ -94,7 +103,7 @@ string encoding and JSON formatting.
94
103
95
104
- Windows PowerShell session
96
105
- Direct execution of `dsc.exe` commands
97
-
- Use of JSON input via`--input` parameter
106
+
- Use of JSON input with the`--input` parameter
98
107
99
108
### Problem details
100
109
@@ -109,40 +118,44 @@ Commands that work correctly:
109
118
110
119
Common error symptoms include:
111
120
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
115
124
or empty, or an element of the argument collection contains a null value.
116
125
117
126
### Resolution steps
118
127
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:
124
129
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
+
```
129
135
130
136
### Root causes
131
137
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`.
135
141
136
142
### Recommendation
137
143
138
144
When executing `dsc.exe` commands in Windows PowerShell:
139
145
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.
142
149
143
150
## See also
144
151
145
-
-[Microsoft Desired State Configuration overview](../overview.md)
152
+
-[Microsoft Desired State Configuration overview][04]
0 commit comments