Test-MyModules finalized, ready for work

Future imporvement will allow prompting for installation or a command to
automate following recommendations.
This commit is contained in:
Gal 2020-11-05 00:29:04 -05:00
parent 0d5522b8c7
commit 7dd40b7b82
2 changed files with 18 additions and 1 deletions

View File

@ -0,0 +1,18 @@
if( -not $global:MyModulesWarning ) {
$global:MyModulesWarning = @()
}
[MyConfig]::GetConfigPaths('mymodules',$false) |
ForEach-Object {
$( Get-Content $_ | ConvertFrom-Json ).Modules
} | 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: $_"
}

View File

@ -1 +0,0 @@
$(Get-Content $MyPSScriptRoot/src/modules.json | ConvertFrom-Json).Modules | Where-Object { try{-not (Get-Module -ListAvailable $_aaa -ErrorAction stop) }catch{} } | ForEach-Object { Write-Warning "Missing module: $_" }