Better cross platform support

Edit-MyScript will pause if edit is running in background (conext
returning less than a second after launching editor)
Test-MyModules which loads at stratup now has specific platform lists
This commit is contained in:
Gal Szkolnik 2020-11-09 13:06:17 -05:00
parent 7dd40b7b82
commit 8566ea6863
6 changed files with 24 additions and 6 deletions

View file

@ -1,9 +1,15 @@
if( -not $global:MyModulesWarning ) {
param([switch]$Force)
$local:currentSys = [SystemName]::_GetValidValues('',$true,$true);
if( -not $global:MyModulesWarning -or $Force ) {
$global:MyModulesWarning = @()
}
[MyConfig]::GetConfigPaths('mymodules',$false) |
ForEach-Object {
$( Get-Content $_ | ConvertFrom-Json ).Modules
$local:modules = $( Get-Content $_ | ConvertFrom-Json );
$modules.Always;
$currentSys | ForEach-Object { $modules."$_" } | Where-Object { $_}
} | Where-Object {
$local:m = $_
if( $( try {
@ -15,4 +21,4 @@ if( -not $global:MyModulesWarning ) {
} | ForEach-Object {
$global:MyModulesWarning += $_
Write-Warning "Missing module: $_"
}
}