r/PowerShell • u/pcgeek86 • Nov 27 '20
r/PowerShell • u/RatnerEsque • Jun 13 '26
Misc Disclosure-Day -See -spoilers:$false -verbose Spoiler
I know this isn’t a movie review sub, and if I’m breaking any rules, feel free to delete. I won’t hold grudges.
First I would see this movie on as big a screen as possible, not to go all “film bro” on yall, but its shot like an old school movie and there’s something about the way Spielberg shoots that’s just enjoyable to watch.
Also whether you like it or hate it, you won’t leave the theatre angry.
Anyway, why am I writing this here? Because a main character in the movie uses PowerShell to copy some files.
Our baby is right up there on the screen for everyone to see….it does bring up a standard windows copy dialogue when executed, so marks off for that, but still.
Maybe they wrote a custom cmdlet that did a copy-item but called the windows copy files gui?
Seems like that kind of person maybe.
Be good to each other!
r/PowerShell • u/[deleted] • Aug 10 '20
What do you think about PowerShell's future?
What do you think about PowerShell's future? Do you think it's legacy and will be deprecated in the foreseeable future, or do you believe we're in the beginning of PowerShell's golden age? Sometimes I feel like PowerShell is what "low code" or "medium code" should be about. At the same time it's still kind of janky, the language is relatively unknown and it feels like most people don't regard it as particiuarly valuable in the long term.
r/PowerShell • u/[deleted] • Jun 11 '19
Where is the appreciation for one-liners? What happened to 'automation made easy'?
From what I've seen on this sub, people seem to be attacking problems the wrong way using PowerShell. Most of the time I want to help but then I have to shake my head and sigh, because so many posts seem like a lost cause.
Where are the one-liner posts? Where are the "I put these cmdlets together in a pipeline and got useful results" simple solutions?
So far they don't seem to exist, instead the subreddit is filled with massive Python-esque scripts that do way too much in convoluted ways, and the question is usually regarding some minor detail within the script. And rarely do people correct them by addressing their approach to the problem; the detail is fixed and they're sent on their merry way.
Can we try to promote proper PowerShell use? Let's make this sub useful for advanced PowerShell users as well, not just beginners trying scripting for the first time. I'd love to see more useful, short and concise ways to automate tasks.
Sure, do more than a one-liner, but is it possible to do a lot of stuff where each line is its own cmdlet chain, instead of dealing with loops? Probably. Most definitely.
Some personal pet peeves of mine:
Forget about performance, if that's an issue don't use PowerShell. The pipeline is fine, ForEach-Object is fine, there's no need to spend minutes or even hours trying to optimize an already sub-optimal platform. If you find yourself disagreeing with this statement then it might be time for you to graduate to C#
Are you doing comparisons and uniqueness? Sure, dig up Hashset and other .NET collections. But where's the PowerShell automation there? That's no longer leveraging what PowerShell brings to the table and the environment feels a bit wrong for the task.
Lack of focus on the task at hand. People here are helpful but they often solve the Y problem and rarely ask about the painfully absent description of X which is what the inquirer is actually trying to solve. Sometimes the X problem could've been solved with a single cmdlet, but the Y problem requires a page of code.
GUI questions. How is that relevant to automation? GUIs are the very antithesis of PowerShell, you already have GUIs provided by MS where you get to click on things, why are you creating your own little 0.01% functionality selection box? There are way better things to spend your time to learn. Have you read the about_ topics within PowerShell yet? So much of it amounts to selection, yet Out-GridView cmdlet goes unused.
Where are the network questions? The remoting questions and answers? Where's the DSC and workflow questions? Hyper-V? The real meat of PowerShell, where actual automation is happening in robust ways. Sparse would be an understatement.
r/PowerShell • u/[deleted] • Nov 05 '19
Uncategorised [META] "Use VSCode" is the equivalent of "ok boomer" in this sub
/sigh I’m gonna get banned for this and I don’t care.
Every single time I see a post about ISE on this sub, the VSCode peanut gallery pipes up and reminds everyone that it can scrub my bathtub, take out the trash, and wash my car for me. Lovely. Wonderful. Go away.
Your “use VSCode lol” comment is unhelpful. You don’t get a say over my code editor of choice. I do.
Your "Microsoft oBVIoUsLy wants you to use VSCode" comment is unhelpful. See above.
Your "but VSCode has…" comment is unhelpful. If it had what I actually needed, I'd switch.
Your “ISE is dead” comment is unhelpful. ISE is preinstalled on every version of Windows in the last ten years. It works fine…most of the time. And it's preinstalled on most of my servers. So when it's time to debug on a server, I don't have to install anything else.
We get it. You want to drag us kicking and screaming into the future. When VSCode ticks whatever checkbox each of us is waiting for (speed and console functionality are my personal reasons for not moving), we'll gladly move there.
We're not stuck in the past. Most of us have seen and installed VSCode, and it's a great product. It just doesn't fit some of our workflows right now.
TL;DR - Be more helpful when replying. If you don't know the answer, you can help by shutting the fuck up instead of evangelising for VSCode.
r/PowerShell • u/kwilkins21 • 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.
r/PowerShell • u/Hvoromnualltinger • Jul 20 '22
Misc [META] What's up with the consistent downvoting of all posts and comments on this sub
Seemingly innocuous questions and helpful responses consistently being downvoted to 0, though apparently not to negative numbers. Brigading? Bots? But why?
r/PowerShell • u/Scooter_127 • Dec 16 '22
Is there a way to find out how much memory specific variables are using? Google isn't helping
I'm dealing with some large database tables where I have to update millions of records (231 smallish records in one table, over 5 million huge records in another) and due to memory constraints I have to use a a paginated approach. No big deal there.
My problem is I have a memory leak somewhere and I've used remove-variable and garbage collection with some success but something just isn't giving up its memory and I can't figure it out. The only thing that will release it is stopping Powershell itself so I'd prefer to fix the root cause rather than use a workaround.
So, anyone know a way to determine how much memory $some_variable is using?
My workaround of calling a separate instance of PowerShell for each page of data is working, I just don't like it and want to fix the actual issue.
r/PowerShell • u/That-Feeling-2399 • Sep 09 '26
Question Are games possible in power shell?
Hey gang, I hope this is the right subreddit but would anyone know if it is possible to run text games in powershell/cmd prompt? If so, what kind of pre built code is out there?
r/PowerShell • u/CryktonVyr • Aug 09 '24
Powershell Business
Has anyone made money by selling powershell scripts? I'm sure there's a demand for it in one shape or another, but I'm curious if it's feasible and legal
r/PowerShell • u/Haplopeart • 19h ago
Script Sharing Creating as PS7 ISE
For my techie Friends.
I've been busy with a little pet project this week. I've always wanted a PowerShell ISE that could run PowerShell 7. So with a little help from OpenCode, I built one.
It's able to run a script I use for maintenance on my own machine.
https://github.com/haplopeart/PS7_ISE
It doesn't have everything yet. I'm sure there are still bugs; I will keep testing it. I will also keep evolving it toward parity with the original PowerShell ISE. I never looked to see if anyone had done something similar. I just saw it as a personal challenge. I personally find running PowerShell scripts in VS Code a little overkill; I wanted something simple.
Potential Adds, changes:
Versions for running PowerShell on Linux and MACOS
Update to add the Commandlet reference pane the original has.
Update to run PS 7.7.0; it was released while I was working on this.
Status Bar for Cursor Position
Line Numbers in the Editor Window
r/PowerShell • u/Alskaeer163 • May 26 '24
Hello i deleted default powershell from system32 labeled 1.0 can i somehow restore it without reinstaling windows ?
r/PowerShell • u/TanixLu • Aug 04 '26
Script Sharing ps1.cmd: Running PowerShell scripts by double-clicking via a .cmd wrapper
I'm a Left 4 Dead 2 player, and recently I ran into a small problem: the server I like to play on is often completely full. It occurred to me that I could write a script to poll the server and check whether a slot had opened up. After some research, I found that cmd scripts have a hard time handling network requests, while PowerShell is powerful enough to handle the job easily. Automatically checking the player count and joining the server is a pretty simple task, so I had an AI write it for me. The result was great — fully functional. All I had to do was copy the server address, then right-click the .ps1 script and choose "Run with PowerShell."
The only thing was, having to right-click to run it felt awkward, and it doesn't match most people's intuition about computers. If I have a script or an app, I should be able to double-click to run it! So I started looking for ways to run a PowerShell script by double-clicking. There are indeed a few, but none of them are very elegant:
Modifying the registry — I don't want people using my script to have to change their registry first.
Creating a shortcut — bad for distribution, and it means two files.
Creating a cmd launcher — I prefer the simplicity of a single file, and a single file is also easier to distribute.
In the end, I found my ideal solution in a Stack Overflow answer: stuff the PowerShell script inside a cmd file! So I open-sourced the ps1.cmd project. My final implementation isn't exactly the same as that answer — you can check out the GitHub page for the details.
The goal of ps1.cmd is maximum compatibility: it should work with any PowerShell script and behave identically when executed. I hope this project helps you out, and if you run into any problems, feel free to open an issue!
r/PowerShell
•
u/alexnewt781
•
Oct 19 '25
How to run powershell without admin rights
If u want to run powershell w/o admin rights u should:
Open the cmd
In the window that opens, write this text
runas /trustlevel:0x20000 powershell
For example, this is necessary to download spicetify. If you try to do this in PowerShell with administrator rights, it won't work
r/PowerShell • u/Over_Dragonfly1079 • May 05 '25
Learn powershell to be admin on it !
Hi i'm Gregory i have 25 years old and, i want to know how can i learn powershell correctly without project on it in enterprise. I have start to read the documentation "how to use powershell" i have read the first 400 pages but the documentation continue until 3601 pages. And is a lot for me. I have already do some course on Microsoft learn but i don't get it clearly. Thank you for your help.
r/PowerShell • u/Round-Ad-2906 • May 13 '26
Question Beginner
Hello *,
I startet weeks ago at work to learn powershell. It’s difficult for me to learn something, with useless things were I don’t get any profit. So colleagues gave me real exercises that could be need in the future. Now I finished them. I’m asking if there is maybe a website, that shows code, and I have to say what it does. To learn more. Is there a website like this ?
r/PowerShell • u/Level-Hawk-1688 • Feb 17 '25
Question Powershell command from chatGPT confuses me
So i was trying to rename files and I asked the help of chatGPT.
It told me to go to the powershell and give that command
# Capture all files recursively
$files = Get-ChildItem -Path "C:\MyFolder" -Recurse -File
$counter = 1
foreach ($file in $files) {
# Construct a new file name using the counter and preserving the extension
$newName = "NewFile_" + $counter + $file.Extension
Rename-Item -LiteralPath $file.FullName -NewName $newName
$counter++
}
I didn't look at it , it shouldn't had put the "C:\MyFolder" in there, I just run it.
Powershell gave me loads of errors like that:
Get-ChildItem : Access to the path 'C:\Windows\System32\Tasks_Migrated' is denied.
At line:1 char:10
+ $files = Get-ChildItem -Path "C:\MyFolder" -Recurse -File
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (C:\Windows\System32\Tasks_Migrated:String) [Get-ChildItem], Unauthori
zedAccessException
+ FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemCommand
So my question is how did Powershell go from C:\MyFolder to C:\Windows\System32 ?
r/PowerShell • u/[deleted] • Apr 09 '15
Sitting in a DSC training class and this is what I am thinking. /x-post/iiiiiiitttttttttttt
r/PowerShell • u/adbertram • Apr 06 '21
What is PowerShell and Why Use It?
Hey guys,
u/Farismalaeb just wrote a shiny new blog post you may enjoy.
"What is PowerShell and Why Use It?"
Summary: What is PowerShell? It’s a shell and scripting language capable of automating just about anything. Learn more in this article.
r/PowerShell • u/Th3_L1Nx • May 09 '24
Solved Any way to speed up 7zip?
I am using 7zip to create archives of ms database backups and then using 7zip to test the archives when complete in a powershell script.
It takes literal hours to zip a single 112gb .bak file and about as long to test the archive once it's created just using the basic 7zip commands via my powershell script.
Is there a way I just don't know about to speed up 7zip? There's only a single DB file over 20gb(the 112gb file mentioned above) and it takes 4-6 hours to zip them up and another 4-6 to test the archives which I feel should be able to be sped up in some way?
Any ideas/help would be greatly appreciated!
EDIT: there is no resources issue, enterprise server with this machine as a VM on SSDs, more than 200+GB of ram, good cpus.
My issue is not seeing the compress option flag for backup-sqldatabase. It sped me up to 7 minutes with a similar ratio. Just need to test restore procedure and then we will be using this from now on!
r/PowerShell • u/AFollowerOfTheWay • Dec 09 '25
Does a Powershell Autocomplete Exist?
Pretty much the title.
I’m looking for some type of plugin, mod, or Powershell alternative that will autocomplete and/or fix typos in my commands.
For instance if I were to type “winfet” it would correct or suggest it “winget”. Or if I often type “ssh username@___” it suggests everything after ssh. Powershell already saves the IP, which is nice, but it’d be cool to find something that does a bit more.
Essentially I’m looking for the notepad++ equivalent of Powershell. Does this exist?
r/PowerShell • u/tynenn • Feb 14 '13
Quest Active Directory (if you admin AD you should be using this)
r/PowerShell • u/Clear-Pear2267 • Jun 04 '26
Misc Thoughts on Microsoft's vision for "agent first" computing.
My first thought was "it reminds me of the PowerShell object pipeline". And a few seconds later it hit me that a new PowerShellAI cli would be a logical first step for Microsoft to take (makes much more sense that trying to start by dealing with thousands of apps all designed to live in the Mouse/GUI UX universe).
PowerShell is hugely powerful, but discovery can be challenging and it is not very tollerant of syntax errors. But a "natural language" PowerShell would be killer. Bringing to the table a lot of the things Copilot lacks today (like filesystem integration, history, the ability to save and re-use prompts and organize them in categories).
r/PowerShell • u/Best_Yasuo_EUW • Aug 25 '22
Question Run Powershell as admin without admin rights
Hello everyone, does anyone know or has done this? I need to make Powershell to be able to be ran as admin without actually inputting any credentials from an account, that is not an administrator - a normal domain user to be able to open up elevated Powershell even though he has no rights.
I've tried a few things like giving Full Control to Powershell.exe in System32, but that didn't seem to work
I've tried creating this script this batch file:
@ ECHO OFF
SET ThisScriptsDirectory=C:\
SET PowerShellScriptPath=C:\PSADMIN.ps1
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Start-Process PowerShell -
ArgumentList '-NoProfile -ExecutionPolicy Bypass -File ""C:\PSADMIN.ps1""' -Verb RunAs}";
Which goes to a ps1 file with "Start-Process Powershell"
And run this in task scheduler as a domain admin user with highest privileges, which actually does run OK on my computer in which I'm admin in, but not for a user that is not an admin user (it does say script was ran when it was done by a user but it does not work, but when You run the batch file by hand it does work - strange.)
Is it even possible to do some domain ACLs to let specific users to open up specific programs as an admin?
Thanks a lot
EDIT: From what I can see from replies, this looks like a pretty bad idea, and I couldn't agree more. So I've got an idea to install Hyper-V for people that need to test things with admin rights.
Still not sure what to do with specific programs that need to be ran as admin on a work computer
EDIT 2: Thanks everyone for their insights, I probably should be deleting this thread, as this doesn't seem like a good idea at all, but that's why I'm consulting specialists here, if someone else clueless comes here, he should see this thread. Thanks for solution You were giving. This was quite a broad learning experience which I love. Have a great day.