Introduce a conceptual help topic about calling external programs (native applications)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Documentación
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- powershell
- Área
- documentation
Línea de trabajo
Comienza revisando about_Parsing, about_Quoting_Rules, about_Redirection, about_Pipelines, about_pwsh y about_Operators, junto con los issues relacionados y el RFC. Redacta el tema propuesto about_Native_Calls para la sección about_*, cubriendo el comportamiento de los programas nativos indicado y enlazando esos artículos; se considera terminado cuando se haya añadido la guía completa y se haya incluido en el TOC.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Related: #2361, https://github.com/PowerShell/PowerShell/issues/13068#issuecomment-653526374, and #6239
Summary of the new document or enhancement
Many special considerations apply when you call an external command-line executable (aka native application / utility), which aren't currently covered comprehensively, in one place:
-
That the only data type supported is text (
[string]), both on input and output, and how raw byte data is fundamentally unsupported - both when collecting the output in PowerShell and when piping between native programs.- Update: v7.4 introduced raw byte support.
-
How there are syntax pitfalls due to PowerShell's extended set of metacharacters (compared to other shells) causing potential misinterpretation of arguments, which must be avoided with quoting (e.g., To pass literal
@foo, which works unquoted incmd.exeandbash, you must use'@foo'in PowerShell).- How
--%can be used (primarily on Windows) to selectively deactivate PowerShell's parsing.
- How
-
How "native globbing" is automatically applied to arguments such as
*.txton Unix-like platforms; that is,*.txtis implicitly replaced with the array of file names / paths matching that wildcard pattern. -
How output data is sent through the pipeline line by line, resulting in an array of strings (lines), if collected in a variable.
-
How stderr (standard error) output is passed through to the host rather than going through PowerShell's error stream and can only be captured with a
2>redirection. -
How redirections (
>) generally do not pass the native program's output through as-is, but invariably treat it as[Console]::OutputEncodingencoded text that on writing to the target file is written with PowerShell's default encoding (BOM-less UTF-8 in PowerShell 6+, UTF-16LE in Windows PowerShell). -
How external-program calls aren't integrated with PowerShell's error handling and require explicit checking of
$?/$LASTEXITCODEto detect failure, except in PowerShell 7, where pipeline chain operators&&and||can now be used. See also: the RFC that proposes improvements to the integration. -
How
&, the call operator, must be used to invoke executables whose paths are / must be quoted (as a whole) and/or contain variable references or subexpressions (this requirement isn't specific to external programs, but most likely to surface in that context). -
How
Start-Processis typically not the right tool for invoking external programs - see #6239.
Details of requested document:
- Proposed title: about_Native_Calls
- Propose location in the TOC: Among the `about_* topics
- Target audience: end users
- Purpose or scenario: guidance for invoking native command-line programs
- List of related articles to link to: about_Parsing, about_Quoting_Rules, about_Redirection, about_Pipelines, about_pwsh, about_Operators (section "Pipeline chain operators && and ||")
- Lenguaje dominante
- PowerShell
- Estrellas
- 2.5k
- Forks
- 1.7k
- Merge medio
- 6 h 58 min
- PR fusionados (30 d)
- 31
Preparar el entorno
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.
Más de MicrosoftDocs/PowerShell-Docs
-
issue-doc-idea needs-triage
Dificultad 2/5 1-2 días Aptitud para principiantes 86/100
MicrosoftDocs/PowerShell-Docs#13306 ·
Los mantenedores suelen responder en 1 día
-
needs-triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
MicrosoftDocs/PowerShell-Docs#13305 ·
Los mantenedores suelen responder en 1 día
-
hold-for-pr hold-for-release issue-doc-idea
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
MicrosoftDocs/PowerShell-Docs#13195 ·
Los mantenedores suelen responder en 1 día
-
hold-for-pr hold-for-release
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
MicrosoftDocs/PowerShell-Docs#12897 ·
Los mantenedores suelen responder en 1 día
-
Add "Avoid function / scriptblock based recursion" section to `Performance Considerations` documentAbiertoarea-sdk-docs
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
MicrosoftDocs/PowerShell-Docs#11037 · 1 reacción ·
Los mantenedores suelen responder en 1 día
Todos los issues de MicrosoftDocs/PowerShell-Docs
Issues similares
-
sync-en
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
community-request
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
NVIDIA-NeMo/Curator#2464 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
good first issue hacktoberfest
Dificultad 2/5 1-3 horas Aptitud para principiantes 87/100
elnachto/laya-triage#5 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
[integration]: InferrailAbiertoexternal
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
langchain-ai/docs#6328 · 1 comentario ·
Los mantenedores suelen responder en 1 día