Browse Source

Test-MyModules finalized, ready for work

Future imporvement will allow prompting for installation or a command to
automate following recommendations.
master
Gal 1 year ago
parent
commit
7dd40b7b82
2 changed files with 18 additions and 1 deletions
  1. +18
    -0
      profile.d/Test-MyModules.ps1
  2. +0
    -1
      profile.d/test-modules.ps1

+ 18
- 0
profile.d/Test-MyModules.ps1 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: $_"
}

+ 0
- 1
profile.d/test-modules.ps1 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: $_" }

Loading…
Cancel
Save