The Linux operating system has long offered more power and flexibility to its administrators through shell scripting. Microsoft Windows did not have this flexibility due to limited command line capabilities.
To overcome this limitation, Microsoft introduced PowerShell to effectively automate tasks and manage settings. It is built with .NET Framework and provides full access to COM and WMI.
PowerShell is a tool for scripting and task automation on Windows systems. PowerShell has cmdlets by default, which perform predefined tasks.
There are hundreds of cmdlets for PowerShell available, designed to perform various administrative tasks.
This will forcefully shut down the Firefox browser if it is running.
Mandate: Stop-Process -Name Firefox
This will display all the processes currently running on the system in table format.
Command: Get-Process | Format-Table
It will display all the logs related to "Security" from the current system.
Mandate: Get-EventLog -Log “Security”
It will display all "Security" related events in the security.csv file on drive E.
Mandate: Get-EventLog -Log “Security” | Export-Csv E: \ security.csv
It will display a list of all services in the current system and their status, in tabular form.
Command: Get-Service | Format-Table
It will display detailed usage information about the Format-Table cmdlet.
Command: Get-Help Format-Table
This will get details about the operating system that is installed.
Command: Get-CimInstance CIM_OperatingSystem
Lists all local users on the current system.
Mandate: Get-WmiObject -Class Win32_UserAccount -Filter "LocalAccount = 'True" "