Page 1 of 1

[PSS 2015] Renaming variables: Parameter

Posted: Tue Dec 08, 2015 9:44 am
by Bosparan
Hi guys,

another small request, to make a features that already exists work more smoothly:

When renaming the parameter of a function, could you also rename ...
... $PSBoundParameters entries?
... Examples in the Help section?
... Parameter documentation in the Help section?

Example of current State
Before Rename

Code: Select all

function Get-Test
{
<#
.SYNOPSIS
A brief description of the Get-Test function.

.DESCRIPTION
A detailed description of the Get-Test function.

.PARAMETER Foo
A description of the Foo parameter.

.EXAMPLE
PS C:\> Get-Test -Foo $value1

.NOTES
BlaBla

.LINK
Link to Website.
#>
[CmdletBinding()]
Param (
$Foo
)

if ($PSBoundParameters['Foo'])
{

}
}
After Rename

Code: Select all

function Get-Test
{
<#
.SYNOPSIS
A brief description of the Get-Test function.

.DESCRIPTION
A detailed description of the Get-Test function.

.PARAMETER Foo
A description of the Foo parameter.

.EXAMPLE
PS C:\> Get-Test -Foo $value1

.NOTES
BlaBla

.LINK
Link to Website.
#>
[CmdletBinding()]
Param (
$Bar
)

if ($PSBoundParameters['Foo'])
{

}
}
Cheers,
Bosparan

Re: [PSS 2015] Renaming variables: Parameter

Posted: Tue Dec 08, 2015 10:23 am
by davidc
The $PSBoundParameters reference will be picked up if you use the ContainsKey method. We will make sure it also picks up the indexing operator as well in the next build.

Updating the comment-based help is on our list of wanted features.

David