Page 1 of 1

[PSS 2015] Renaming variables: Parameter

Posted: Tue Dec 08, 2015 8: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
  1. function Get-Test
  2. {
  3.     <#
  4.         .SYNOPSIS
  5.             A brief description of the Get-Test function.
  6.        
  7.         .DESCRIPTION
  8.             A detailed description of the Get-Test function.
  9.        
  10.         .PARAMETER Foo
  11.             A description of the Foo parameter.
  12.        
  13.         .EXAMPLE
  14.             PS C:\> Get-Test -Foo $value1
  15.        
  16.         .NOTES
  17.             BlaBla
  18.        
  19.         .LINK
  20.             Link to Website.
  21.     #>
  22.     [CmdletBinding()]
  23.     Param (
  24.         $Foo
  25.     )
  26.    
  27.     if ($PSBoundParameters['Foo'])
  28.     {
  29.        
  30.     }
  31. }
After Rename
  1. function Get-Test
  2. {
  3.     <#
  4.         .SYNOPSIS
  5.             A brief description of the Get-Test function.
  6.        
  7.         .DESCRIPTION
  8.             A detailed description of the Get-Test function.
  9.        
  10.         .PARAMETER Foo
  11.             A description of the Foo parameter.
  12.        
  13.         .EXAMPLE
  14.             PS C:\> Get-Test -Foo $value1
  15.        
  16.         .NOTES
  17.             BlaBla
  18.        
  19.         .LINK
  20.             Link to Website.
  21.     #>
  22.     [CmdletBinding()]
  23.     Param (
  24.         $Bar
  25.     )
  26.    
  27.     if ($PSBoundParameters['Foo'])
  28.     {
  29.        
  30.     }
  31. }
Cheers,
Bosparan

Re: [PSS 2015] Renaming variables: Parameter

Posted: Tue Dec 08, 2015 9: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