Replies: 2 comments 8 replies
-
This is a very interesting idea! We could persist the context on disk and that way make it easy for future re-use. That way we could define a set of parameters that you can have ready in the background and whenever you run a command, we could expand them before running validation: a bit like a super-clipboard. When it comes to setting the context, we can make use of CLI's ability to support unknown arguments, so rather than using JSON and fiddling with escaping quotes we could say: Since we wouldn't persist auth, we'd need to give it a thought if |
Beta Was this translation helpful? Give feedback.
-
@pnp/cli-for-microsoft-365-maintainers 🤩 moving the discussion from private discussion back here 😉. It is still opened from back in the days I had this idea... what an old idea 👴 ... Lets try to make it happen 💪 |
Beta Was this translation helpful? Give feedback.
-
So like yesterday I had a discussion with a friend and he pointed out that in m365 all the time (for almost every command) we pass
-u
or--webUrl
param, as opposed to PnP PowerShell were we don't have to do it 🤔. This of course is understandable as in PnP PowerShell we connect to a single site and by default work in the context of this site and in m365 CLI we just login to the tenant which connection persist, so we don't have to start with login in every time, which is cool 🙂, and in the end what we do is we usually have variables like$TeamSiteFor...
which we just pass to every command.What I was thinking (and maybe is a good idea or a completely stupid one 😋) is maybe in m365 CLI we could create something like an
m365Context
. So for example the user could create any kind of context (name it whatever he or she would like to), pass to the context any kind of parameters and then when some command is used and user does not specify the needed parameters CLI could first look if those were specified in the current context and if yes use them 🤔. What do you think? seems interesting ... or maybe my description is totally not clear 🤔.ok... maybe I will try with some mocked code and comments 🙂
I hope the code example is more clear.. TBH for me it is 😅
Let me know what do you think 🙂?
Beta Was this translation helpful? Give feedback.
All reactions