PowerShellEditorServices
PowerShellEditorServices copied to clipboard
Introduce a new ModuleService for common module management operations
I just implemented PowerShell Gallery module update logic for the PowerShell ISE Preview and realized that this behavior really should be made available to all editors which use Editor Services. I'd like to take the work @dfinke did for PowerShell Gallery module installation and put it together with my module update checking logic to make a new ModuleService which has the following features:
- List and install modules from the PowerShell Gallery (and any other registered repository)
- Check for, get notified about, and install modules that have new updates
- Publish a module to the PowerShell Gallery (generally used for publishing a module from the current workspace path)
I really like to "Publish a module from current workspace path". I always have troubles with developing module in one place and copying it for publishing in one of $env:PSModulePath locations.
Yeah, getting that right will be a little tricky because some modules need their files copied into a folder to publish from. Module definition schema needs a pre-publish command field...
Publish would be nice. I wonder though if for VSCode, if it wouldn't be better to use the Task support for publishing. Maybe somebody comes up with a Gulp task template. Or maybe the Task would use a PSake file instead?
Going through the issues...
So @daviwil's first bullet point is already done "List and install modules from the PowerShell Gallery (and any other registered repository)"
The other 2, I don't think they're implemented. I think the "publish module" sounds great as a VSCode Task as @rkeithhill mentioned though. The hardest one I think will be the middle bullet point since the Gallery doesn't have any sort of notification system.