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:
parent
0d5522b8c7
commit
7dd40b7b82
|
@ -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: $_"
|
||||
}
|
|
@ -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: $_" }
|
Loading…
Reference in New Issue