提供程序允许访问通过命令行难以访问的数据和组件。 数据以与文件系统驱动器类似的一致格式显示。提供程序公开的数据会出现在 驱动器上,并且数据通过 路径 进行访问,就像使用磁盘驱动器一样。 每个提供程序的内置 cmdlet 管理提供程序驱动器上的数据。PowerShell 包含以下一组内置提供程序,用于访问不同类型的数据存储:...
Using parameters, you can specify which values you want returned and which files you want to measure. There are four parameter sets defined: Path PathAll LiteralPath LiteralPathAll PowerShell העתק function Measure-Lines { [CmdletBinding(DefaultParameterSetName = 'Path')] param ( [...
To get the value of a specificCmdletName:ParameterNamekey, use the following syntax: $PSDefaultParameterValues["CmdletName:ParameterName"] For example, to get the value for theSend-MailMessage:SmtpServerkey. PS> $PSDefaultParameterValues["Send-MailMessage:SmtpServer"] Server123 ...
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...
Splatting creates the parameter keys and values. TheNameparameter specifies the drive name,MyDocs. ThePSProviderparameter specifies the PowerShellFileSystemprovider.Rootspecifies the local computer's directory. TheDescriptionparameter describes the drive's purpose.New-PSDriveuses the splatted parameters ...
The subsystem starts a specific version of PowerShell with predefined parameters. If the specified subsystem does not exist on the remote computer, the command fails. If this parameter is not used, the default is the powershell subsystem. Expand table Type: String Position: Named...
BoundParameters.ContainsKey(“OutputDirectory”)) { Set-ItemProperty $basePath -Name OutputDirectory -Value $OutputDirectory }## Set the invocation header if($IncludeInvocationHeader) { Set-ItemProperty $basePath -Name IncludeInvocationHeader -Value 1 } }...
Get-Help may report parameters with ValueFromRemainingArguments attribute as pipeline-able (#23871) Code Cleanup We thank the following contributors! @xtqqczze, @eltociear Minor cleanup on local variable names within a method (#24105) Remove explicit IDE1005 suppressions (#21217) (Thanks @xtqq...
Object<PSObject> [[-Path] <String>] [-LiteralPath <String>] [-Force] [-NoClobber] [-Encoding <Encoding>] [-Append] [-UseCulture] [-IncludeTypeInformation] [-NoTypeInformation] [-QuoteFields <String[]>] [-UseQuotes <QuoteKind>] [-NoHeader] [-WhatIf] [-Confirm] [<CommonParameters>]...
Test-MAPIConnectivity[-Server <ServerIdParameter>] [-ActiveDirectoryTimeout <Int32>] [-AllConnectionsTimeout <Int32>] [-Confirm] [-DomainController <Fqdn>] [-IncludePassive] [-MonitoringContext <Boolean>] [-PerConnectionTimeout <Int32>] [-WhatIf] [<CommonParameters>] ...