-
Notifications
You must be signed in to change notification settings - Fork 510
Logpoints #1434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Looks like the feature for VSCode is here. @General-Gouda would you be able to give a small motivating example? |
I have started work on this but got side-tracked. We already support a form Logpoints way before VSCode added the concept. Take a look at the BTW this issue should probably be logged in https://github.com/powershell/powershelleditorservices since all the work needs to be done there. |
@rjmholt I do a lot of work with Active Directory and with Exchange Online. Many of the cmdlets do not return any console output and so I need to inject some sort of output to know what user I'm iterating through. Or, I will simply output the index number. Since VS Code doesn't (yet) support Write-Progress I could see where outputting the index number through logpoints would be helpful rather than killing kittens with a Write-Host or something. It would also keep the code cleaner. I don't always need output on a saved script. Sometimes I just want to know it worked the first time I wrote it and then save it for later. @rkeithhill I'll give tracepoints a try the next time I write a script like this. One point of feedback is that tracepoints appear to need more complex expressions. Is it possible to simply output a variable's value by typing in "$var" as the expression or does it have to be contained in a logic statement such as IF? |
Agreed, Keep in mind the trace points implementation is just using Implementing logpoints, will take an expression like this |
This is supported now 🎉 |
How does this work? I tried with the Examples folder DebugTest.ps1 file. I set up a Log Point message of |
It would appear that I used the wrong quotes 😅 Can you open an issue for supporting interpolation @rkeithhill? Or perhaps a PR 🙏 |
I'll do that tonight, if you can wait. |
Issue submitted #2654 |
I'll see if I can get a PR in here on my lunch break. |
Bah, should have submitted that issue to PSES. Can you move it or should we leave it where it is? |
PR submitted - PowerShell/PowerShellEditorServices#1270 |
It's ok where it is :) |
I did not see an open or closed issue related to the newer VS Code Logpoint feature so I thought I'd add one.
Having the ability to have specific log output to console without needing to write the code directly through the Logpoint functionality would be useful for debug purposes.
The text was updated successfully, but these errors were encountered: