Closed abelal83 closed 8 months ago
Hi Abu, Thanks again for these suggestions, this is my first time writing a custom module with this large of a scope. So please keep the suggestions/best practices coming.
I went ahead and updated to 1.0.7 with this suggested change. Let me know if you think of anything else.
Thanks, Alex
For a first time module I commend you the brilliant work. Really is fantastic and by far the most feature rich Meraki module I've come across.
I attempted a pull request to help but I don't think the repo allows branching, so will keep suggestions coming as issues.
Thanks again for the quick turnaround!
I have this code custom function that wraps functions from Meraki module
When the function call to Invoke-MerakiNetworkClaimDevices fails it writes to host { "errors": [ "Device with serial Q3AC-xxxx-xxxx is already claimed and in tst03 (network ID: XXXX)", "Device with serial Q3AC-xxxxx-xxxx is already claimed and in tst03 (network ID: XXXX)" ] } As I also have Write-Warning $PSItem the error is written twice.
I can disable my messages with
$WarningPreference
but not possible at all with Write-Host.I propose all the Write-Host functions are replaced with Write-Debug allowing control of output with $DebugPreference variable. This has the benefit of error being captured and handled without polluting logs. In my example I handle it by removing devices and attempting again but errors fill up the logs.