PowerShell on Mac: The term get-service is not recognized as a name of a cmdlet, function, script file, or executable program


Error:
PS /Users/c2ctech> get-service

get-service: The term 'get-service' is not recognized 
as a name of a cmdlet, function, script file, or executable program.

Check the spelling of the name, or if a path was included, 
verify that the path is correct and try again.

If you are using PowerShell on a Mac running on macOS and you try to make use of the Get-Service or any *-Service commands, you will get an error saying it is not recognized, that is because this cmdlet only supports Windows Operating Systems and not PowerShell for macOS.

Get-Service PowerShell Command Not Recognized on macOS

Alternatively you can try running the below command.

Get-Command -CommandType Cmdlet

Other options: Alias, Application, Configuration, Filter, Script, All, Cmdlet, ExternalScript, and Function.

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org

Copyright Β© Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap