“Yes, I know a little PowerShell” may be one of the most used expressions at technology conferences over the years. Not many expressions can be given, which is as low as it is overstated.
Some who say this are very modest, although they know a lot about PowerShell. Others tend to think deliberately about PowerShell is classified as knowing how to use it. For those who still don’t know how to use the system support and a large part of the engineering community, it can be a very difficult idea to think about where to start using PowerShell. You’ve heard countless technical speeches, read pages of articles, and talked a lot with your peers about everything he can do for you. You look at this growing mountain, and the only thing you can do is focus on the summit, and what you discover when you plan how to reach that summit escapes you. That first step is right in front of you, at the bottom of the mountain. Let’s take this first step together.
You don’t know anything about PowerShell, and that’s fine
Let’s get it out of the way. If you don’t know PowerShell, that’s fine. If you know about PowerShell, everything is fine, but if you’ve never used it, it’s good to be clean. Throwing your PowerShell into your CV to shake your head and gain an advantage in peer discussions can happen faster than you think. Everyone has their own PowerShell story, and your story will be as unique as your journey into the world of IT support and engineering. You have nowhere else to go!
According to Microsoft Docs, “PowerShell is a cross-platform task automation solution consisting of a command line shell, a scripting language, and a configuration control framework. PowerShell works on Windows, Linux and macOS. ” This post will focus on the Shell section of PowerShell and the main focus. As you gain more experience in the shell part of PowerShell, other aspects become a little clearer.
Microsoft has developed PowerShell, and it is constantly evolving PowerShell to interact with Windows desktop operating systems, Windows Server operating systems, Office 365 resources, and Azure cloud resources. It will be an integral part of almost all Microsoft products. PowerShell allows engineers and support staff to manage their tasks more efficiently, allowing for the mass creation and modification of resources such as files, folders, settings, and configurations. It is known for its unique and user-friendly verb nomenclature of cmdlets, most commonly pronounced as ‘command-lets’. Cmdlets are actual commands used to do something with PowerShell. Some cmdlets can be run as they are without any defining parameters. You enter them, press enter and BOOM! You have a speech on the console. If you are always familiar with a reliable command prompt in a Windows environment, you will feel very comfortable with PowerShell. Many of the commands that you normally run in a command prompt can also run in the PowerShell console. If you have something, try it next time you use the command prompt. See how it can do the same thing in the PowerShell console.
Peel back the curtain of the GUI
Most people love valuable GUIs. They can see everything they think they need to see, and when they press Apply, then they feel those warm and fuzzy feelings. Some of them like to live outside and completely skip the Apply button! Finally, as you delve deeper into servers, desktops, or Exchange management, you’ll find yourself in endless clicks when there’s a change that requires adding 360 users to 20 different Active Directory security groups. Are your fingers up for this click nightmare?
It is safe to say that PowerShell helps to peel off the cover, which is a valuable and beloved GUI. PowerShell allows you to perform this task, such as grouping AD users into several groups, and compiling several commands to do the job in just a fraction of the time it takes to do so through the GUI. The best thing is that Microsoft wants you must use PowerShell for these tasks. By focusing on the use of PowerShell in many basic Microsoft certification exams, it is no longer just for experienced administrators, but daily support tools are becoming something more in-demand in your inbox. Suffice it to say that any action, button, parameter, or configuration you see in the GUI can be manipulated and defined down to the smallest detail in the registry using PowerShell.
Taking the first steps
Let’s start with a few cmdlets that you can use now if you are reading it on a Windows PC. One thing most system administrators and engineers interact with is the Service Console. If you open the PowerShell console, simply enter it
Get-Service and press enter to get a list of installed services. You will … buy all rapid explosion services installed in the local system and their current Running or Suspended status. This output would be useful to see if a particular software service is working.
You may not want a full list of services and are looking for a specific service. Suppose you want to see if the spoiler service is working. -Using the ServiceName parameter, you can call it by name:
Get-Service -ServiceName spooler
This output will give you a single list for the Print Spooler service and its status. Let’s say the service is currently up or running, and you want to either stop it or start it. You can use the following entry to stop / start the spoiler service:
Start-Service -ServiceName spooler Stop-Service -ServiceName spooler
By default, these lines will not list service status when a command is sent. You will have to run
Get-Service -ServiceName spooler to look at the current status.
Fortunately, PowerShell is very wild when listing objects and names. Let’s say you need to check a certain service, but you are not sure what the “official” name of the service is. You only know that the first word is far away. It’s easy:
Get-Service -ServiceName remote*
It will list all the services that started with the login remotely and allows you to narrow down your search to find the specific service you are looking for and do everything you need to. Remember that there is also a Restart Service section.
To get back to this little knowledge about services, take it a step further, let’s test the services on a remote computer. Suppose you are in a Windows domain environment and have administrative access to the remote computers you manage. You can use the same cmdlets discussed earlier, but you must add a parameter and a value. To test the print spoiler service on a remote server called PrintServer01:
Get-Service -ComputerName PrintServer01
This output, like the local system we did earlier, will list all the services installed on the remote machine. This cmdlet will save you from using RDP to access the remote server to test the service or adding the remote server to the local MMC snap-in. This ability pays off very quickly in itself.
Another command that can be used immediately from the box without settings is Get-NetIPAddress. This cmdlet will give you a list of all network adapters in the local system and enough information about each adapter. In this speech, you will see the internal work behind the GUI. You can see more information about what you usually see as an icon inside the GUI. The beauty of seeing more information is that you can always use PowerShell to manipulate and search for any additional information. For example, if you want to make changes to custom network adapters, you can only search for or filter those that have a certain value. The possibilities are endless!
Learn More Where
Now that you have the most subtle slices of the PowerShell experience, it’s up to you to continue your search to the mountain discussed earlier. Putting one foot in front of the other is as easy as looking at some transition sources for PowerShell tips. A simple Google search in Cmdlet is a good start. Microsoft Documents has a powerful library for each cmdlet with many examples of how to use them. PowerShell itself provides a good source for explanations and examples. Command
Get-Help Get-Service will tell you more about our example above.
One resource that many experienced PowerShell users will remember is the highly regarded book by Don Jones and Jeffrey Hicks. These PowerShell giants have the shoulders that many stand on when it comes to conquering Mount PowerShell. The book is called “Learn Windows PowerShell for a month at lunch.” This easy-to-read book teaches you the basics of PowerShell and becomes a resource you will constantly refer to when faced with a situation where you need to use PowerShell.
The PowerShell community is also a very open and useful place to learn. Subreddit r / PowerShell and PowerShell.org have a thriving community of people with different levels of experience. You can always get some instructions from these resources. If you don’t take steps, you won’t be able to grow that mountain, so go ahead and see how PowerShell can help you with your daily and sometimes scary daily chores. You can find yourself crazy to plan and automate a good portion of your workload so you can take the time to learn more about PowerShell!