
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
24 lines
No EOL
757 B
PowerShell
24 lines
No EOL
757 B
PowerShell
param([switch]$Force)
|
|
|
|
$local:currentSys = [SystemName]::_GetValidValues('',$true,$true);
|
|
|
|
if( -not $global:MyModulesWarning -or $Force ) {
|
|
$global:MyModulesWarning = @()
|
|
}
|
|
[MyConfig]::GetConfigPaths('mymodules',$false) |
|
|
ForEach-Object {
|
|
$local:modules = $( Get-Content $_ | ConvertFrom-Json );
|
|
$modules.Always;
|
|
$currentSys | ForEach-Object { $modules."$_" } | Where-Object { $_}
|
|
} | Where-Object {
|
|
$local:m = $_
|
|
if( $( try {
|
|
-not (Get-Module -ListAvailable $m -ErrorAction stop)
|
|
} catch { $true }
|
|
)) {
|
|
$m -notin $global:MyModulesWarning
|
|
}
|
|
} | ForEach-Object {
|
|
$global:MyModulesWarning += $_
|
|
Write-Warning "Missing module: $_"
|
|
} |