$PSDefaultParameterValues= @{'Send-MailMessage:SmtpServer'='Server123''Get-WinEvent:LogName'='Microsoft-Windows-PrintService/Operational''Get-*:Verbose'=$true} 可以通过在命令提示符处输入$PSDefaultParameterValues来查看定义的值。 PowerShell
还可以为 cmdlet 或高级函数的任何参数设置自定义默认值。 有关设置自定义默认值的信息,请参阅about_Parameters_Default_Values。 参数属性表 使用cmdlet 的Full、Parameter或Online参数Get-Help时,Get-Help将显示一个参数属性表,其中包含有关该参数的详细信息。
Default parameter values Optional parameters have a default value, which is the value that is used or assumed when the parameter is not specified in the command. For example, the default value of theComputerNameparameter of many cmdlets is the name of the local computer. As a result, the lo...
The$PSDefaultParameterValuesautomatic variable is a great tool to help you specify specific values for cmdlet parameters. You can specify one or more cmdlets by using wild cards in the hash table’s key. Remember that the hash table key is the name of the cmdlet(s), a colon, and then t...
about_Parameters_Default_Values about_Parameter_Binding 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_Parameters_Default_Values about_Parameter_Binding 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 ...
还可以为 cmdlet 或高级函数的任何参数设置自定义默认值。 有关设置自定义默认值的信息,请参阅about_Parameters_Default_Values。 参数属性表 使用Get-Helpcmdlet 的Full、Parameter或Online参数时,Get-Help显示参数属性表,其中包含有关参数的详细信息。 此信息包括使用参数时需要知道的详细信息。 例如,Get-ChildItemcmdl...
Specifies default values for the parameters of cmdlets and advanced functions. The value of $PSDefaultParameterValues is a hash table where the key consists of the cmdlet name and parameter name separated by a colon (:). The value is a custom default value that you specify.$PSDefaultPa...
(Get-Command Select-String).Parameters.Culture.Attributes.ValidValues 有关.NET CultureInfo.Name 属性的详细信息,请参阅CultureInfo.Name。 PowerShell 7 中引入了Culture参数。 类型:String Position:Named 默认值:Culture of the current PowerShell session ...
Accepted values:CurrentUser, LocalMachine, MachinePolicy, Process, UserPolicy Position:1 Default value:LocalMachine Required:False Accept pipeline input:True Accept wildcard characters:False -WhatIf 显示运行该 cmdlet 时会发生什么情况。 cmdlet 未运行。