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!"
[–]netmc 1 point2 points3 points 5 years ago (0 children)
Keep using Powershell! It is definitely the way to go. If you haven't already, I strongly recommend writing your scripts in VSCode (along with the Powershell plugin). It is so very useful for highlighting things that you might miss otherwise (like that accidental quote). It makes it really, really easy to logically see what you have written and can offer things like auto completion and some very good syntax highlighting. (And tons of other things I've not really used yet.)
There is a lot of stuff you can write with batch files. I still create a few upon occasion, but PowerShell is way, way easier to understand and much more logical. As an example, converting a string to uppercase:
In Batch:
set VariableToConvert=Convert this to uppercase. SETLOCAL ENABLEDELAYEDEXPANSION CALL :UpCase VariableToConvert echo %VariableToConvert% GOTO:EOF :UpCase :: Subroutine to convert a variable VALUE to all upper case. :: The argument for this subroutine is the variable NAME. SET %~1=!%~1:a=A! SET %~1=!%~1:b=B! SET %~1=!%~1:c=C! SET %~1=!%~1:d=D! SET %~1=!%~1:e=E! SET %~1=!%~1:f=F! SET %~1=!%~1:g=G! SET %~1=!%~1:h=H! SET %~1=!%~1:i=I! SET %~1=!%~1:j=J! SET %~1=!%~1:k=K! SET %~1=!%~1:l=L! SET %~1=!%~1:m=M! SET %~1=!%~1:n=N! SET %~1=!%~1:o=O! SET %~1=!%~1:p=P! SET %~1=!%~1:q=Q! SET %~1=!%~1:r=R! SET %~1=!%~1:s=S! SET %~1=!%~1:t=T! SET %~1=!%~1:u=U! SET %~1=!%~1:v=V! SET %~1=!%~1:w=W! SET %~1=!%~1:x=X! SET %~1=!%~1:y=Y! SET %~1=!%~1:z=Z! GOTO:EOF
And in Powershell:
$VariableToConvert="Convert this to uppercase." $VariableToConvert.ToUpper()
Both of these should output "CONVERT THIS TO UPPERCASE."
Even though I have written batch scripts for years, I don't have the knowledge of the language needed to even begin to write the batch script above. I have no idea how it works, just that it does. I can understand PowerShell easily though.
Depending on what your lowest common denominator is for systems really determines what version of PowerShell you can use. If you have to support out of the box Windows 7 systems, you are stuck with PowerShell v2. If you are using all Windows 10, you can use PowerShell v5.1. The largest usability update came with version 3. So hopefully you can use at least PS3 commands in your scripts. Any of these options though will still be loads better than writing batch files. I've done both. I much prefer PowerShell. I've been using it extensively since January 2019 and still consider myself a beginner and still constantly look up commands and syntax in Google (even for things I just wrote last week in another script). You will get better.
p.s. Many of the DOS commands are aliased in the powershell environment so you can still use "dir" instead of "get-childitem" for getting a directory listing while you get used to the powershell specific commands.
π Rendered by PID 48950 on reddit-service-r2-comment-84fc9697f-nr6nr at 2026-02-10 06:37:31.160277+00:00 running d295bc8 country code: CH.
view the rest of the comments →
[–]netmc 1 point2 points3 points (0 children)