]> us-delaporte.pagekite.me Git - dotfiles.git/blobdiff - files/Microsoft.PowerShell_profile.ps1
Update to selectively load my PowerShell modules
[dotfiles.git] / 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"
+               }
        }
 }
 
        }
 }