[PS] Parameter tab-completion does not work in assignment statement

Discussion in 'Scripting' started by Alex K. Angelopoulos [MVP], May 2, 2006.

  1. If you enter the following and hit the tab key:
    Get-EventLog -Ne
    the shell automatically completes -Ne:
    Get-EventLog -Newest
    If you do this, however:
    $e = Get-EventLog -Ne
    You don't get tab-completion.

    At this point is this a known bug, by design, or a problem to report?
     
    Alex K. Angelopoulos [MVP], May 2, 2006
    #1
    1. Advertisements

  2. it will work if you pre-fix it with a "("

    $e = (Get-EventLog -Ne[tab]

    but it will remove a bit infront with Property completement

    $foo = ($date.[tab]

    $foo = $date.Add(

    gr /\/\o\/\/
     
    /\/\o\/\/ [MVP], May 2, 2006
    #2
    1. Advertisements

  3. Alex K. Angelopoulos [MVP]

    applepwc Guest

    $cmdlet = [regex]::Split($line, '[|;]')[-1]
    to
    $cmdlet = [regex]::Split($line, '[=|;]')[-1]
    #########
    And please "ardcore folks" solve my tab-expansion problem.
    If I want to type "test-path test.ps1"
    I type "test.ps1" first.
    Then back to prompt start position,type "test-[TAB] test.ps1"
    finally I get "test-path".But "test.ps1" is disappear.

    TIA

    --
    greeting

    applepwc


     
    applepwc, May 3, 2006
    #3
  4. Yeah I noticed that too. Tab-completion within a line wipes out the rest of
    the line. Bummer.
     
    Keith Hill [MVP], May 3, 2006
    #4
  5. Agreed. Unfortunately this is not somethat that the end-user can fix with a
    function. It'll have to be post 1.0 thing...

    --
    Bruce Payette [MSFT]
    Windows PowerShell Technical Lead
    Microsoft Corporation
    This posting is provided "AS IS" with no warranties, and confers no rights.


     
    Bruce Payette [MSFT], May 3, 2006
    #5
  6. Alex K. Angelopoulos [MVP], May 3, 2006
    #6
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.