PowerShell/PowerShell-Tests

Question about code fragment in ClearRecycleBin.Tests.ps1

megamorf opened this issue · 1 comments

In https://github.com/PowerShell/PowerShell-Tests/blob/master/Commands/Cmdlets/ClearRecycleBin.Tests.ps1 (83ec2c1) you have the following lines of code:

$currentDirectory = Split-Path -Parent $MyInvocation.MyCommand.Path
$helperModule = Join-Path $currentDirectory "ClearRecycleBinHelperFunctions.psm1"
if (-not $helperModule)
{
    throw "Helper module $helperModule is not available."
}
Import-Module $helperModule -Force

Here you're not testing if the path to ClearRecycleBinHelperFunctions.psm1 exists but only if the string in $helperModule is not empty/null. Why would you want to do that?

good catch