New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ReadOnlyProviders
option for session configuration files
#21528
base: master
Are you sure you want to change the base?
Add ReadOnlyProviders
option for session configuration files
#21528
Conversation
ReadOnlyProviders
option for session configuration filesReadOnlyProviders
option for session configuration files
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
@@ -2029,6 +2033,28 @@ public override InitialSessionState GetInitialSessionState(PSSenderInfo senderIn | |||
} | |||
} | |||
|
|||
if (readonlyProvidersApplied) | |||
{ | |||
string[] providers = TryGetStringArray(_configHash[ConfigFileConstants.ReadOnlyProviders]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code below this for providerVisibilityApplied
uses a case-insensitive hashtable which looks unnecessary to me? The asymmetry between this and the latter would create confusion for future people reading the code. Seems like we either need to either make them the same or add a comment why they are different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code below this for
providerVisibilityApplied
uses a case-insensitive hashtable which looks unnecessary to me? The asymmetry between this and the latter would create confusion for future people reading the code. Seems like we either need to either make them the same or add a comment why they are different.
Thanks Steve! Yep the hashset seems to do nothing at all, I went ahead and removed it there as well.
PR Summary
Adds option in a session configuration file to make a provider visible, but not able to be written to.
PR Context
Keeping this as WIP only because I expect issues with the test. Will take it out of draft after getting that working.PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
or[ WIP ]
to the beginning of the title (theWIP
bot will keep its status check atPending
while the prefix is present) and remove the prefix when the PR is ready.(which runs in a different PS Host).