|
160 | 160 |
|
161 | 161 | "configurationSnippets": [
|
162 | 162 | {
|
163 |
| - "label": "PowerShell: Launch Current File Configuration", |
| 163 | + "label": "PowerShell: Launch Current Script Configuration", |
164 | 164 | "description": "A new configuration for launching the current opened PowerShell script",
|
165 | 165 | "body": {
|
166 | 166 | "type": "PowerShell",
|
|
172 | 172 | }
|
173 | 173 | },
|
174 | 174 | {
|
175 |
| - "label": "PowerShell: Launch Configuration", |
| 175 | + "label": "PowerShell: Launch Script Configuration", |
176 | 176 | "description": "A new configuration for launching a PowerShell script",
|
177 | 177 | "body": {
|
178 | 178 | "type": "PowerShell",
|
|
182 | 182 | "args": [],
|
183 | 183 | "cwd": "^\"\\${workspaceRoot}\""
|
184 | 184 | }
|
| 185 | + }, |
| 186 | + { |
| 187 | + "label": "PowerShell: Attach to PowerShell Process Configuration", |
| 188 | + "description": "A new configuration for debugging a runspace in another process.", |
| 189 | + "body": { |
| 190 | + "type": "PowerShell", |
| 191 | + "request": "attach", |
| 192 | + "name": "PowerShell Attach to Process", |
| 193 | + "processId": "${ProcessId}", |
| 194 | + "runspaceId": "1" |
| 195 | + } |
| 196 | + }, |
| 197 | + { |
| 198 | + "label": "PowerShell: Launch Interactive Session Configuration", |
| 199 | + "description": "A new configuration for debugging an interactive session.", |
| 200 | + "body": { |
| 201 | + "type": "PowerShell", |
| 202 | + "request": "launch", |
| 203 | + "name": "PowerShell Interactive Session" |
| 204 | + } |
185 | 205 | }
|
186 | 206 | ],
|
187 | 207 |
|
188 | 208 | "configurationAttributes": {
|
189 | 209 | "launch": {
|
190 |
| - "required": [ |
191 |
| - "script" |
192 |
| - ], |
193 | 210 | "properties": {
|
194 | 211 | "program": {
|
195 | 212 | "type": "string",
|
196 | 213 | "description": "Deprecated. Please use the 'script' property instead to specify the absolute path to the PowerShell script to launch under the debugger."
|
197 | 214 | },
|
198 | 215 | "script": {
|
199 | 216 | "type": "string",
|
200 |
| - "description": "Absolute path to the PowerShell script to launch under the debugger." |
| 217 | + "description": "Optional: Absolute path to the PowerShell script to launch under the debugger." |
201 | 218 | },
|
202 | 219 | "args": {
|
203 | 220 | "type": "array",
|
|
213 | 230 | "default": "${workspaceRoot}"
|
214 | 231 | }
|
215 | 232 | }
|
| 233 | + }, |
| 234 | + "attach": { |
| 235 | + "properties": { |
| 236 | + "computerName": { |
| 237 | + "type": "string", |
| 238 | + "description": "Optional: The computer name to which a remote session will be established. Works only on PowerShell 4 and above." |
| 239 | + }, |
| 240 | + "processId": { |
| 241 | + "type": "number", |
| 242 | + "description": "The ID of the process to be attached. Works only on PowerShell 5 and above." |
| 243 | + }, |
| 244 | + "runspaceId": { |
| 245 | + "type": "number", |
| 246 | + "description": "Optional: The ID of the runspace to debug in the attached process. Defaults to 1. Works only on PowerShell 5 and above.", |
| 247 | + "default": 1 |
| 248 | + } |
| 249 | + } |
216 | 250 | }
|
217 | 251 | },
|
218 | 252 | "initialConfigurations": [
|
|
223 | 257 | "script": "${file}",
|
224 | 258 | "args": [],
|
225 | 259 | "cwd": "${file}"
|
| 260 | + }, |
| 261 | + { |
| 262 | + "type": "PowerShell", |
| 263 | + "request": "attach", |
| 264 | + "name": "PowerShell Attach", |
| 265 | + "processId": "12345" |
| 266 | + }, |
| 267 | + { |
| 268 | + "type": "PowerShell", |
| 269 | + "request": "launch", |
| 270 | + "name": "PowerShell Interactive Session", |
| 271 | + "cwd": "${workspaceRoot}" |
226 | 272 | }
|
227 | 273 | ]
|
228 | 274 | }
|
|
0 commit comments