-<parameter_name> <parameter_value> -<parameter_name>:<parameter_value> 参数名称前面有一个连字符 (-) ,它向 PowerShell 发出信号,指示连字符后面的单词是参数名称。 参数名称和值可以用空格或冒号字符分隔。 某些参数不需要或接受参数值。 其他参数需要值,但不需要命令中的参数名称。
When multiple parameter sets are defined, the DefaultParameterSetName keyword of the CmdletBinding attribute specifies the default parameter set. PowerShell uses the default parameter set when it can't determine the parameter set to use based on the information provided to the command. For more info...
{ return computerName; } set { computerName = value; } } private string computerName; [Parameter(Mandatory= true, ParameterSetName = "Test01")] [Parameter(ParameterSetName = "Test02")] public string SharedParam { get { return sharedParam; } set { sharedParam = value; } } private ...
Within the command or script in which it's used, the InformationAction common parameter overrides the value of the $InformationPreference preference variable, which by default is set to SilentlyContinue. When you use Write-Information in a script with InformationAction, Write-Information values are ...
该Set-ExecutionPolicycmdlet 使用ExecutionPolicy参数指定Restricted策略。Scope参数指定默认范围值LocalMachine。 该Get-ChildItemcmdlet 将Path参数与驱动器一起使用HKLM:来指定注册表位置。 示例3:将执行策略从远程计算机应用到本地计算机 此命令从远程计算机获取执行策略对象,并在本地计算机上设置策略。Get-ExecutionPolicy沿管...
Set-PSReadLineOption-Colors@{ Command ='Magenta'Number ='DarkGray'Member ='DarkGray'Operator ='DarkGray'Type ='DarkGray'Variable ='DarkGreen'Parameter ='DarkGreen'ContinuationPrompt ='DarkGray'Default ='DarkGray'} 示例5:设置多种类型的颜色值 ...
PS>CommandInvocation(Get-Process): “Get-Process” >> ParameterBinding(Get-Process): name=”Name”; value=”*e*” Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName ——- —— —– —– —– —— ———– 135 11 2496 7716 4096 2548 Acmengine 2451 121 63952 188004 4096...
DEBUG: Hello, World Write-Debug : The running command stopped because the preference variable "DebugPreference" or common parameter is set to Stop: Hello, World At line:1 char:1 + Write-Debug -Message "Hello, World" This example uses the Debug parameter with a value of $false to s...
Type: String[] Position: Named Default value: None Required: False Accept pipeline input: False Accept wildcard characters: False Applies to: Exchange Server 2016, Exchange Server 2019, Security & Compliance-AddSharePointLocationThis parameter is available only in the cloud-based service. The AddSh...
Set-CMAssetIntelligenceSynchronizationPoint Unable to clear Asset Intelligence proxy certificate by setting CertificateFile to "$null." Set-CMBoundary The Value parameter is not validated for correct syntax based on the boundary type or Type para...