From: Edward Delaporte Date: Mon, 2 Oct 2023 18:27:46 +0000 (-0500) Subject: Update to selectively load my PowerShell modules X-Git-Url: https://apps.delaporte.us/gitweb/dotfiles.git/commitdiff_plain/5feb38522112978b8eee9c1bddc28a92a00094bd Update to selectively load my PowerShell modules --- diff --git a/files/Microsoft.PowerShell_profile.ps1 b/files/Microsoft.PowerShell_profile.ps1 index 3cbce8b..d868417 100644 --- a/files/Microsoft.PowerShell_profile.ps1 +++ b/files/Microsoft.PowerShell_profile.ps1 @@ -58,11 +58,14 @@ if($IsWindows){ if($modPaths.length -eq 0){ Write-Host "No modules found." } +$enabledMods = 'dash.psm1','docker.psm1'; $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" + } } }