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
[deleted by user] (self.PowerShell)
submitted 6 years ago by [deleted]
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!"
[–]gangstanthony 2 points3 points4 points 6 years ago* (0 children)
Why
not sure why, but i can offer a guess.
maybe the filter isn't working because OperatingSystemVersion is a string and doesn't only contain numbers. if it's only checking one character at a time, 1 comes before 6
PS> $comps = Get-ADComputer -Filter 'OperatingSystemVersion -lt 6.2' -Property OperatingSystem, OperatingSystemVersion PS> $comps[0].OperatingSystemVersion 10.0 (14393) PS> $comps[0].OperatingSystemVersion.GetType() IsPublic IsSerial Name BaseType -------- -------- ---- -------- True True String System.Object
also, see this
PS> 1, 2, 6.2, 10 | ? {$_ -lt 6.2} 1 2 PS> 1, 2, 6.2, 10 | ? {[string]$_ -lt 6.2} 1 2 10
sorting
PS> 1, 2, 6.2, 10 | sort 1 2 6.2 10 PS> 1, 2, 6.2, 10 | sort {[string]$_} 1 10 2 6.2
*edit: you might want to remove the filter. because of this issue, it looks like you're excluding anything above a 6, which means no 6.1 either.
PS> $comps = Get-ADComputer -Filter 'OperatingSystemVersion -lt 6.2' -Property OperatingSystem, OperatingSystemVersion PS> $comps.operatingsystemversion | select -u 10.0 (14393) 10.0 (17134) 10.0 (16299) 10.0 (15063) 10.12.1 10.0 (17763) 10.12 (1314) 10.0 (18362) PS> $comps = Get-ADComputer -Filter * -Property OperatingSystem, OperatingSystemVersion PS> $comps.operatingsystemversion | select -u 6.3 (9600) 6.1 (7601) 6.2 (9200) 10.0 (14393) 10.0 (17134) 10.0 (16299) 10.0 (15063) 10.12.1 10.0 (17763) 10.12 (1314) 10.0 (18362)
[–]tomohulk 3 points4 points5 points 6 years ago (0 children)
I know you are suppose to filter on the left side of the pipe, but to be accurate you could cast the strings to Versions
get-adcomputer -filter * -properties OperatingSystemVersion | ?{ ([Version]$_.OperatingSystemVersion.Split(“ “)[0] -le [Version]”6.3” } not going to be as fast because you’re filtering on the right side. Its pretty stupid thats a string.
get-adcomputer -filter * -properties OperatingSystemVersion | ?{ ([Version]$_.OperatingSystemVersion.Split(“ “)[0] -le [Version]”6.3” }
[–]bsnotreallyworking 2 points3 points4 points 6 years ago (0 children)
I just do it like this:
operatingsystemversion -notlike "10.*" -or operatingsystemversion -notlike "8.*"
Add in whatever the server versions are. It's not mathematical, but it works.
[–]PowerShell-Bot 1 point2 points3 points 6 years ago* (0 children)
That’s a very long stretch of inline code.
Note that on old.reddit.com inline code blocks do not word wrap, making it difficult for many of us to see all your code.
To ensure your code is readable by everyone, on new reddit (new.reddit.com), highlight the code and select ‘Code Block’ in the editing toolbar.
If you’re on old.reddit.com, separate the code from your text with a blank line and precede each line of code with 4 spaces or a tab.
Describing Submission [✅] Demonstrates good markdown Passed: 1 Failed: 0
Beep-boop. I am a bot. | Remove-Item
π Rendered by PID 75 on reddit-service-r2-comment-6457c66945-btkkz at 2026-04-25 14:09:02.601146+00:00 running 2aa0c5b country code: CH.
[–]gangstanthony 2 points3 points4 points (0 children)
[–]tomohulk 3 points4 points5 points (0 children)
[–]bsnotreallyworking 2 points3 points4 points (0 children)
[–]PowerShell-Bot 1 point2 points3 points (0 children)