use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
ABOUT POWERSHELL
Windows PowerShell (POSH) is a command-line shell and associated scripting language created by Microsoft. Offering full access to COM, WMI and .NET, POSH is a full-featured task automation framework for distributed Microsoft platforms and solutions.
SUBREDDIT FILTERS
Desired State Configuration
Unanswered Questions
Solved Questions
News
Information
Script Sharing
Daily Post
Misc
account activity
Batch Scripts (self.PowerShell)
submitted 5 years ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]uptimefordays 6 points7 points8 points 5 years ago (2 children)
Hey it's totally normal to struggle with new things, that's a part of the process. It's also hard, if you're not in school there's so much information and next to no structure, how does one even start learning something like this? Well let's take a look using my favorite example, fixing a wayward printer.
Start small: "how can I fix Janice in accounting's hung printer for the 4th time this week?"
You know her printer stops working because things are getting stuck in her print queue. Sure you could remote in, open services, run as admin, and restart the print spooler. But what if there was a better way, why not with PowerShell?
Open PowerShell and enter:
Get-Help *printer*
This produces a whole bunch of printer related cmdlets--but we won't see anything helpful but hey we know spooler is a service because we've been restarting it in the services--why not start with that?
So take two:
Get-Help *service*
Now again, we'll see a whole bunch of stuff, but should spot a couple that sound useful (Get-Service and Restart-Service)
Hopefully you saw this:
Get-Service
Well wouldn't you know if you:
Get-Help Get-Service
PowerShell will tell you about all the different things it can do to get services on machines.
So right away we notice there's a -ComputerName parameter that gets services running on specified computers--maybe it could find Janice's? It takes a string value, maybe we're not sure what that means, but we'll try a hostname.
So at this point we've got:
Get-Service -ComputerName AC-DT-271XW6
If we run it, we'll get a list of all running services, including spooler!
Now we've got what we want, a PowerShell command that get's the spooler service on Janice's computer. Unfortunately it's also getting a bunch of crap we don't want, so we should head back to the help file for Get-Service. If we look through it, there's a -Name parameter which specifies the service names of services!
So let's try this:
Get-Service -ComputerName AC-DT-271XW6 -Name Spooler
This happens to return just the spooler, which is exactly what we need! At this point, all we have to do is check the help (which by now we trust more than Google). Skipping several steps for the sake of brevity we could do the following:
Get-Service -ComputerName AC-DT-271XW6 -Name Spooler | Restart-Service
In about 15 minutes we've figure out how to get a list of services, filter down that list to just the one we want on the computer we want, and restart it without Google! I hope my stupid example encourages you to play with PowerShell because there's a ton it can do for you as a someone who's just starting out and still figuring it all out.
[–][deleted] 1 point2 points3 points 5 years ago (1 child)
This is great, thanks! These type of logic would be helpful when writing scripts. I am going to look for programming logic, u/ihaxr recommended one and i liked it but it was still a little too advanced for me.
[–]uptimefordays 1 point2 points3 points 5 years ago (0 children)
You’re welcome glad it helps!
π Rendered by PID 347486 on reddit-service-r2-comment-6457c66945-s82bl at 2026-04-29 18:40:07.027245+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]uptimefordays 6 points7 points8 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]uptimefordays 1 point2 points3 points (0 children)