r/PowerShell • • Jan 28 '25

What's the importance of Windows PowerShell?

I am a beginner with PowerShell and scripts of any kind. What is truly the importance of PowerShell. I meet individuals that have scripts and coding of multiple languages memorized. At my age, ummm, yeah right.

I found a list of scripts here:

https://devblogs.microsoft.com/scripting/table-of-basic-powershell-commands/

I'm not sure if there are more but as a previous IT specialist, I never had to use Powershell. I'm currently finishing up my degree and this is part of the class.

Why would anyone need to use PowerShell if you are not a software specialist?

Would an IT Specialist or IT Support Specialist have the need to use PowerShell?

Let me rephrase the previous question. Would a civilian IT Specialist vs Federal IT Specialist be dependent of PowerShell?

In the federal sector, everything is warrantied.

0 Upvotes

54 comments sorted by

58

u/MNmetalhead Jan 28 '25

Not sure what you did in your job as a “previous IT specialist”, but if you did any sort of automations or support of Windows systems at a level above help desk, you’d know how much PowerShell is used.

21

u/Randalldeflagg Jan 28 '25

this. half my day as a sysadmin (not a sysadmin for an msp) is doing something with in a script or creating a script. Syncing data from our HRIS in AD? Script. Need to upload a day copy of a database export? Script. Creating user accounts? Script. Onboard a computer for deployment? Script. Offboarding? Script. Move PII information from one system into a secure system? Yep. Script. Anything I have to do more than a few times gets turned into a script that our RMM tool then executes based on certain events.

4

u/Agile_Seer Jan 29 '25

Maybe it was pre-Win 7 or before PS 3.0? PowerShell was kind of lacking prior to version 3.

1

u/Luc-e Jan 29 '25

Also regular stuff in o365 must be done via powershell because gui is lacking

15

u/ImperialKilo Jan 28 '25

The biggest breakthrough with powershell is the standardization of all of Windows' many APIs in to a defined syntax. Automation languages have existed before, like VBscript, but powershell has opened up the Operating system to automation in a way that was simply inpossible to scale before.

Other commenters mention why it's important in an IT professional's workflow, but standardized syntax across hundreds of Windows APIs, third party applications, Microsoft's Azure, and now even other operating systems means you can automate things that were previously un-automatable, at least with any reasonable expectation of sustainability.

As an example of its usefulness cross platform - i can write a script that connects to Azure, automatically creates VMs with resources specified by a text file, creates local users based on groups in Active Directory (doesnt matter if the OS is Windows or Linux the command is the same), install programs right from application repositories, update the Operating system, configure the device in Intune (or other device management systems) and all that is done natively.

No third party tools, no custom scripts or APIs - and this comes with a reasonable expectation of support and updates. Truly one of Microsofts best ideas to date.

9

u/Th3Sh4d0wKn0ws Jan 28 '25

I found a list of scripts here:

https://devblogs.microsoft.com/scripting/table-of-basic-powershell-commands/

you found a list of commands not scripts. Windows Powershell, and now Powershell (a cross platform version of Powershell available on Windows/MacOS/Linux) is a command line and scripting language.

You can probably do most of the things you need to do in a given IT profession without Powershell, but you can do them faster and more efficiently with Powershell.

Primarily Powershell is about automation, but it's also about administration. I work with IT people that don't use Powershell at all and perform a given task by doing XYZ, and I work with IT people who do use Powershell and perform the same task by typing out a couple Powershell commands.

You don't have to use it, but you can get a lot done if you do use it.

21

u/SearingPhoenix Jan 28 '25

*pushes up glasses* Uhm, those are technically cmdlets*.*

2

u/Thotaz Jan 29 '25

Wrong. "Command" is the generic term for commands in PowerShell. This includes external applications like cmd.exe, aliases like ft and of course cmdlets like Get-ChildItem.
Because the list includes aliases and functions it is more correct to call it a list of "commands" rather than a list of "cmdlets".

1

u/SearingPhoenix Jan 29 '25

.... I was mostly trying to poke a bit of fun at PowerShell coining the term 'cmdlet' in the first place.

1

u/Thotaz Jan 29 '25

I recognize that it was a joke but the "nerdy correction" meme only really works if the correction is actually correct.
if there was a video where someone runs but a commenter says something like "... the part where they walked towards..." and someone goes "Well actually, they ran" then that's kinda funny. The opposite situation where they walked and someone incorrectly states "well actually, they ran" isn't funny in any way.

9

u/DizzyWisco Jan 28 '25

Your question feels like some homework that would be asked in a beginner OS class at a tech school.

PowerShell is a powerful tool for IT professionals, administrators, and even security specialists. Its importance comes from its flexibility, efficiency, and ability to manage systems at scale, whether you’re in the private sector, federal sector, or any other IT-related field.

One of the primary benefits of PowerShell is automation. It allows you to automate repetitive tasks, saving time and reducing the chance of human error. For example, tasks like creating hundreds of user accounts in Active Directory or setting permissions across a file system can be scripted and completed in seconds. Additionally, PowerShell is essential for system management, as it can configure systems, query system information, and perform administrative tasks locally or remotely.

PowerShell is also versatile and no longer limited to Windows systems. PowerShell Core (now just PowerShell) is cross-platform and works on Linux and macOS, making it ideal for managing mixed environments. Beyond its versatility, PowerShell is a valuable troubleshooting tool. It can automate troubleshooting steps, such as checking system logs, diagnosing network issues, or querying the status of services. Its integration with other technologies, including Microsoft 365, Azure, VMware, and SQL Server, further increases its importance in cloud and hybrid environments.

In civilian IT roles, PowerShell is essential for tasks like managing Active Directory, Exchange, and Microsoft 365, patching and updating systems, deploying software and configurations, and generating reports on system health or compliance. While smaller organizations may not rely heavily on scripting, enterprise-level environments often require PowerShell expertise to handle large-scale operations efficiently.

In the federal sector, even with standardized and regulated environments where systems are often under warranty or supported by third-party vendors, PowerShell plays a significant role. It is useful for compliance and security audits, customizing solutions to meet federal requirements, managing legacy systems, and operating in restricted environments where GUI-based tools might not be available. While workflows may be more rigid in the federal space, PowerShell is still essential for automating compliance checks or managing secure systems.

For anyone in IT, learning PowerShell is a valuable investment. It enhances efficiency, helps with career growth, and equips you to solve complex problems. The good news is that you don’t need to memorize commands—PowerShell has great built-in help and tab-completion features. Start with the basics, such as simple commands (Get-Process, Get-Service) or small scripts that automate routine tasks. The link you shared is an excellent resource for getting started, and Microsoft’s documentation and community forums can provide additional support.

To learn PowerShell, focus on practical tasks related to your work or studies. Experiment with IT-related scenarios, such as automating small tasks or managing systems in a home lab. Over time, you’ll build confidence and gain a deeper understanding of how PowerShell can streamline your work. Even if you don’t currently need it, knowing PowerShell can set you apart and prepare you for future opportunities. Remember, it’s not about memorizing commands—it’s about using PowerShell as a tool to solve problems and improve efficiency.

-2

u/_Meke_ Jan 28 '25

You sound like AI.

4

u/AdreKiseque Jan 29 '25

High chance they got that generated lol

6

u/cous_cous_cat Jan 29 '25

Wow it's almost like AI is trained on human writing

0

u/Kershek Jan 29 '25

Was it wrong?

2

u/CistemAdmin Jan 28 '25

It's about automating processes.

Ultimately we are required to evaluate the work we are going to be able to complete and the amount of time it takes to complete it.

Automating tasks is a great way to prioritize your focus towards important tasks and tasks that can't be automated.

An example I can provide.

I have a very lengthy install process that needs to be performed fairly regularly on devices in our network.

In order to better facilitate this process. Whilst going through the install the first time, I documented the steps I took, and translated those steps into an automated install script using powershell.

I can then take that install script and send it to several clients and initiate the installation so it can run while I focus on other tasks.

I've done this with 80 devices so far and it takes me 5 mins via my automated method where the byhand installation takes about an hour if you are present ready to click the right box and start the next step.

2

u/Status-Lock-3589 Jan 28 '25

I wanna tag along here...

Its about taking something that needs to be done multiple times the same way.

Takes out human error as it's always the same (no typos)

Takes out the repetition

Here's another example. I have 4 test servers. They all host several SQL databases that are restores of Prod data. Devs use these to work against and they want a new version restored every night.

So now I know I have to do the same task 4 times and they all take 30 mins each manually. 2 hours!!

So, I write a powershell script that

  • Takes the prod backup

  • Stores it on a network share

  • For each of my Dev/Test servers i restore a copy of that back up

  • Email myself when its all done

Now.... i can set it to trigger in Windows Task Schdduler. Now it's automated. I dont have to touch it and I'll get an email with a happy emoji when it works and a sad one if it doesn't.

Along the same idea.... some one wanted an email with server uptime sent out daily. So... I'd have to

  • log into each server

  • open task manager

  • click the performance tab

  • read, then write an email... FOR ALL THE SERVERS!

OR.. I can write a script that hits each server and gets the uptime with literally a couple lines of code. Done. Automated.

TLDR, learn powershell if you wanna drink coffee and watch cartoons while the bots do your job. #lazydev

1

u/Ill_Market_5726 Jan 29 '25

Question. How exactly were you able to automate the gui's with powershell? This would come in quite handy.

1

u/BlackV Jan 29 '25

you dont (generally) that's the point, this is the tool so you dont use the GUI

1

u/Status-Lock-3589 Jan 30 '25

I'm not sure I fully get the question... butnibe automated GUI stuff with invoke Web Requests.

One example is a script I use to update software that doesn't have an update automation. So...

I do a quick powershell command to verify the version installed in the registry... then I do a web scrape with get web request to verify the newest version online.

Another example is there's a log file at work that needs to be downloaded from a button click on a web page and uploaded. I use get web request to identify the button element, then I use invoke web request to click that button... download the file and go from there.

Another example (yall yawning yet?) I've used the same techniques to scrap web data to see if certain TCG cards are in stock. Automating through the load page, type in the search, click search, and return any in stock results.

2

u/CriticalMine7886 Jan 28 '25

I'm an IT manager in the UK, and I've been doing a wide array of IT tasks for about the last 25 years in IT support, system management, and server admin.

PowerShell (for me, at least) is not about software, except in the loosest sense; it's about automating and driving other systems - it is an enabler and a time saver.

There are lots of valid ways of getting that automation, but PowerShell has the advantage of being a natural fit in the Microsoft ecosystem - MS build the tool to work with their environment, and it does it really well.

Unless your specialism is _very_ niche and primarily outside of the MS world, then yes, you will use PowerShell wherever you end up. It is ubiquitous enough that you will end up working with it even if the scripts aren't yours.

That's just my view, of course, but I have libraries of scripts in earlier languages, and I don't enjoy writing PS particularly, but I find there are more and more instances where it is the right tool for the job. I will caveat that by saying I work almost exclusively in the Microsoft world.

2

u/SysAdminDennyBob Jan 28 '25

Simplifying this to basic notions.....There are two ways to manage the Windows operating system and all its various components and applications.

  1. walk up to a screen and use the mouse+keyboard and click on all the little various menus and modify settings or take actions on things like folder. click click click click all day long, until your finger falls off. Then walk over to some other computers and click click click click click again. repeat that everywhere, walk the hall, click some more, walk to another floor in the building, click click click

  2. Or use powershell. With a one-line command you can replicate a million mouse click actions. With a powershell script you can replicate a billion mouse clicks over thousands of computers.

Manual versus automated. Powershell can interact with every coded object on the system and it is consistent in its format. There are other scripting tools that can do this as well but Powershell is really well situated for the particular task of managing windows devices. It was purpose built for the task.

1

u/AnayaBit Jan 29 '25

This ^ And I prefer deal with powershell rather than the end user

2

u/SearingPhoenix Jan 28 '25

Beginning PowerShell user: What's this WMI thing?
Intermediate PowerShell user: This WMI thing seems kinda cool.
Advanced PowerShell user: WMI scares me.
Adept PowerShell user: WMI is awesome.
Master PowerShell user: What the hell, WMI?

2

u/qordita Jan 28 '25

I have to go through 15k users and add a select 8k of them to an email list. Tomorrow, 12 people might not qualify to be on that list so I have to remove them.

I can either do that manually or I can script it so it happens automagically.

2

u/Ok_Business5507 Jan 28 '25

I am a SE/SA and I use Powershell every day to automate tasks that repetitive, and/or require reporting or modifying a significant number of targets. The more I use PS the more ways I find the make my job easier.

For example, I am a VMware admin. I use PS to report on all the VMs that have snapshots. I can traverse multiple vCenters and assess hundreds (or thousands) of systems and report back what has a snapshot, how old it is, and who created it.

I also just wrote a PS script to report on A/D accounts that have expired or not been logged into for x-days, disable them, and move them to a disabled accounts OU.

The help desk guys use a script to create new users. There are countless possibilities for what PS can do given the array of modules available (active directory, VMware, NetAPP, Horizon View, etc.). I do not see a difference in the benefit of PS between commercial and federal IT. Done them both.

1

u/Darketernal Jan 29 '25

PowerCLI FTW

3

u/BlackV Jan 29 '25

its honestly one of the best modules ive seen written, they were always top of their game, really good help and examples and a well laid out cmdlets

its about 6 billion times larger then it was way back in the day

1

u/tristand666 Jan 28 '25

I use Powershell to automate the onboarding process by pulling information about new users from the ERP logs and then creating a mailbox and applying basic licensing. When I started they were creating on prem mailboxes manually and manually migrating them to the cloud. When I worked at Verizon Enterprise like 10 years ago, we used Powershell to partially automate VMWare host upgrades. I believe there was some Powershell automation involved in the auto provisioning of VMs for their "Uppernet" (if you remember that marketing).

So many great things you can use it for and not just Microsoft.

1

u/AdreKiseque Jan 29 '25

It's a terminal shell and scripting language, it does what you'd expect from those. Basic command-line operations like creating, moving, deleting files? Iterating through large amounts of data and parsing it? Check. Iterating through large amounts of files and performing basic operations like creating, moving or deleting them? Check and check.

It's like bash but on Windows. Except you can also use PowerShell on Linux. And also you can technically use bash on Windows as well. So I guess it's kinda just "like bash".

1

u/chaosphere_mk Jan 29 '25

PowerShell isn't a programming language. It's a shell scripting language. Reusable code that can perform regular tasks is absolutely invaluable to any systems admin or support specialist.

Why do a process that takes 1 minute per user on 150 users? That's 150 minutes. A powershell script can do all of that in seconds.

And this is only one example.

1

u/gordonv Jan 29 '25

What is truly the importance of PowerShell.

To be able to automate very difficult tasks that you specifically need into very easy, 1 click solutions.

The tasks you specifically need will be unique to you and your situation. They won't be pre made for you. There will be handy tools. Some that will make you change your methods in order to incorporate them into your overall plans.

1

u/Mr_Enemabag-Jones Jan 29 '25

I manage a global VMware platform. I spend probably 70% of my days in Powershell.

I would quit if I could automate pretty much all of my common tasks

1

u/gordonv Jan 29 '25

Why would anyone need to use PowerShell if you are not a software specialist?

For the same reason a non computer expert would use a computer today.

You don't need to be a perfect expert to use programming nor to use a computer. You just need what gets your job done.

1

u/Gmantle22 Jan 29 '25

I wish I knew PowerShell when I started my career as a helpdesk IT Specialist, it would have made my job 100x easier.

1

u/gordonv Jan 29 '25

Would an IT Specialist or IT Support Specialist have the need to use PowerShell?

Yes.

A common task is to automate repetitive tasks.

For example, lets say there are 100 people that need password changes. If you know what users and what programs need the changes, you could assign new scrambled passwords and email said passwords out to the users.

But what if that password was the email password and you can't email them. Ok, email their boss and have them hand it to the user. Or call them up with the phone number you were able to get via programming.

1

u/gordonv Jan 29 '25

Would a civilian IT Specialist vs Federal IT Specialist be dependent of PowerShell?

Dependent? That's situational. Probably dependent on some programs and maybe some programming language. Nothing guaranteed that it would be Powershell.

1

u/gordonv Jan 29 '25

To be honest, it sounds like you're really adverse to programming of any kind. For this, I recommend r/cs50.

1

u/jdkc4d Jan 29 '25

Imagine you needed to do something on 100 computers. You could do that by hand or you could script it. Now imagine you have to do that something on thousands of computers. It's now no longer feasible that you could do it by hand without either a lot of help or by just scripting it. As you move forward in IT you will find that every OS has multiple ways of scripting important functions.

PowerShell was written on top of .NET as a replacement to batch (.bat) scripts. Because it's based on .NET that has allowed developers outside of Microsoft to contribute modules that can be used easily with PowerShell. The ecosystem has exploded in the last decade.

1

u/kennyj2011 Jan 29 '25

You will need to learn at least one scripting language in order to perform automation. If you are focusing on Microsoft technologies, powershell is required for configuration and management of some Microsoft products as well. It is best to become proficient in powershell, python, or Linux shell scripting. You will go further in your career and be able to accomplish “magical” things.

1

u/icepyrox Jan 29 '25

Powershell is a tool. Ot can help with automation and with completing tasks if you want it to.

As it is largely used in, on, and for Windows and as Windows often has its GUI enabled, and that GUI has snap-ins and apps for everything you need, you don't need it.

I mean, you don't need a dishwasher in your kitchen either. Some people have a separate freezer from the fridge, and some people have an air fryer.

You don't need those things, but I have all those things and use them regularly.

1

u/exonroot Jan 29 '25

It's the easiest way to interact with and control windows. Adding users and other AD things, permissions, security settings, and certificates. It also acts as a command line, so that's like saying what's the importance of a .bat file.

1

u/pnlrogue1 Jan 29 '25

Learning PowerShell as an IT Support Engineer allowed me to resurrect an entire child company after someone managed to terminate every employee in said company on Friday afternoon and our automation happily deactivated all their accounts until the problem was noticed on Monday morning. I had to enable hundreds of accounts, move them to the right OU, and change a few settings in their account. Good luck doing that by hand on the timeline I had available to me.

1

u/blyss73usa Jan 29 '25

I am a system admin in healthcare. I use powershell a lot. A. Lot. Newer versions of Windows server have a headless version that is managed mostly by powershell.

1

u/Latinprince6591 Jan 29 '25

Any tech should use powershell 7.4.6 to beware of how their system run the command used in powershell let you expand explore windows, Linux Mac OS with no issue must be a jack of all trade and powershell scripts turn to modules, have also tool-making in powershell is an advantage

1

u/ssouth2002 Jan 29 '25

It's a language used to automate commonly performed tasks. If you find yourself doing something over and over again, find out how to script it.

1

u/DEADfishbot Jan 29 '25

I'll tell you when you're older son

1

u/[deleted] Jan 29 '25

PowerShell is literally my entire job. You use it to solve problems at scale.

Right now I have 13000 endpoints. Sometimes some of them get into patching loops and don't get the latest updates but show no errors in our RMM.

I can use PowerShell to query the logs of our RMM's API to find devices that are installing the same patch over and over again.

This is just one of many problems I can solve with PowerShell. It's extremely useful and if you don't see how it's useful for it and systems administration you are very confused.

1

u/LogMonkey0 Jan 29 '25

I use Powershell every single day as a sysadmin.

1

u/Relative_Test5911 Jan 29 '25

App Engineer and Sysadmin here and PS scripts are daily thing for automating repetitive tasks in windows/MS services e,g M365 as well as other apps that may have PS modules or any app that has API services.

1

u/newboofgootin Jan 29 '25

This post needs ritalin.

1

u/HappyCamper781 Jan 29 '25

For basic users, PowerShell is a convenience not a requirement.

For administrative support staff, PowerShell is a Requirement not a Convenience.

By the tone of this entire post, you've shown your skillset to be much closer to basic user rather than technical / administrative.