PowerShell / PowerShell/PowerShell-Docker

Powershell docker image, Restart-Computer cmd missing 'ComputerName' parameter

Abierto
#841 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
Dockerfile
Estrellas
449
Forks
158
Merge medio
3 d 10 h
PR fusionados (30 d)
1

Descripción

Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest image.
  • Search the existing issues.
  • Verified that this is not a Known Issue
  • Verified this is not an issues in the underlying windows container that should be reported to Windows Feedback Hub
Steps to reproduce

Trying to remotely restart a windows computer with powershell and Restart-Computer command.

Powershell is running from a docker container with mcr.microsoft.com/powershell image, and from within the docker container i am running a powerhell script.
The script is also tested on a windows 11 machine with powershell and it works as expected.

Output from the script running from powershell in docker, PowerShell 7.4.2.

Expected behavior
Restart remote computer
Actual behavior
PS /> /root/scripts/restart.ps1

Restart-Computer: /root/scripts/restart.ps1:9

Line |
   9 |  Restart-Computer -ComputerName $server -Credential $credObject -Force …
     |                   ~~~~~~~~~~~~~
     | A parameter cannot be found that matches parameter name 'ComputerName'.
Error details

No response

Environment data
{
   "schemaVersion": 2,
   "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
   "manifests": [
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 742,
         "digest": "sha256:73c08403182e3cd1a62176b6723645b2d2037cda8deefc0e2c2c01cb814abe43",
         "platform": {
            "architecture": "amd64",
            "os": "linux"
         }
      },
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 1160,
         "digest": "sha256:f7306ab20f28b5609264d6e49cb18a4804cafe7a78c33679e3a6ce907d692d0a",
         "platform": {
            "architecture": "arm",
            "os": "linux",
            "variant": "v7"
         }
      },
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 2001,
         "digest": "sha256:055163474207105ca91482e142b923a65c0853feead3812d7f1cdc04203ab244",
         "platform": {
            "architecture": "amd64",
            "os": "windows",
            "os.version": "10.0.20348.2402"
         }
      }
   ]
}
Visuals

No response

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.

Línea de trabajo

Comienza reproduciendo el fallo con la imagen mcr.microsoft.com/powershell y PowerShell 7.4.2 usando el comando Restart-Computer indicado, y compáralo después con el entorno funcional de Windows 11. Determina si la ausencia del parámetro ComputerName se debe a la plataforma de contenedores o a la imagen; se considerará terminado cuando exista una solución verificada o una limitación y una solución alternativa claramente documentadas.

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

Evaluación

Stack tecnológico
docker, powershell
Área
devops, operating-systems
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
30/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.