Multi-threaded Debugging in Visual Studio Code - powershell

I've been working on a Powershell script that was handed to me. Never having dealt with powershell scritps before, I have a lot to learn. I have been using Visual Studio Code to run/debug it up until this point. It has been working well however, I'm running into an issue in a particular area that deals with multiple threads. I am unable to pause the Powershell script on specific breakpoints.
After looking all over the past couple of days and it seems that threading is something that can be worked on within Visual Studio. I downloaded Visual Studio Community 2019 and have tried to install the "Powershell Tools for Visual Studio" suite. According to the package manager, it has installed without issue. However, I am unable to create a Powershell project (which I should be able to do) and I cannot see it within the extension manager in Visual Studio 2019. To make sure it wasn't an error on my part, I've attempted the installation several different times and with different methods.
I've also looked at Windows built-in Powershell ISE for debugging but run into the same issue that Visual Studio Code has. This is rendering me unable to properly debug in the specific spots that I need to looking at. I have used Write-Host throughout most of the script however, as this is a script that was handed to me, I'd much rather be able to pause and look at all variables in a given state without having to print them all.
Is there any way to easily debug multi-threaded apps within Visual Studio Code? If there isn't, what would be some recommendations besides adding Write-Host,Write-Debug or similar cmdlets.

You are confusing tools and use case and this is due to your misunderstanding of PowerShell and the tools to deal with that, and that would be expected if you've never done this before.
If you have no PowerShell experience, its best to get ramped up first. Jumping into a tool for a language you've never used or understand is not prudent. Jump on Youtube and search for 'Beginning PowerShell' and view some of those before moving any further.
This is not a PowerShell code issue, which is what we are here to help with.
Your question is 'How do I configure VSCode and/or Visual Studio for Powershell development?, and thus off-topic for StackOverflow, and more a question for SuperUsers or StackExchange.
How do I ask a good question? - Help Center - Stack Overflow
Yet since you are here and I use this addon, let me provide some edification.
VSCode has an extension from Microsoft for PowerShell development, but that is just the Microsoft PowerShell extension.
The PowerShell Pro Tools for Visual Studio /VSCode is not a free tool and not from Microsoft. You have to pay for it to enable all
its features. You only need one copy/license of PowerShell Pro Tools
to use in Visual Studio/VSCode.
PowerShell Pro Tools Suite
https://ironmansoftware.com/powershell-pro-tools
PowerShell Pro Tools
PowerShell Pro Tools adds script packaging, a Windows Form Designer,
code conversion and a Universal Dashboard previewer to VS Code.
PowerShell Pro Tools provides Visual Studio integration through
the PowerShell Tools for Visual Studio. The Visual Studio integration
provides the following features. Packaging as executables including
command line utilities and services Windows Forms Designer WPF
Designer Integration Code Conversion
You can view how to use the tool buy view the docs from Ironman software the author of the product or on Youtube. Just search for it.
'powershell pro tools for VSCode'
'powershell pro tools for vscode projects'
'powershell pro tools for Visual Studio'
'powershell pro tools for visual studio projects'

I know this is relatively old, but it is worth noting if this shows in future search results. What VSCode can do, vs what you can do with PowerShell in VSCode.
I have done multithread in C# with VS Code debugging, but I am not aware of a good process for this in PowerShell. I assume that this is a question of support by the extension, but also the complication, of the various ways that PowerShell avoids or hides literal threading.
PowerShell abstracts async different than other languages.
Jobs can be threads, or process
Events may trigger and queue into the primary thread
Runspaces are whole environments on another thread, which can interact with each other.
Someone may be able to give a better summary on these, but "It is complicated"

I've decided the answer to this is no...
It should be as easy as put the breakpoint, hit the breakpoint, until ms supports this, its way behind any other decent scripting language. I'm thinking to unthread my application to make my life easier which is pretty sad state of affairs. Might try spinning up full visual studio to see if its better first.

Related

Windows Media Player Plugin Development in Windows 10 (Visual Studio 2019)

I'm looking to create a very simple UI plugin for Windows Media Player, similar to this: https://obsproject.com/forum/resources/windows-media-player-title-artist-text-output-ticker.402/, but with the ability to choose the path and name of the text file.
I haven't been able to find any answers to WMP Plugin development questions on here since 2013, and the last actual answer give was for Visual Studio 2008. I'm now using Visual Studio 2019, so almost all of the tutorials, guides, and FAQs are massively out of date.
I've been following the setup guide here: https://learn.microsoft.com/en-us/previous-versions//aa969437(v=vs.85)?redirectedfrom=MSDN
After a few hours, I've finally been able to install the Windows 7.1 SDK by deleting all my C++ 2010 redistributables, and temporarily rolling back my .NET Framework 4 version to RTM. I now have wmpwiz.ico, wmpwiz.vsdir, and wmpwiz.vsz.
The interal version of VS2019 is 16.0, so I've edited my wmpwiz.vsz file to read:
VSWIZARD 7.0
Wizard=VsWizard.16.0
Param="WIZARD_NAME = Windows Media Player Plug-in Wizard"
Param="ABSOLUTE_PATH = C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\WMP\Wizards\wmpwiz"
Param="FALLBACK_LCID = 1033"
and I've placed the three files into %UserProfile%\Documents\Visual Studio 2019\Templates\ProjectTemplates\Visual C++ Project\, but nothing shows up in the Start New Project window.
Obviously, I'm using technology that hasn't been touched for over a decade, so I don't know if this approach will even work anymore. Are there any modern guides on how to do this, or would it be quicker and easier to try to dig out my old VS2005 install disks, and hope they're not too scratched?
If this SDK Sample has been depreciated with age, are there any other wizards available that can be used for WMP plugin development? Preferably using C#, as I'm a .NET programmer, but I'm happy to trawl through C++ if I absolutely have to.
Thanks for any help you can give.

Target users of Visual Studio Code?

I've been developing on Visual Studio, and here comes Visual Studio Code which is described as a source code editor that supports multiple platforms. For me, I find it promising considering it's a lightweight editor compared to Visual Studio.
Since Visual Studio Code is still a baby, is it safe to say as time passes by and this baby becomes mature, this will be the new Visual Studio considering it can run on multiple platform?
Does Visual Studio Code has a roadmap on the upcoming features?
Visual Studio Code will not replace the regular Visual Studio, if that's what you're asking. VSCode is intended to be a very lightweight, code-focused IDE. There are a plethora of features present in Visual Studio that I don't expect we'll ever see in VSCode simply because they are not within the scope of the project. For example, I don't think you'll ever see the designer in VSCode, which is something you would sorely miss if you were developing a WPF or WinForms application.
Right now VSCode seems to be mostly targeting web application developers using ASP.NET 5 and node.js.
As for what's ahead for VSCode, I'm not sure if a roadmap has been laid out anywhere but I do know that a plugin/extension system is in the works, along with ES6/7 support and a few other things.
If you want to follow the development of VSCode, check out their blog, Twitter, and UserVoice.

Is WinDbg still compatible with Windows XP?

I was looking for a debugger for Windows, other than GDB, which is freely accessible. I found WinDbg and it looks quite good so I wanted to give it a try. Now when I go to the MSDN page it offers to download the SDK for Windows 8. As this is a rather big package, I wonder if I can use this WinDbg version still for Windows XP?
Since my company still uses Windows XP for some time to come, I'm stuck with it for now. Is there another, free debugger which is user friendly?
I'm used to Visual Studio for debugging, which is quite nice. Currently I use Eclipse with GCC and GDB. GDB is good enough, but when I do some assembly I don't really like it, and all in all I don't find it very user friendly.
The latest WinDbg will work with Windows 2000 onwards and most commands work with Windows XP. There will be some that will only work with later versions, but these are documented in the included help file.
Just to ease your download pain, firstly there is the option to select what to download from MSDN, or you can just download the version you want here thanks to a kind person who is hosting the individual components.

navigation in redgate visual studio integration

Just installed redgate's VS integration for db development. Can't seem to navigate to procedures called from within other procedures (eg ctrl-click to get there).
This would seem a no brainer feature. Am I missing something?
Thanks
Tim
The edit windows do not have the same go-to capabilities as programming code (C#, VB) windows. I added an enhancement request to the Red Gate bug tracker.
Red Gate Software make a few distinct, separate extensions to the Visual Studio development environment for managing databases. SQL Connect is for source controlling databases, and SQL Prompt adds intellisense to database projects. If you can say which extension and how you believe it's supposed to behave, perhaps I can offer some advice.

Which is latest Business Desktop Deployment version?

I used Business Desktop Deployment (BDD) to build my project. Scripts are written in python. The BDD I am having doesn't support Visual Studio 2008.
Please tell me what is the latest version of BDD which supports VS2008
where I can get more info about Business Desktop Deployment?
BDD is a mini-methodology related to acceptance testing and TDD (it does stuff higher up, but this is probably what you're doing).
From your question, it looks like you've been writing BDD scenarios or unit examples in Python. Visual Studio isn't a great tool for writing Python in. If you want to carry on in Python, try Vim, or you might be able to get a Python plugin for Eclipse or IntelliJ.
If you want to use Visual Studio to program, use C# or F#. There are a couple of great BDD frameworks - SpecFlow or TickSpec - which can help you.
More information, including a list of tools, is available on the Wikipedia page on BDD.
Otherwise, please clarify your problem. It doesn't make huge sense in its current form!
Edit: Well, I learn something new every day. BDD also stands for "Business Desktop Deployment", and is a Microsoft product. Here's a page with an update suggesting you should use Microsoft Development Toolkit. Hope that points you in the right direction. I imagine the tool we've been using, click-once, does something similar.
You should probably know that few people seem to recognise BDD as meaning anything other than Behaviour Driven Development in software these days. I've heard Binary Decision Diagram as well; not often though. Good luck in your search.
There's an article here that might help you with Business Desktop Deployment (BDD) versions. It's dated March 2009 and says:
Microsoft Deployment Toolkit 2008 Update 1 replaces all prior versions of MDT and BDD. It provides additional support for new OS versions and deployment scenarios and is the upgrade path for users of earlier versions.
The article points to the MDT 2010 download page.