From 54f9cb6687a7c99276eafa1473aa2683b360b8d1 Mon Sep 17 00:00:00 2001 From: Dave Hull Date: Sat, 24 May 2014 14:45:26 -0700 Subject: [PATCH] Fixed a bug where kansa.ps1 wouldn't properly handle a -ModulePath argument that pointed directly to a module. --- kansa.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kansa.ps1 b/kansa.ps1 index 2a36689e..de82d520 100644 --- a/kansa.ps1 +++ b/kansa.ps1 @@ -197,6 +197,10 @@ Param( Write-Debug "Entering $($MyInvocation.MyCommand)" Write-Debug "`$ModulePath is ${ModulePath}." $Modules = $FoundModules = @() + if (!(ls $ModulePath -ErrorAction SilentlyContinue).PSIsContainer) { + "`$ModulePath argument, ${ModulePath}, must be a directory." | Add-Content -Encoding $Encoding $ErrorLog + Exit-Script + } Try { $ModConf = $ModulePath + "\" + "Modules.conf" if (Test-Path($Modconf)) {