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.
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.jsonThe 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.