PowerShell 7.x - قسمت دوم - آشنایی با Pipelineها
نویسنده: سیروان عفیفی
تاریخ: ۱۴۰۱/۰۷/۱۳ ۲۳:۱۵
آدرس: www.dntips.ir
| مطالب | ۳۶۹۴ |
| نویسندگان | ۲۷۶ |
| گروههای مطالب | ۱۰۲۴ |
| نقشههای راه | ۱۱۹ |
| دورهها | ۱۴ |
| اشتراکها | ۱۷۹۱۴ |
Get-Help Get-Command
Get-Help Get-Command -Online
Get-Command -Name '*Process'
CommandType Name Version Sour
ce
----------- ---- ------- ----
Cmdlet Debug-Process 7.0.0.0 Mic…
Cmdlet Enter-PSHostProcess 7.2.6.500 Mic…
Cmdlet Exit-PSHostProcess 7.2.6.500 Mic…
Cmdlet Get-Process 7.0.0.0 Mic…
Cmdlet Start-Process 7.0.0.0 Mic…
Cmdlet Stop-Process 7.0.0.0 Mic…
Cmdlet Wait-Process 7.0.0.0 Mic…
Application mysqltest_safe_process 0.0.0.0 ls -l | grep "\.pdf$"
Get-Command -Name '*Process' | Select-Object Name,CommandType
Get-Command -Name '*Process' | Select-Object Name,CommandType | Sort-Object Name -Descending
PS /> Get-Command -Name '*Process' | Select-Object Name,CommandType -First 3 | Sort-Object Name -Descending Name CommandType ---- ----------- Exit-PSHostProcess Cmdlet Enter-PSHostProcess Cmdlet Debug-Process Cmdlet
PS /> Get-Process | Where-Object CPU -gt 1.24 | Sort-Object WorkingSet -Descending | Select-Object -First 5
Get-Process Slack | Stop-Process
Get-Process | Get-Member
TypeName: System.Diagnostics.Process
PS /Users/sirwanafifi> Get-Help Stop-Process -Full
NAME
Stop-Process
SYNTAX
Stop-Process [-Id] <int[]> [-PassThru] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]
Stop-Process -Name <string[]> [-PassThru] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]
Stop-Process [-InputObject] <Process[]> [-PassThru] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]
PARAMETERS
-Confirm
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases cf
Dynamic? false
Accept wildcard characters? false
-Force
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-Id <int[]>
Required? true
Position? 0
Accept pipeline input? true (ByPropertyName)
Parameter set name Id
Aliases None
Dynamic? false
Accept wildcard characters? false
-InputObject <Process[]>
Required? true
Position? 0
Accept pipeline input? true (ByValue)
Parameter set name InputObject
Aliases None
Dynamic? false
Accept wildcard characters? false
-Name <string[]>
Required? true
Position? Named
Accept pipeline input? true (ByPropertyName)
Parameter set name Name
Aliases ProcessName
Dynamic? false
Accept wildcard characters? false
-PassThru
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases None
Dynamic? false
Accept wildcard characters? false
-WhatIf
Required? false
Position? Named
Accept pipeline input? false
Parameter set name (All)
Aliases wi
Dynamic? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
System.Int32[]
System.String[]
System.Diagnostics.Process[]
OUTPUTS
System.Diagnostics.Process
ALIASES
spps
REMARKS
Get-Help cannot find the Help files for this cmdlet on this computer. It is displaying only partial help.
-- To download and install Help files for the module that includes this cmdlet, use Update-Help.
-- To view the Help topic for this cmdlet online, type: "Get-Help Stop-Process -Online" or
go to https://go.microsoft.com/fwlink/?LinkID=2097058. -Id <int[]>
Required? true
Position? 0
Accept pipeline input? true (ByPropertyName)
Parameter set name Id
Aliases None
Dynamic? false
Accept wildcard characters? false
-InputObject <Process[]>
Required? true
Position? 0
Accept pipeline input? true (ByValue)
Parameter set name InputObject
Aliases None
Dynamic? false
Accept wildcard characters? false
-Name <string[]>
Required? true
Position? Named
Accept pipeline input? true (ByPropertyName)
Parameter set name Name
Aliases ProcessName
Dynamic? false
Accept wildcard characters? false "Slack" | Stop-Process
Stop-Process: The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.
PS /Users/sirwanafifi> $newObject = [pscustomobject]@{ Name = "Slack" }
PS /Users/sirwanafifi> $newObject | Stop-Process