PowerShell / PowerShell/vscode-powershell
Debug PSTask PSInvalidOperationException
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- TypeScript
- Estrellas
- 1.9k
- Forks
- 548
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Issue Type: Bug
When debugging a PSTaskJob (Runspace) a get the following exception:
.PSInvalidOperationException: The pipeline was not run because a pipeline is already running. Pipelines cannot be run concurrently.
TestScript.ps1
$files = @("file1.txt","file2.txt","file3.txt");
$files | ForEach-Object -AsJob -Parallel {
Wait-Debugger
Write-Output "Scanning $($_)";
}
=====================================
Command to reproduce in Powershell Integrated Terminal:
PS> .\TestScript.ps1
PS> Get-Runspace
Id Name ComputerName Type State Availability
-- ---- ------------ ---- ----- ------------
1 Runspace1 localhost Local Opened Available
4 Runspace4 localhost Local Opened Busy
6 PSTask:1 localhost Local Opened InBreakpoint
7 PSTask:2 localhost Local Opened InBreakpoint
8 PSTask:3 localhost Local Opened InBreakpoint
PS> Get-Runspace -Id 6 | Debug-Runspace
Debugging Runspace: PSTask:1
To end the debugging session type the 'Detach' command at the debugger prompt, or type 'Ctrl+C' otherwise.
Entering debugged runspace on local machine NB0001
[DBG]: [Process:17600]: [PSTask:1]: PS C:\Users\Albert\Source\Repos\Test>> l
1:
2:
3:* Wait-Debugger
4: Write-Output "Scanning $($_)";
5:
[DBG]: [Process:17600]: [PSTask:1]: PS C:\Users\Albert\Source\Repos\Test>> v
PSInvalidOperationException: The pipeline was not run because a pipeline is already running. Pipelines cannot be run concurrently.
The Debugger crashes and returns the same exception in a loop
Extension version: 2021.2.2
VS Code version: Code 1.56.2 (054a9295330880ed74ceaedda236253b4f39a335, 2021-05-12T17:13:13.157Z)
OS version: Windows_NT x64 10.0.19041
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Core(TM) i7-3840QM CPU @ 2.80GHz (8 x 2794) |
| GPU Status | 2d_canvas: enabled gpu_compositing: enabled multiple_raster_threads: enabled_on oop_rasterization: enabled opengl: enabled_on rasterization: enabled skia_renderer: enabled_on video_decode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled |
| Load (avg) | undefined |
| Memory (System) | 15.91GB (5.58GB free) |
| Process Argv | --crash-reporter-id e3696b06-ea94-400b-b7e5-70c7ac80803d |
| Screen Reader | no |
| VM | 0% |
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con la reproducción proporcionada en TestScript.ps1 y luego ejecuta Get-Runspace y Debug-Runspace contra los runspaces de PSTask. Rastrea el comportamiento del depurador cuando un runspace está en InBreakpoint y la canalización ya se está ejecutando. Se considera completado cuando la depuración ya no se bloquea ni repite el bucle de PSInvalidOperationException.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- powershell, typescript, vscode
- Área
- devtools
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 25/100