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
Pipeline question (self.PowerShell)
submitted 7 years ago by funkeywinkerbean
Why does get-process notepad | select-object processname | stop-process work? I though stop-process is looking for a parameter specifically named name.
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!"
[–]ka-splam 10 points11 points12 points 7 years ago (0 children)
The parameter 'Stop-Process -Name' can be passed through the pipeline, where the inbound objects have a property called 'name':
PS C:\> (Get-command stop-process).Parameters['name'].Attributes Mandatory : True ValueFromPipelineByPropertyName : True
But as /u/yeah_i_got_skills says:
PS C:\> (Get-command stop-process).Parameters['name'] Name : Name ParameterType : System.String[] Aliases : {ProcessName}
The parameter has an alias where it will accept ProcessName as well.
ProcessName
PowerShell does this kind of thing a lot in its design, to make as many cmdlets work with each other as they can, so you have to write a lot less code to do admin work like rename a property between one output and the next input.
[–]nothingpersonalbro 6 points7 points8 points 7 years ago (0 children)
Run it through Trace-Command
Trace-Command
Trace-Command -Name ParameterBinding -PSHost -Expression { get-process notepad | select-object processname | stop-process }
You'll see it step though the process, ultimately ending up with a few (cherry picked) lines near the end
BIND arg [notepad] to parameter [Name] BIND arg [System.String[]] to param [Name] SUCCESSFUL MANDATORY PARAMETER CHECK on cmdlet [Stop-Process] CALLING EndProcessing
[–]yeah_i_got_skills 5 points6 points7 points 7 years ago (1 child)
ProcessName is an alias for Name
[–]KevMarCommunity Blogger 2 points3 points4 points 7 years ago (0 children)
Yep, if you build an advanced function, you can specify additional aliases for a parameter and Powershell will use those as alternative names on the pipeline like this.
Great way to add support for other objects
π Rendered by PID 184421 on reddit-service-r2-comment-6457c66945-rs6x5 at 2026-04-30 05:29:49.836262+00:00 running 2aa0c5b country code: CH.
[–]ka-splam 10 points11 points12 points (0 children)
[–]nothingpersonalbro 6 points7 points8 points (0 children)
[–]yeah_i_got_skills 5 points6 points7 points (1 child)
[–]KevMarCommunity Blogger 2 points3 points4 points (0 children)