Thumbnail: windows

A Quick Introduction to Powershell Commands

by on under TryHackMe
2 minute read

A Quick Introduction to Powershell Commands

Powershell is a powerful command-line interface (CLI) and scripting language developed by Microsoft. It allows you to perform a wide range of tasks, such as managing local and remote servers, automating tasks, and creating custom scripts.

Here are a few basic Powershell commands that you should know:

  1. “Get-Command” - This cmdlet displays a list of all available Powershell cmdlets. You can use the “-Module” parameter to display only the cmdlets in a specific module, and the “-Verb” parameter to display only cmdlets with a specific verb.

  2. “Get-Help” - This cmdlet displays help information for a specific cmdlet. For example, if you want to learn more about the “Get-Process” cmdlet, you can enter “Get-Help Get-Process” into the Powershell console.

  3. “Get-Service” - This cmdlet displays a list of all services on the local computer. You can use the “-Name” parameter to display only a specific service, and the “-Status” parameter to display only services with a specific status.

  4. “Start-Service” and “Stop-Service” - These cmdlets allow you to start and stop services, respectively. For example, if you want to stop the “Print Spooler” service, you can enter “Stop-Service Spooler” into the Powershell console.

  5. “Get-Process” - This cmdlet displays a list of all processes on the local computer. You can use the “-Name” parameter to display only processes with a specific name, and the “-ID” parameter to display only a specific process.

  6. “Stop-Process” - This cmdlet allows you to terminate a specific process. For example, if you want to terminate the “notepad.exe” process, you can enter “Stop-Process -Name notepad” into the Powershell console.

  7. “Get-EventLog” - This cmdlet displays a list of events in an event log. You can use the “-LogName” parameter to specify a specific event log, and the “-Source” parameter to display only events from a specific source.

  8. “Clear-EventLog” - This cmdlet allows you to clear an event log. For example, if you want to clear the “Application” event log, you can enter “Clear-EventLog -LogName Application” into the Powershell console.

These are just a few basic Powershell commands to get you started. With practice and a bit of experimentation, you’ll be well on your way to mastering this powerful tool. There are many resources available online to help you learn more about Powershell and how to use it effectively.

Windows
comments powered by Disqus