]> apps.delaporte.us Git - dotfiles.git/commitdiff
Update to selectively load my PowerShell modules
authorEdward Delaporte <delaport@illinois.edu>
Mon, 2 Oct 2023 18:27:46 +0000 (13:27 -0500)
committerEdward Delaporte <delaport@illinois.edu>
Mon, 2 Oct 2023 18:27:46 +0000 (13:27 -0500)
files/Microsoft.PowerShell_profile.ps1

index 3cbce8b66be0f43090e899dc4a344936f5f751b3..d868417ce490dfa11123cba4ac06b7887af4ea13 100644 (file)
@@ -58,11 +58,14 @@ if($IsWindows){
 if($modPaths.length -eq 0){
        Write-Host "No modules found."
 }
 if($modPaths.length -eq 0){
        Write-Host "No modules found."
 }
+$enabledMods = 'dash.psm1','docker.psm1';
 $modPaths | ForEach-Object {
        $fileName = $_.FullName
 $modPaths | ForEach-Object {
        $fileName = $_.FullName
-       if($filename -Like "*.psm1") {
-               Import-Module $fileName
-               Write-Host ">> Loaded $fileName"
+       if($enabledModules -Contains $_.Name ){
+               if($filename -Like "*.psm1") {
+                       Import-Module $fileName
+                       Write-Host ">> Loaded $fileName"
+               }
        }
 }
 
        }
 }