EvotecIT / Testimo

Testimo is a PowerShell module for running health checks for Active Directory against a bunch of different tests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Loading configuration from a path to a json doesn't work

alexsmid opened this issue · comments

When loading a configuration file, as a path, it will always give the same error:
> Invoke-Testimo -Configuration "C:\Temp\testmio.json" [t][Forest] Loading configuratio failed. Skipping. [Informative] [Not JSON/Hashtable or syntax is incorrect.] [t][Forest] Using configuration provided by user [Informative] [Configuration loaded from ]

This is because in the "Import-TestimoConfiguration" function you reference to "$Object" two times where it should be "$Configuration":

} elseif ($Object -is [string]) { if (Test-Path -LiteralPath $Object) { $Option = 'File' $FileContent = Get-Content -LiteralPath $Configuration }

Should be:

} elseif ($Configuration-is [string]) { if (Test-Path -LiteralPath $Configuration) { $Option = 'File' $FileContent = Get-Content -LiteralPath $Configuration }

Thank you for noticing. Hope you can make PR's in future improving Testimo :-) I've fixed it now. I was copying/pasting from outside and forgot to change.

Published new version. Please test.