requires -modules hashtable must only occur in a single line, -psedition missing

Abierto
#162 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
powershell
Área
tooling

Línea de trabajo

Start with TheBigTestFile.ps1 and locate the syntax rules or tests that handle #requires statements. Compare the multiline and single-line -Modules examples, then inspect how -psedition and abbreviated parameter names are recognized. Done means the valid single-line hashtable form and the reported parameter behavior are handled consistently.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

The hashtable option on a #requires statement must all be on one line (as all #requires statements must be), due to the fundamentals of the single line comment that it rides on, and backticks cannot be used to extend the line, nor can the quoted strings. A special syntax could be applied, but both unquoted and quoted property names are permitted, so it might not be foolproof to only syntax the known property names.

Reference TheBigTestFile.ps1:

#Requires -Modules PSWorkflow @{
    ModuleName="PSScheduledJob"
    ModuleVersion="1.0.0.0"
}

This is the correct syntax:

#Requires -Modules PSWorkflow, @{ModuleName="PSScheduledJob"; ModuleVersion="1.0.0.0"}

Also, the -psedition parameter is not scoped. At this time it has only known arguments, 'core' and 'desktop'.

And it also appears that these parameter names work differently and allow for shortcutting, using no more characters than required to uniquely distinguish the parameter name.

Lenguaje dominante
PowerShell
Estrellas
151
Forks
55
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de PowerShell/EditorSyntax

Todos los issues de PowerShell/EditorSyntax

Issues similares

Más issues de DevTools

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.