msgraph-sdk-powershell icon indicating copy to clipboard operation
msgraph-sdk-powershell copied to clipboard

Provide a command for managing global settings that apply to the SDK

Open peombwa opened this issue 1 year ago • 3 comments

We should provide a command for managing global configurations that apply to the SDK. The command can be used to opt-in to preview features etc. This can be something like *-MgConfig

peombwa avatar May 02 '23 19:05 peombwa

I'm not sure I agree we need a config file @peombwa . Typically configurations for PowerShell commands are managed via preference variables or other per-session commands. Either of those approaches can be invoked from the PowerShell profile, i.e. if there is a command like Set-MgGraphOption SigninUi Native you can run it in your PowerShell profile. Or you could have a preference variable like $MicrosoftGraphPowerShellSigninUi = 'Native' . And a user could still create a json file for these and pipe the result to a command if they really wanted to manage this via a file separate from the powershell profile.

Can you say more why we want to use this approach vs. the typical approach? What about starting with just the command or preference approach and then adding config file if we see user demand?

adamedx avatar May 09 '23 15:05 adamedx

+1 on using the PowerShell profile. This gives the flexibility to have custom config options for each different profiles/session instead of a single confiig for the desktop.

I like the idea of a config. For example I would like to use a different ClientID instead of the default Graph PS. Today I need to use Connect-MgGraph -ClientId each time which makes it very inconvenient. Using a config option to set the default ClientID for the profile would be really neat.

merill avatar May 09 '23 21:05 merill

You already have the option to use default values in each session, see https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_parameters_default_values?view=powershell-7.3 It can easily get a bit hairy though so a single function to manage Graph-specific default values would be cool

salbeck-sit avatar May 10 '23 06:05 salbeck-sit