Skip to content

Missing Stop-Computer cmdlet #5448

Closed

Description

The Stop-Computer cmdlet is missing:

PS /home/leo> Stop-Computer                                                    
Stop-Computer : The term 'Stop-Computer' is not recognized as the name of a 
cmdlet, function, script file, or operable program. Check the spelling of the 
name, or if a path was included, verify that the path is correct and try 
again.
At line:1 char:1
+ Stop-Computer
+ ~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Stop-Computer:String) [], Comm 
   andNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Would it be possible to either add it in, or document that it is not available?

Activity

  1. SteveL-MSFT commented on Nov 15, 2017

    @SteveL-MSFT
    Member

    Please include $PSVersionTable information as requested by the template next time, please. Based on your prompt, it looks like you're on Linux. The *-Computer cmdlets depend on WMI so they don't work outside of Windows currently. It would be great if the community could port them to non-Windows.

  2. added
    Up-for-Grabs
    on Nov 15, 2017
  3. NoraCodes commented on Nov 15, 2017

    @NoraCodes
    Author

    Ah, sorry; I missed that was suppose to be included. My version is

    Name                           Value                                          
    ----                           -----                                          
    PSVersion                      6.0.0-beta                                     
    PSEdition                      Core                                           
    GitCommitId                    v6.0.0-beta.7                                  
    OS                             Linux 4.10.0-38-generic #42-Ubuntu SMP Tue O...
    Platform                       Unix                                           
    PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                        
    PSRemotingProtocolVersion      2.3                                            
    SerializationVersion           1.1.0.1                                        
    WSManStackVersion              3.0  
    

    Is there documentation somewhere that WMI cmdlets aren't available off of Windows? If not, could that be added? I'm not really familiar with the Windows environment, and it's fairly counterintuitive as to where various cmdlets come from (since the documentation I've found online doesn't mention it).

    Anyway, thanks for the info! I'll fall back to using SMB or something.

  4. SteveL-MSFT commented on Nov 15, 2017

    @SteveL-MSFT
    Member

    Documentation is currently missing, something we'll need to add to the release notes. The best resource currently is probably this test file: https://github.com/PowerShell/PowerShell/blob/2be13a623eae2583604ab51449eefc10a8fd9c12/test/powershell/engine/Basic/DefaultCommands.Tests.ps1

  5. added
    Hacktoberfest
    First-Time-Issue
    on Feb 19, 2019
  6. shadetree-dev commented on Mar 1, 2021

    @shadetree-dev

    Stop-Computer only works locally if running PowerShell (7.1.1) on MacOS. There is no recognized "-ComputerName" flag. Is this intended or is it still a missing feature?

  7. TravisEz13 commented on Mar 2, 2021

    @TravisEz13
    Member

    -ComputerName uses WMI/WSMan. So, yes this is intended. I think you are asking for a new feature for this to support -HostName to run this over SSH remoting?

  8. shadetree-dev commented on Mar 2, 2021

    @shadetree-dev

    That makes a lot of sense actually, thank you for that clarification. I wasn't originally asking for that to be a feature, but it does sound like a great idea!

  9. TravisEz13 commented on Mar 2, 2021

    @TravisEz13
    Member

    If that is what you want, Please file a feature request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    First-Time-IssueHacktoberfestPortingResolution-FixedUp-for-GrabsWG-Cmdlets

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions