Add Credentials capability to SHiPSProvider.
It should be much easier to build providers for data sources that require authentication if add Credentials capability to SHiPSProvider.
Also Drive (PSDriveInfo) property should be added to the ProviderContext class to provide authors access to credentials specified by user in -Credential parameter of New-PSDrive cmdlet.
It's a reasonably convenient approach, I've always like how Microsoft.Extensions.Configuration basically takes a lot of complex inputs and boils them down to a key-value store and this is a similar concept.
Thoughts:
- What if I, as a user, don't want to use secretmanagement to give you my credential? You'd need to instruct module authors to use parametersets probably which is an even more complicated scenario.
- What if I don't want to use the default vault? How am I going to specify it? And how is your class going to know?
@JustinGrote good point. could have an optional parameter for vault name. I only run into that when I store the same name for a secret in multiple vaults, but it happens.