
PowerShell, a valuable Windows administrator tool, combines the flexibility and speed of a scripting language with the speed of a command-line. Microsoft recently set the goal of making PowerShell the preferred management tool. It is required for almost all new Microsoft products. You cannot perform many management tasks without knowing how to use the command line. You must be familiar with PowerShell in order to become a great Windows administrator. These are the top 10 commands you need to master in order for your career as a Windows administrator to flourish. Let’s take a look at them in more detail.
1. Get-Service
PowerShell’s popular command Get-Service provides a comprehensive list of all services installed on your system. To get more information about a service, you can simply append the “-Name” switch to the end of the name. Windows will then show you the current state of the service.
2. Get-Help
If you are a Windows administrator, Get-Help should be your first PowerShell cmdlet. This command can be used to assist you with any PowerShell command. If you don’t know what Get-Process is, you can just type “Get-Help-Name Get-Process”. You can also use Get-Help with individual nouns and verbs. You can use Get-Help to find out which commands are compatible with the verb “Get” for a particular program. Just type “Get-Help-Name Get”
3. Stop-Process
Sometimes a process can freeze or stop. The Get-Process command is useful in such cases. It can be used to determine the process ID or name of the process that has stopped responding. This command can be used to terminate the process after you have identified which one it is. You can stop the process by identifying its ID PID or its name. If Notepad stops responding to commands, you can use Stop-Process to close it using the following commands: “Stop -Process-Name Notepad” or “Stop -Process-ID 3952”. It is important to note that the process ID can change from one session to another. It is therefore important to know how to find this number.
4. Set-Execution policy
You can create and execute PowerShell commands. Microsoft has now disabled scripting as a default to prevent malicious code from being executed in the PowerShell environment. You can control the security of the PowerShell scripting environment by using the Set-Execution Policy command. There are four levels to security available:
All Signed – You can set the execution policy as All Signed to execute scripts.
Restricted – This is the default execution policy that blocks PowerShell, so that commands can only be entered interactively.
Unrestricted – It removes all restrictions from the execution policy.
Remote Signed – When the execution policy is set to Remote Signed then PowerShell scripts that have been created locally will be allowed to execute. Remotely created PowerShell scripts can only be run if they are signed by a trusted publisher.
To set the execution policy, you can use the Set-Execution Policy command. To allow scripts to run unrestricted, type “Set-Execution Policy Unlimited”.
5. Get-Process
Get-Process, a Windows PowerShell command that displays a list of all processes currently running on the computer, is a basic Windows PowerShell command.
6. Get-Execution Policy
Get-Execution Policy, one of the most common Windows PowerShell cmdlets, is something every Windows administrator should be familiar with. Before you can run the script, you must be familiar with the current execution policy on the server you are working on. This command will help you find out if you don’t know how.
7. Convert to-HTML
PowerShell can provide a lot of information about the system. However, you may need to do more than rely on the information on your screen. It is extremely helpful to create a report that you can send to someone else. Convert To-HTML is a great way to do this. You can simply pipe the output of any other command into it. To control which output properties should be included within the HTML file, you will need to use -Property. You will also need to give a filename.
8. Export-CSV
You can also create an HTML report using PowerShell data. PowerShell also allows you to export your data to a CSV file. To open such a file, you can use Microsoft Excel. This syntax is similar to the one used to convert the command output to an HTML report. Before exporting data, you will need to specify the filename. You can also export a list system services to your system to the CSV fi