cli-microsoft365
cli-microsoft365 copied to clipboard
Bug report: Command Completion does not seem to work in PoSh 5, it does in PoSh 7 though.
Description
Using the help section here I configured Auto completion. But I can't get it to work on PoSh 5. While on PoSh 7 it works like a glove.
The $profile files all contain the right content referring to the right Register-CLIM365Completion.ps1
file. No error is thrown on registering or on autocompleting, it just does not work.
Steps to reproduce
Follow the manual on PoSh 5
Expected results
Like it says in the manual
Actual results
Nothing. No feedback, no results.
Diagnostics
No response
CLI for Microsoft 365 version
5.4.0 (next)
nodejs version
16.15.0
Operating system (environment)
Windows
Shell
PowerShell
cli doctor
No response
Additional Info
No response
Have you confirmed if the PowerShell profile is update with the completion registration and if the profile is actually loaded in the PowerShell session?
Yes certainly! I checked the contents of the profile files and to be sure added some write-host logging just above the loading of the Register ps file. Those all came through fine.
Is Register-ArgumentCompleter
a thing in PowerShell 5? If so, it would be interesting to debug it and see what's coming through and if our logic stands in PowerShell 5.
Looking at the docs, Register-ArgumentCompleter
should work just fine in PowerShell 5.1. Can you double check which version of PowerShell you were using and wasn't working @martinlingstuyl?
Just did some testing and the problem was with our usage of the Join-Path
commandlet @waldekmastykarz. I fixed it and created a PR 👍