Currently, we use several different ways to check if a certain output type is requested. With the change of v4, the default output type has been changed from text to json. This "breaks" several commands that check if the output type is a certain value. I am using quotes here because it doesn't reject the command but doesn't use correct the condition. e.g. of the command m365 planner task checklistitem add.


Notice here the Id value. When I pass the option -o json . I would expect to get the same response as the first image, but this isn't the case. The command uses if (args.options.output === 'json') to check if the output type is json. Here we don't take into consideration what the default output type is.
This also relates to a recently found bug #3400 which caused an option to be unavailble without an explicit ouput type.
With this all in mind, I would suggest to create a new utils function that can validate if the output is a certain type. This new function would take in mind the current default output type and can be used in the following commands.
- m365 aad approleassignment add
- m365 graph schemaextension list
- m365 planner task checklistitem add
- m365 spfx project externalize
- m365 spo search
- m365 spo app add
- m365 spo customaction list
- m365 spo file list
- m365 spo file sharinginfo get
- m365 spo listitem get
- m365 spo listitem list
- m365 spo page column get
- m365 spo page column list
- m365 spo page section get
- m365 spo page section list
- m365 spo sitedesign run list
- m365 spo tenant recyclebinitem list
- m365 spo userprofile get
- m365 spo web list
- m365 teams chat message list
- m365 teams message list
- m365 teams message reply list
- m365 teams user app list
- m365 tenant report office365activationcounts
- m365 tenant report office365activationsusercounts
- m365 tenant report office365activationsuserdetail
- m365 todo task list
- m365 yammer search
All of these commands ignore the default output type, so they need to be adjusted to take this into consideration.
Currently, we use several different ways to check if a certain output type is requested. With the change of v4, the default output type has been changed from
texttojson. This "breaks" several commands that check if the output type is a certain value. I am using quotes here because it doesn't reject the command but doesn't use correct the condition. e.g. of the commandm365 planner task checklistitem add.Notice here the Id value. When I pass the option
-o json. I would expect to get the same response as the first image, but this isn't the case. The command usesif (args.options.output === 'json')to check if the output type isjson. Here we don't take into consideration what the default output type is.This also relates to a recently found bug #3400 which caused an option to be unavailble without an explicit ouput type.
With this all in mind, I would suggest to create a new utils function that can validate if the output is a certain type. This new function would take in mind the current default output type and can be used in the following commands.
All of these commands ignore the default output type, so they need to be adjusted to take this into consideration.