tkellogg / Jump-Location

Powershell `cd` that reads your mind
MIT License
467 stars 26 forks source link

Add support for reading config entries from Jump.Location.dll.config, minor cleanup #28

Closed chinhdo closed 9 years ago

chinhdo commented 9 years ago

This is related to jumpstat -scan addition. I added a config entry named "Jump.Location.Scan.MaxSubFolders" to App.Config but the the code didn't see that because DLLs don't have their own config file. My work around is based on this article: http://stackoverflow.com/questions/17960/powershell-app-config

tkellogg commented 9 years ago

Alright, this looks pretty solid and I think it's constructive change. Thanks again

chinhdo commented 9 years ago

Any issues with using WriteObject for informational messages? And WriteWarning (yellow text) for things like not being able to access a file while scanning?

WriteVerbose by default doesn't show up unless you have -verbose.

Thanks

vors commented 9 years ago

WriteObject send object to pipeline, so it's for cmdlet output and not for info message.

In general Write-Verbose is better then Write-Host, see Jeffry's post http://www.jsnover.com/blog/2013/12/07/write-host-considered-harmful/ In our example, cmdlet doesn't have intention to be used in automation scenarios. I didn't find Write-Host C# counterpart. So it's probably ok to leave Console.WriteLine() for messages.