TreeSizeHtml icon indicating copy to clipboard operation
TreeSizeHtml copied to clipboard

write-host issue when calling

Open cory-github opened this issue 12 years ago • 1 comments

Hi, Thanks for this work, this is a pretty cool script.

I was messing around with it a bit and trying to run it from an MSP tool "LabTech". It was giving me errors like "error cannot invoke this function because the current host does not implement it". After much searching around, I discovered that when apparently calling this from LabTech script the "write-host" lines were causing the problems. If I removed this and only put the string, it then seemed to work fine.

So for example:

write-host "test string" becomes "test string"

and then it didn't give the error. not sure if this would help at all, not sure if there's a way that can be checked how the script is run, or why this error happens, just what I found.

cory-github avatar Oct 16 '13 14:10 cory-github

Thanks Cory, I only just noticed you'd created this issue.

Glad to see you got it working and I'll investigate whether removing the write-host is a universally good solution

jamesweakley avatar Dec 05 '13 07:12 jamesweakley