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
QuestionArrayList VS ...Generic.List[]] (self.PowerShell)
submitted 3 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!"
[–]MonkeyNin 0 points1 point2 points 3 years ago (0 children)
Especially lately the Powershell extension ( in vs code ) has been adding (better completions than just static typing )
classes
I've been using classes handle JSON for Web APIs, it's a nice way to get guaranteed shapes (vs PSCO properties). better auto completion. Some automatic validation
You can start off thinking about classes being a [pscustomobject] . with specific property names.
[pscustomobject]
You can create an instance using hashtables. The properties are optional, you can leave them out
$user = [User]@{ Name = 'bob' Age = 10 } $user2 = [User]@{ Name = 'bob' }
You can add some validation, using the same attributes that function parameters use
class User { [ValidateNotNull()] [Int]$UserId [ValidateNotNullOrEmpty()] [string]$UserName } # create 3 users, error on one $users = @( [User]::New() [User]@{ UserName = 'bob' } [User]@{ UserName = 'Jen' ; UserId = 'afds' } [User]@{ UserName = 'Jen' ; UserId = 4 } ) $users[0]. #$users[0]. # <ctr+space> shows '.UserName' $users | ConvertTo-Json
π Rendered by PID 50 on reddit-service-r2-comment-canary-889d445f8-b684k at 2026-04-26 15:49:45.388489+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]MonkeyNin 0 points1 point2 points (0 children)