Skip to content

Enhancement: add support for passing complex content from files into command options #2042

Description

@waldekmastykarz

Raised from #1732

We should extend CLI for Microsoft 365 with support for passing complex content directly from files. To avoid re-inventing the wheel, we should follow the implementation in az cli, where you can pass the contents of a file by denoting the file path with a @, eg.:

m365 spo sitescript add --title "My Script" --content @sitescript.json

The implementation should be done in such a way so that it's done centrally in the CLI rather than in each command separately. When parsing options and their values, CLI should check if the specified value starts with a @ and if whatever follows points to an existing file (validation). After resolving arguments, CLI should load the contents from the specified files and replace the option value with the contents of the file.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions