You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.ps1Restart-Computer: /root/scripts/restart.ps1:9Line | 9 | Restart-Computer -ComputerName $server -Credential $credObject -Force … | ~~~~~~~~~~~~~ | A parameter cannot be found that matches parameter name 'ComputerName'.
This cmdlet is only available on the Windows platform. The Restart-Computer cmdlet restarts the operating system on the local and remote computers. You can use the parameters of Restart-Computer to run the restart operations, to specify the authentication levels and alternate credentials, to limit the operations that run at the same time, and to force an immediate restart. Starting in Windows PowerShell 3.0, you can wait for the restart to complete before you run the next command. Specify a waiting time-out and query interval, and wait for particular services to be available on the restarted computer. This feature makes it practical to use Restart-Computer in scripts and functions.
Prerequisites
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
Error details
No response
Environment data
Visuals
No response
The text was updated successfully, but these errors were encountered: