about_Parameter_Sets 项目 2024/03/27 本文内容 简短说明 长说明 参数集要求 默认参数集 简短说明 介绍如何在高级函数中定义和使用参数集。 长说明 PowerShell 使用参数集编写单个函数,该函数可以针对不同方案执行不同操作。 参数集使你能够向用户公开不同的参数。 并且,根据用户指定的参数返回
Parameter A is unique to the first parameter set, parameter B is unique to the second parameter set, and parameter C is unique to the third parameter set. In the right column, the parameter sets don't have a unique parameter. Parameter set requirements The following requirements apply to ...
One of the great benefits of PowerShell V2 Advanced Functions is the ease in which you can support parametersets. ParameterSets are, well, different SETS of valid parameters. For instance you can say: Get-Process -id 0 Get-Process -Name *ss Those are 2 different parametersets for the Get...
ParameterSets Property System.Collections. ObjectModel.ReadOnlyCollection`1[[System.Management. Automation.Com... ScriptBlock Property System.Management. Automation.ScriptBlock ScriptBlock {get;} Visibility Property System.Management. Automation.SessionStateEntryVisibility Visibility {get;set;}CommandType属性已经...
When multiple parameter sets are defined, the cmdlet can indicate which parameter set to use if Windows PowerShell doesn't have enough information to make that determination. The parameter set that is used in this case is referred to as the default parameter set, and is specified using the ...
about_Parameter_Sets about_Parsing about_Path_Syntax about_Pipelines about_Pipeline_Chain_Operators about_PowerShell_Config about_PowerShell_Editions about_Preference_Variables about_Profiles about_Prompts about_Properties about_Providers about_PSConsoleHostReadLine about_PSCustomObject about_PSItem ab...
about Parameter Sets - PowerShell | Microsoft Learn about CommonParameters - PowerShell | Microsoft Learn And here's a basic stub showing how to declare parameters. [cmdletbinding()]param([parameter()][string]$MyParam1,[parameter()][int]$MyParam2,[parameter()][bool]$MyParam3,[paramet...
BB, parameter sets are different ways of using a Windows PowerShell command. For example, there are three ways to use theGet-Processcmdlet. The one most everyone knows about is usingGet-Processto obtain information about a process by passing it a name. In fact, this is the defa...
It includes a command-line shell, an associated scripting language, and a framework for processing cmdlets.Windows PowerShell vs. PowerShell 7+Although this repository started as a fork of the Windows PowerShell codebase, changes made in this repository are not ported back to Windows PowerShell ...
For information about the parameter sets in the Syntax section below, seeExchange cmdlet syntax. Syntax PowerShellCopy Get-ComplianceSearch[[-Identity] <ComplianceSearchIdParameter>] [-Case <String>] [-DomainController <Fqdn>] [-ResultSize <Unlimited>] [<CommonParameters>] ...