ThomasKur / M365Documentation

Automatic Microsoft 365 Documentation to simplify the life of admins and consultants.
Other
300 stars 45 forks source link

Autocompleter for Get-M365Doc does not work #42

Closed HCRitter closed 4 months ago

HCRitter commented 9 months ago

Hi,

the AutoCompleter for Get-M365 does not work, it don't points to: "$PSScriptRoot..\Internal\Collector"

its probably that the call of the Autocompleter to the function is not executed. if you switch from:

function Get-ValidComponentsValue {
    [CmdletBinding()]
    param()
    $AllCommands = Get-ChildItem -Path "$PSScriptRoot\..\Internal\Collector" -Directory 
    return $AllCommands.Name
}
[ArgumentCompleter(
            {

                param(
                    $Command, 
                    $Parameter, 
                    $WordToComplete, 
                    $CommandAst, 
                    $FakeBoundParams)

                   Get-ValidComponentsValue 
            }
        )]

to:

[ArgumentCompleter(
            {

                param(
                    $Command, 
                    $Parameter, 
                    $WordToComplete, 
                    $CommandAst, 
                    $FakeBoundParams)

                    (Get-ChildItem -Path "$PSScriptRoot\..\Internal\Collector" -Directory).Name 
            }
        )]

it works

should I raise a PR?

ThomasKur commented 5 months ago

Hi, strange, it works on my system without an issue.... what PS Version are you using?

ThomasKur commented 4 months ago

No feedback. close