I\'m hoping to create a parameter who\'s default value is the \'current directory\' (.
).
For example, the Path
parameter of Get-Child
Use PSDefaultValue
attribute to define custom description for default value. Use SupportsWildcards
attribute to mark parameter as Accept wildcard characters?
.
<#
.SYNOPSIS
Does something with paths supplied via pipeline.
.PARAMETER Path
Specifies a path to one or more locations. Wildcards are permitted. The default location is the current directory (.).
#>
Function Invoke-PipelineTest {
[cmdletbinding()]
param(
[Parameter(Mandatory=$False,ValueFromPipeline=$True,ValueFromPipelinebyPropertyName=$True)]
[PSDefaultValue(Help='Description for default value.')]
[SupportsWildcards()]
[string[]]$Path='.'
)
}