-<parameter_name> <parameter_value> -<parameter_name>:<parameter_value> 参数名称前面有一个连字符 (-) ,它向 PowerShell 发出信号,指示连字符后面的单词是参数名称。 参数名称和值可以用空格或冒号字符分隔。 某些参数不需要或接受参数值。 其他参数需要值,但不需要命令中的参数名称。
PowerShell 3.0 中引入了 $PSDefaultParameterValues。有关此首选项变量的详细信息,请参阅 about_Parameters_Default_Values。$PSEmailServer指定用于发送电子邮件的默认电子邮件服务器。 此首选项变量由发送电子邮件的 cmdlet 使用,例如 Send-MailMessage cmdlet。
DefaultParameterSet Property System.String DefaultParameterSet {get;} Definition Property System.String Definition {get;} Description Property System.String Description {get;set;} Module Property System.Management.Automation. PSModuleInfo Module {get;} ModuleName Property System.String ModuleName {get;} ...
Output 复制 Key Value --- --- a Power b Shell $PSCmdlet包含一个对象,该对象表示正在运行的 cmdlet 或高级函数。可以在 cmdlet 或函数代码中使用对象的属性和方法来响应使用条件。 例如,ParameterSetName 属性包含正在使用的参数集的名称,ShouldProcess 方法将 WhatIf 和Confirm 参数动态添加到 cmdlet。有关...
To find the default parameter value, see help topic for the cmdlet. The parameter description should include the default value. You can also set a custom default value for any parameter of a cmdlet or advanced function. For information about setting custom default values, seeabout_Parameters_Def...
将默认的 ParameterSetName 重命名回 ConvertTo-Csv 和 ConvertFrom-Csv 的分隔符 (#10425) 工具 为SDKToUse 属性添加默认设置,使其在 VS 中生成 (#11085) Install-Powershell.ps1:添加参数以使用 MSI 安装 (#10921)(感谢 @MJECloud!) 为install-powershell.ps1 添加基本示例 (#10914)(感谢 @kilasui...
若要获取类的静态属性,请使用 cmdlet 的Get-MemberStatic参数。 例如,以下命令获取 类的System.DateTime静态属性。 PowerShell复制 Get-Date|Get-Member-MemberTypeProperty-Static Output复制 TypeName: System.DateTime Name MemberType Definition --- --- --- MaxValue Property static datetime MaxValue {get;}...
Add completion single/double quote support for -Noun parameter for Get-Command (#24977) (Thanks @ArmaanMcleod!) Stringify ErrorRecord with empty exception message to empty string (#24949) (Thanks @MatejKafka!) Add completion single/double quote support for -PSEdition parameter for Get-Module (...
类型: SwitchParameter Position: Named 默认值: False 必需: True 接受管道输入: False 接受通配符: False-SimpleMatch指示cmdlet 使用简单匹配而不是正则表达式匹配。 在简单的匹配中,Select-String 在Pattern 参数中搜索文本的输入。 它不会将 Pattern 参数的值解释为正则表达式语句。 此外,使用 SimpleMatch 时,返回...
I have a PowerShell function that takes an optional parameter, validated using a ValidateSetAttribute, and based on that value it adds another dynamic parameter. However, in strict mode, when trying to access the parameter inside of the DynamicParam block, and I didn’t explicitely set said pa...