Skip to main content

cli completion pwsh setup

Sets up command completion for PowerShell

Usage​

m365 cli completion pwsh setup [options]

Options​

-p, --profile <profile>

Path to the PowerShell profile file

-h, --help [help]

Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are options, examples, remarks, permissions, response, full. Default is options.

--query [query]

JMESPath query string. See http://jmespath.org/ for more information and examples.

-o, --output [output]

Output type. json, text, csv, md, none. Default json.

--verbose

Runs command with verbose logging.

--debug

Runs command with debug logging.

Remarks​

This commands sets up command completion for the CLI for Microsoft 365 in PowerShell by registering a custom PowerShell argument completer in the specified profile. Because CLI for Microsoft 365 is not a native PowerShell module, it requires a custom completer to provide completion.

If the specified profile path doesn't exist, the CLI will try to create it.

Examples​

Set up command completion for PowerShell using the profile from the profile variable

m365 cli completion pwsh setup --profile $profile

Response​

The command won't return a response on success.

More information​