RamblingCookieMonster / PSDepend

PowerShell Dependency Handler
MIT License
285 stars 76 forks source link

Error for Noop dependency type on Linux due to case-sensitive file name #74

Closed kars7e closed 6 years ago

kars7e commented 6 years ago

When using on linux with PowerShell Core 6.0.1, I'm getting following error:

Get-PSDependScript : Could not find path '/root/.local/share/powershell/Modules/PSDepend/0.1.64/PSDependScripts/noop.ps1' for dependency Noop. Origin: noop.ps1
At /root/.local/share/powershell/Modules/PSDepend/0.1.64/Public/Invoke-DependencyScript.ps1:80 char:27
+         $DependencyDefs = Get-PSDependScript
+                           ~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-PSDependScript

This seems to be caused by the fact Noop dependency type is defined with lower case noop.ps1:

    Noop = @{
        Script = 'noop.ps1'
        Description = 'Display parameters that a depends script would receive. Use for testing and validation.'
    }

But the filename is with capital N:

$ ls PSDependScripts | grep -i noop
Noop.ps1
RamblingCookieMonster commented 6 years ago

hiyo! good catch!

If you have time, want to give it a shot with Script = 'Noop.ps1' and submit a quick PR if it works?

Cheers!