Windows PowerShell

PowerShell is a command-line shell and scripting language designed for windows system administration. Windows PowerShell helps to control and automate the administration of Windows operating systems and of applications that run on Windows. PowerShell built on the Microsoft .NET Framework.

In windows, powershell helps to complete various tasks. The following list is a sampling of these tasks…

Manage processes — To list , stop, and start processes.

Use Windows Management Instrumentation (WMI): To manage not only Windows, but also other platforms such as IIS and Terminal Services.

Manage the file system: To create, delete, modify, and set permissions for files and folders.

Manage a number of Windows roles and features: To add or remove roles and features.

Manage services: To list, stop, start, restart, and even modify services.

Manage the Registry: To list , stop, and start processes.

Use existing Component Object Model (COM) objects: To complete a wide range of automation tasks.

PowerShell command examples

Get-Help : Command to get help with any other command.

Eg: Get-Help -Name Get-Process

Get-Process: To get list of processes that are currently running on the system.

Stop-Process: To terminate a process. You can terminate a process either by its process name or by its process ID.

Eg: Stop-Process -Name notepad
Stop-Process -ID 2668

Set-ExecutionPolicy: Command to control the level of security PowerShell scripts

Restart-Computer: To restart a remote computer or computers

Restart-Service: To restart a service with PowerShell

dir r | select string “test”: To search recursively for a certain string within files

ps | sort p ws | select last 3: Find the three processes using the most memory

invoke-command -computername mac1, mac2 -filepath c:\Script\scriptsample.ps1: Run a script on a remote computer

Get-Eventlog: The Get-Eventlog cmdlet retrieves Windows event logs

If you require help, contact SupportPRO Server Admin

Server not running properly? Get A FREE Server Checkup By Expert Server Admins - $125 Value

Leave a Reply