Cli-microsoft365: Bug report: The file that provides a tab completion in PowerShell is renamed

Created on 2 Sep 2020  路  4Comments  路  Source: pnp/cli-microsoft365

Description

There is an error after installing the latest version of the CLI (3.0): Starting the CLI after upgrading the following error shows (from PowerShell and Windows Terminal):

C:\Users\xxxx\AppData\Roaming\nvm\v12.14.1\node_modules\@pnp\office365-cli\scripts\Register-O365CLICompletion.ps1 :
The term
'C:\Users\xxxx\AppData\Roaming\nvm\v12.14.1\node_modules\@pnp\office365-cli\scripts\Register-O365CLICompletion.ps1'
is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name,
or if a path was included, verify that the path is correct and try again.
At C:\OneDrive\OneDrive - Portiva\Documenten\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:4 char:1
+ C:\Users\xxxx\AppData\Roaming\nvm\v12.14.1\node_modules\@pnp\office ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\xxxx...ICompletion.ps1:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Steps to reproduce

  • install previous version of CLI (or install v3 direct)
  • upgrade to 3.0
  • use m365 cli completion pwsh update
  • experience error

Expected result

  • no completion errors

Actual result

  • see error in description

Environment

  • windows 10
  • cli 3.0
  • PowerShell core 7.x

I assume that the error has to do with the fact that the PowerShell file it is refering to in the folder:
C:\Users\xxxx\AppData\Roaming\nvm\v12.14.1\node_modules\@pnp\office365-cli\scripts is called Register-Register-CLIM365Completion.ps1. The file the module is requesting is called Register-O365CLICompletion.ps1 and that file is no longer present (renamed during in the V3 release)

bug work in progress

Most helpful comment

Fixed in the latest v3.0.0 beta

All 4 comments

How did you exactly run upgrade to 3.0? Do you mean @pnp/[email protected] or @pnp/[email protected]?

I noticed we renamed the file, but not its reference in the cli completion pwsh update command. Good catch

@waldekmastykarz I did both scenarios to upgrade as well as a 3.0 install after uninstalling the o365cli version.

Fixed in the latest v3.0.0 beta

Was this page helpful?
0 / 5 - 0 ratings