Open
Description
Eventually there is going to be a need to ignore certain Commands or Modules when PSES Registers Commands.
Here are the ideas I have had.
- Block all Registering from outside of Profile
- Block all Registering from Blacklisted Modules.
- Only Allow Registering from Whitelisted Modules
- Only Allow Registering Whitelisted Commands
You can currently do something like the following:
# Microsoft.VSCode_profile.ps1
Import-Module Blah1
Import-Module Blah2
Import-Module Blah3
Import-Module Blah4
Import-Module Blah5
# Do All The Things Here
Unregister-EditorCommand -Name Command1FromBlah1
Unregister-EditorCommand -Name Command2FromBlah1
Unregister-EditorCommand -Name Command1FromBlah2
Unregister-EditorCommand -Name Command2FromBlah2
Unregister-EditorCommand -Name Command3FromBlah3
Unregister-EditorCommand -Name Command1FromBlah4
Unregister-EditorCommand -Name Command1FromBlah5
Unregister-EditorCommand -Name Command2FromBlah5
Unregister-EditorCommand -Name Command3FromBlah5
However, this would quickly become a headache and hard to maintain if a Module is regularly adding commands etc.