Introducing Packages

Major Overhaul with Breaking Changes
split into packaged, default behavior moved into 'base' package
each package has a json package description file with criteria for
loading

Modified Setup-Profile to refer to 'base' package path for auto loading

moved Linux aliases and command to 'base.linux' package
created 'docker' package to address docker supported systems

modified Get-MyScripts, Edit-MyScripts and Reload-MyScripts accordingly.

Dropped -System and sys.*, package json conditions will take care of it.

Supplied command to create/edit package json files:
  - New-MyPackage
  - Add-PackageCondition
  - Set-MyPackage
This commit is contained in:
lksz 2020-11-25 00:46:33 -05:00
parent 80a488484b
commit 42b39f4e25
83 changed files with 505 additions and 130 deletions

View file

@ -0,0 +1,21 @@
# PowerShell Cookbook has a lot of code there, I'm only interested in
# the Add-ObjectCollector which adds an overloaded Out-Default version,
# which stores a history of output objects.
# One major problem with loading this from the module, is that when the
# module is removed the shell BREAKS.
#
# The code below, makes sure the module is removed, and then imports
# only the Add-ObjectCollector code from it.
# All I really want is the Out-Default function created by
# Add-ObjectCollector, and so, I'll also remove the function once done.
if( Get-Module PowerShellCookbook ) {
Remove-Module PowerShellCookbook
Import-Module PowerShellCookbook -Cmdlet Add-ObjectCollector
}
#
. Get-Command Add-ObjectCollector -ErrorAction SilentlyContinue | ForEach-Object {
Add-ObjectCollector
Get-Item function:/Add-ObjectCollector | Remove-Item
}