-Examples [-Functionality <System.String[]>] [-Path <System.String>] [-Role <System.String[]>] [<CommonParameters>] Get-Help [[-Name] <System.String>] [-Category {Alias | Cmdlet | Provider | General | FAQ | Glossary | HelpFile | ScriptCommand | Function | Filter | ExternalScript ...
Alias 提供程序在 Alias: 驱动器中公开其数据存储。 若要使用别名,可以使用以下命令将位置更改为 Alias: 驱动器: PowerShell 复制 Set-Location Alias: 若要返回到文件系统驱动器,请键入驱动器名称。 例如,键入: PowerShell 复制 Set-Location C: 还可以使用来自任何其他 PowerShell 驱动器的 Alias 提供...
Param( [Parameter(Mandatory=$true)] [Alias("CN","MachineName")] [String[]]$ComputerName) 参数和变量验证属性 验证属性指示 PowerShell 测试用户在调用高级函数时提交的参数值。 如果参数值未通过测试,则会生成错误,并且不会调用函数。 还可以使用某些验证属性来限制...
For more information about aliases that can be used with specific parameters, see Common Parameter Names. Defining Parameter Aliases To define an alias for a parameter, declare the Alias attribute, as shown in the following parameter declaration. In this example, multiple aliases are defined for th...
[Alias('Yellow')] [Switch]$OptionYellow ) $AllOptions = Get-Variable -Name 'Option*' If (-Not $AllOptions.Value.Contains($True)) { "None of the Option Switches were used, setting all Option Variables to $True" ForEach ($Option In $AllOptions) {$Option.Value = $True} ...
private string _name = "PowerShellIsolatedStore"; /// name of store [Alias("Filename")] [Parameter] public string Name { get { return _name; } set { _name = value; } } Common ParametersWindows PowerShell reserves a few parameter names, referred to as Common parameters, which you ...
Write-SSMParameter`-Name"parameter-name"`-Value"parameter-value"`-Type"SecureString"`-KeyId"an AWS KMS key ID, an AWS KMS key ARN, an alias name, or an alias ARN"`-Tags$tag 如果成功,該命令將會傳回參數的版本號碼。 注意 若要使用 AWS 受管金鑰 指派給您帳戶的 ,請從 命令中移除-KeyId...
在此示例中,Get-Alias 和Get-Command 与Out-File cmdlet 一起使用,在当前目录中创建两个文本文件,Alias.txt 和Command.txt。 Select-String 使用带星号()通配符的 * 参数搜索当前目录中具有文件扩展名 .txt的所有文件。 Pattern 参数指定要匹配 Get-的文本。 Select-String PowerShell 控制台中显示输出。 文件名...
You can use Name or its alias, ServiceName, or you can omit the parameter name. Required? true Position? 0 Default value None Accept pipeline input? True (ByPropertyName, ByValue) Accept wildcard characters? false 通过管道将对象发送到 Start-Service 时,PowerShell 会尝试将对象与 InputObject...
在此示例中,Get-Alias和Get-Command与Out-Filecmdlet 一起使用,在当前目录中创建两个文本文件,Alias.txt和Command.txt。 Select-String使用带星号()通配符的*参数搜索当前目录中具有文件扩展名.txt的所有文件。Pattern参数指定要匹配Get-的文本。Select-StringPowerShell 控制台中显示输出。 文件名和行号位于每个内容行...