$PSDefaultParameterValues= @{"Send-MailMessage:SmtpServer"="Server123";"Get-WinEvent:LogName"="Microsoft-Windows-PrintService/Operational"} Use wildcards and switch parameters The cmdlet and parameter names can
If no parameters are used, switch behaves the same as using the Exact parameter. It performs a case-insensitive match for the value. If the value is a collection, each element is evaluated in the order in which it appears.The switch statement must include at least one condition statement....
-<parameter_name> <parameter_value> -<parameter_name>:<parameter_value> 参数名称前面有一个连字符 (-) ,它向 PowerShell 发出信号,指示连字符后面的单词是参数名称。 参数名称和值可以用空格或冒号字符分隔。 某些参数不需要或接受参数值。 其他参数需要值,但不需要命令中的参数名称。
named Default value False Accept pipeline input? False Accept wildcard characters? false -Examples <System.Management.Automation.SwitchParameter> Displays only the name, synopsis, and examples. This parameter is effective only when the help files are installed on the computer. It has no effect on ...
[-Filter <ScriptBlock>] [-Limit <String>] [-WebApplication <SPWebApplicationPipeBind>] [-WhatIf [<SwitchParameter>]] [<CommonParameters>] Get-SPSite -Identity <SPSitePipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Filter <ScriptBlock>] [-Limit ...
For these cmdlets, specifying the Confirm switch without a value introduces a pause that forces you acknowledge the command before proceeding. Expand table Type: SwitchParameter Aliases: cf Position: Named Default value: None Required: False Accept pipeline input: False Accept wildcard characters: ...
类型:SwitchParameter Position:Named 默认值:False 必需:False 接受管道输入:False 接受通配符:False -Path 指定要搜索的文件的路径。 允许通配符。 默认位置是本地目录。 指定目录中的文件,例如log1.txt、*.doc或*.*。 如果仅指定目录,命令将失败。
类型: SwitchParameter 别名: cf Position: Named 默认值: False 必需: False 接受管道输入: False 接受通配符: False-DefaultDisplayProperty未指定任何其他属性时,指定由 Format-Wide cmdlet 显示的类型的属性。 键入类型的标准或扩展属性的名称。 此参数的值可以是已添加到同一命令中的类型的名称。 仅当没有为 Fo...
Key Value --- --- a Power b Shell $PSCmdlet 包含一个对象,该对象表示正在运行的 cmdlet 或高级函数。 可以在 cmdlet 或函数代码中使用对象的属性和方法来响应使用条件。 例如,ParameterSetName 属性包含正在使用的参数集的名称,ShouldProcess 方法将 WhatIf 和Confirm 参数动态添加到 cmdlet。 有关$PSCmdlet...
Switch parameters are just the opposite in that you specify the parameter but the argument is left out. The interpreter assigns the parameter a value based on whether the parameter is present or not. To specify a switch type parameter, you should use the "[switch]" type literal in the para...