Skip to content

  • Technology
  • Humanities
  • Sports
  • Lifestyle
  • Toggle search form

How to get started learning PowerShell

Posted on June 17, 2022 By admin No Comments on How to get started learning PowerShell

GagoDesign / Shutterstock

“Yes, I know a little about PowerShell,” is perhaps one of the most frequently used statements at technology conferences over the years. Not many statements can be made that can be as underestimated as exaggerated.

Some who say this are quite modest, although they probably know a lot about PowerShell. Others tend to think knowing o PowerShell qualifies as knowledge of how to use it. For those who don’t know how to use it, which is still a big part of the systems and engineering support group, it can be a pretty daunting thought to think about where to start using PowerShell at all. You have heard countless technical speeches, read the pages of articles and had many conversations with colleagues about all that it can do for you. You look up at this rising mountain and all you can do is focus on the top, and it obviously eludes you when it comes to planning how to get to that top. That first step is directly in front of you, at the bottom of the mountain. Let’s take that first step together.

You may not know anything about PowerShell and that’s okay

Let’s get this out of the way. If you don’t know PowerShell, that’s fine. All is well if you know about PowerShell, but it’s okay to clean up if you’ve never used it. Nodding in agreement with colleagues and inserting PowerShell into your resume to hopefully gain an advantage can be a reality much faster than you think. Everyone has their own PowerShell story, and yours will be as unique as your journey through the world of IT support and engineering. You have nowhere to go but upstairs!

According to Microsoft Docs, PowerShell is a multi-platform task automation solution consisting of a command line shell, scripting language, and configuration management framework. PowerShell runs on Windows, Linux and macOS. ” The focus of this post will be strictly on the Shell part of PowerShell and a fundamental focus on that. Other aspects come along with a little more clarity when you get more experience in the PowerShell shell part.

Microsoft has developed PowerShell and is continuously developing 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 the entire universe of Microsoft products. PowerShell enables engineers and support staff to manage their responsibilities more efficiently by enabling mass creation and modification of resources such as files, folders, settings, and configurations. It is best known for its unique and easy-to-use verb-noun cmdlet, which is pronounced ‘command-lets’. Cmdlets are real commands used to do something with PowerShell. Some cmdlets can be run exactly as they are, without defining parameters. Type them, press enter and BOOM! You have the output given to you in the console. If you are familiar with the always faithful command line in the Windows environment, you will feel very comfortable with PowerShell. Many of the commands you would normally run within the command line can also be run within the PowerShell console. If nothing else, try the next time you normally use the command line. See how it can do the same things inside the PowerShell console.

Remove the GUI veil

Most people love their precious GUI. They can see everything they think they need to see, and they get that warm and blurry feeling when they press Apply and then OK. Some of them like to live on the edge and completely skip the pressure of Apply! Finally, as you delve deeper into server, desktop, or Exchange management, you’ll find that you’re endlessly clicking when there’s a change that requires adding 360 users to 20 different Active Directory security groups. Are you ready for that nightmare?

It’s pretty safe to say that PowerShell helps take off the veil that is a precious and beloved GUI. PowerShell allows you to take on the task of putting AD users into multiple groups and designing several commands to get the job done in just a fraction of the time it takes to get it all done through the GUI. The nice thing is that Microsoft he wants to use PowerShell for these tasks. With the emphasis on using PowerShell in many of Microsoft’s major certification exams, it is no longer just for experienced administrators, but is becoming something more and more needed in your daily support tool. It is quite true to say that any action, button, setting or configuration you see in the GUI can be manipulated and set using PowerShell, even down to the smallest details of the registry.

Taking the first steps

Let’s start with just a few cmdlets that you can use right now if you’re reading this on a Windows computer. One thing that most system administrators and engineers communicate with is the service console. If you open the PowerShell console, just enter Get-Service and press enter to get a list of installed services. You’ll get a quick explosion of everything services installed on the local system and their current status Started or Stopped. This output would be handy to see if a particular application service is running or not.

PowerShell Get-Service and Output

You may not want the full list of services and are looking for a specific service. Let’s say you want to see if the spooler service is up and running. You can call it by name using the -ServiceName parameter as follows:

Get-Service -ServiceName spooler

PowerShell Get-Service for spooler service status

This output will give you a unique list for the Print Spooler service and its status. Let’s say the service is currently running or stopped, and you want to stop or start it. You can use the following entry to stop / start the spooler service:

Start-Service -ServiceName spooler
Stop-Service -ServiceName spooler

PowerShell service management with Stop-Service and Start-Service

By default, these lines will not display the status of the service when the command is sent. You will have to run Get-Service -ServiceName spooler to see the current status.

Fortunately, PowerShell is highly customized with wildcards when listing objects and names. Let’s say you need to check out a particular service, but you’re not quite sure what the service is ‘officially’ called. You only know that the first word is distant. That is easy:

Get-Service -ServiceName remote*

PowerShell Get-Service remote wildcard

This entry will list all services starting from remote and allow you to narrow down your search to find the specific service you’re looking for and do whatever it takes. Remember that there is also a Restart-Service cmdlet.

Taking this just one step further to get a return on this little knowledge of services, let’s check out 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 we discussed earlier, but you must add one parameter and value. To check the print spooler service on a remote server called PrintServer01:

Get-Service -ComputerName PrintServer01

This output will list all the services installed on the remote machine, just like the local system we worked on earlier. This cmdlet will save you from using RDP to log in to a remote server to check the service or add a remote server to the local MMC plugin. This ability in itself pays off very quickly.

Another command that can be used right out of the box, without parameters, is Get-NetIPAddress. This cmdlet will give you a list of all network adapters on the local system and a good amount of information about each adapter. In this output you see the internal actions behind the GUI. You can see a lot more information about things you usually see as an icon inside the GUI. The beauty of viewing more information is that you can always use PowerShell to manipulate and search for any of that additional information. For example, if you want to change certain network adapters, you can search or filter only those with a certain value. The possibilities are endless!

Where to find out more

Now that you have the thinnest part of the PowerShell experience, it is up to you to continue your search on the mountain we talked about earlier. Putting one foot in front of the other is as simple as browsing some PowerShell tips resources. A simple Google search on the cmdlet is a good start. Microsoft Docs has a powerful library for each individual cmdlet with many examples of their use. PowerShell itself provides a good resource for explanations and examples. Team Get-Help Get-Service will give you more information about our example above.

PowerShell output for Get-Help Get-Service

One resource that many experienced PowerShell users will remember is the top-rated book by Don Jones and Jeffrey Hicks. These PowerShell giants have the shoulders that many stand on when it comes to conquering PowerShell Mountain. The book is entitled “Learn Windows PowerShell in a Month of Lunch”. This easy-to-read book takes you through the basics of getting to know PowerShell in small chunks and eventually becomes a resource you’ll keep coming back to when you find yourself in 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 very successful community of people with varying degrees of experience. You can always get some guidance from these sources. You won’t be able to climb that mountain if you don’t take steps, so go ahead and see how PowerShell can help you with the daily routine and daily tasks you sometimes dread. You may be anxious to plan and automate a good portion of your workload to give yourself time to learn more about PowerShell!

Technology

Post navigation

Previous Post: Ben Wicker on how Democrats can win in Wisconsin
Next Post: Why this is the most exclusive NBA title for Warriors, as well as how the Celtics let the series slip

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Archives

  • June 2022
  • May 2022

Categories

  • Humanities
  • Lifestyle
  • Sports
  • Technology
  • Travel

Recent Posts

  • A time when I tried polyphasic sleep and lost my mind
  • The future of the iPhone could depend on these revolutionary technologies
  • Magicycle expands its best-selling line with a premium long-range E-bike
  • Trump tried to get behind the wheel – literally – trying to destroy democracy
  • The Pentagon finds vulnerabilities in the blockchain

Recent Comments

No comments to show.
  • About us
  • DMCA
  • Privacy Polic
  • Terms and conditions

Copyright © 2022 .

Powered by PressBook WordPress theme