[PSS 2015] Renaming variables: Parameter

Post feature requests, product enhancement ideas, and other product-specific suggestions here. Do not post bug reports.
Forum rules
Do not post any licensing information in this forum.
Locked
User avatar
Bosparan
Posts: 275
Joined: Sun Mar 03, 2013 12:45 pm

[PSS 2015] Renaming variables: Parameter

Post by Bosparan » Tue Dec 08, 2015 9:44 am

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.  
  5.     <#
  6.  
  7.         .SYNOPSIS
  8.  
  9.             A brief description of the Get-Test function.
  10.  
  11.        
  12.  
  13.         .DESCRIPTION
  14.  
  15.             A detailed description of the Get-Test function.
  16.  
  17.        
  18.  
  19.         .PARAMETER Foo
  20.  
  21.             A description of the Foo parameter.
  22.  
  23.        
  24.  
  25.         .EXAMPLE
  26.  
  27.             PS C:\> Get-Test -Foo $value1
  28.  
  29.        
  30.  
  31.         .NOTES
  32.  
  33.             BlaBla
  34.  
  35.        
  36.  
  37.         .LINK
  38.  
  39.             Link to Website.
  40.  
  41.     #>
  42.  
  43.     [CmdletBinding()]
  44.  
  45.     Param (
  46.  
  47.         $Foo
  48.  
  49.     )
  50.  
  51.    
  52.  
  53.     if ($PSBoundParameters['Foo'])
  54.  
  55.     {
  56.  
  57.        
  58.  
  59.     }
  60.  
  61. }
After Rename
  1. function Get-Test
  2.  
  3. {
  4.  
  5.     <#
  6.  
  7.         .SYNOPSIS
  8.  
  9.             A brief description of the Get-Test function.
  10.  
  11.        
  12.  
  13.         .DESCRIPTION
  14.  
  15.             A detailed description of the Get-Test function.
  16.  
  17.        
  18.  
  19.         .PARAMETER Foo
  20.  
  21.             A description of the Foo parameter.
  22.  
  23.        
  24.  
  25.         .EXAMPLE
  26.  
  27.             PS C:\> Get-Test -Foo $value1
  28.  
  29.        
  30.  
  31.         .NOTES
  32.  
  33.             BlaBla
  34.  
  35.        
  36.  
  37.         .LINK
  38.  
  39.             Link to Website.
  40.  
  41.     #>
  42.  
  43.     [CmdletBinding()]
  44.  
  45.     Param (
  46.  
  47.         $Bar
  48.  
  49.     )
  50.  
  51.    
  52.  
  53.     if ($PSBoundParameters['Foo'])
  54.  
  55.     {
  56.  
  57.        
  58.  
  59.     }
  60.  
  61. }
Cheers,
Bosparan

User avatar
davidc
Posts: 5143
Joined: Thu Aug 18, 2011 4:56 am

Re: [PSS 2015] Renaming variables: Parameter

Post by davidc » Tue Dec 08, 2015 10:23 am

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
David
SAPIEN Technologies, Inc.

Locked