1
0
Fork 0

Test-MyModules finalized, ready for work

Future imporvement will allow prompting for installation or a command to
automate following recommendations.
Dieser Commit ist enthalten in:
Gal 2020-11-05 00:29:04 -05:00
Ursprung 0d5522b8c7
Commit 7dd40b7b82
2 geänderte Dateien mit 18 neuen und 1 gelöschten Zeilen

18
profile.d/Test-MyModules.ps1 Normale Datei
Datei anzeigen

@ -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: $_"
}

Datei anzeigen

@ -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: $_" }