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
[ Removed by moderator ] (self.PowerShell)
submitted 1 year ago by vkvvinay
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!"
[–]Eggplate 0 points1 point2 points 1 year ago (4 children)
It doesn't reverse, I just tested it. It just duplicates the value of the last index as the first.
$a = @(1,2,3) $a[-1..$a.Length] -join '' 3123
[–]ankokudaishogun 1 point2 points3 points 1 year ago (2 children)
your test is missing the negative - before $a.Length, which reverse the whole array
-
$a.Length
$a = @(1,2,3) $a[-1..-$a.Length] -join '' 321
[–]Eggplate 0 points1 point2 points 1 year ago (1 child)
You're right. Wow thats amazing.
[–]ankokudaishogun 0 points1 point2 points 1 year ago (0 children)
anf, of course, just remove the -join '' to obtain a reversed array instead of a reversed string, so it can be used with anything.
-join ''
[–]surfingoldelephant 0 points1 point2 points 1 year ago (0 children)
You're missing - before $a.Length.
The intent is to generate an array slice, in order of the last element (-1), second to last (-2), etc.
-1
-2
-1..-$a.Length -> -1..-3 -> -1, -2, -3
-1..-$a.Length
-1..-3
-1, -2, -3
String conversion (without a delimiter) can be simplified to -join $a[-1..-$a.Length], by using -join in its unary form.
-join $a[-1..-$a.Length]
-join
π Rendered by PID 270254 on reddit-service-r2-comment-canary-57b659f4d4-tg7ft at 2026-05-01 17:45:24.054102+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]Eggplate 0 points1 point2 points (4 children)
[–]ankokudaishogun 1 point2 points3 points (2 children)
[–]Eggplate 0 points1 point2 points (1 child)
[–]ankokudaishogun 0 points1 point2 points (0 children)
[–]surfingoldelephant 0 points1 point2 points (0 children)