Launching Visual Code .net debugger from Powershell - powershell

I am looking for a way to launch the "Run and Debug" functionality of Visual Code from an externally running PowerShell (PS) script. My project has 19 separate APIs that sometimes all need to be started together. To facilitate local development I already have a PS script that updates all my local.settings.json files depending on which services are running locally and which database I am using. It would be nice and save time if I could somehow also "reach into" Visual Code and launch the services as well.
Searching the internal for solutions has been difficult because all queries having to do with "powershell" and "Visual Code" lead to discussion of writing PS in Visual Code.
Thanks for any suggestions / directions to look / notification that this is impossible.

Related

Is it possible to run code in Visual Studio Code without a shell?

My school has blocked cmd and Powershell due to security concerns. Unfortunately for me, this prevents VSC from running code! I love using VSC, so I'm wondering if there's any way I can continue to use it without the powershell or cmd terminals.

Is there a way to run a PowerShell script through a JetBrains IDE?

I am currently using RubyMine which is an IDE developed for the Ruby programming language. Although, strangely enough, I find myself executing a lot of PowerShell scripts - something that seems to fall outside the scope of this product.
With some tinkering, I managed to associate .ps1 files with PowerShell, as well as having the correct syntax highlighting, but I am short one piece of functionality. I would like to run my PowerShell scripts the same way I run my Ruby scripts; through the Run menu.
My question is essentially: Is there a way to have RubyMine run my PowerShell script in a new shell, without me having to manually copy/paste the code?

Visual Studio Code - Powershell - High CPU and Slow performance switching between Powershell files

I have a fresh installation of Visual Studio Code 1.16.1
I have the following extensions:
Chef Extension for Visual Studio Code 0.6.3
Code Outline 0.0.10
Powershell 1.4.3
Ruby 0.15.0
I try to edit Powershell within VSCode.
Powershell is loaded (Version 5.1)
But every time I switch between one of my open files (In the current test case, an psm1 and psd1) I see a little loading bar at the top of the Explorer sidebar, just below the Explorer text.
While that's going, I can't "Run Selection", Code Outline does not update nor do I have any form of syntax-assistance while writing code UNTIL it is done. Then all of the items you tried to do, happen all at once.
Until I switch windows, everything works as expected. The moment I switch files, it starts "loading/working" again and I have to wait about 30 seconds for it to do it's thing.
I have also tried disabling all extensions (except Powershell) and I see nearly the same behavior. When switching tabs, the loading happens but I don't see the loading bar in the explorer sidebar described above.
I currently do not have a different machine to test this on, working on getting a second machine to rule out the computer.
I am looking into logging a bug but before I do, I wanted to check here.

Running PowerShell script on debugging project

I have a C# project that relies on a few services. I've written a PowerShell script that checks if the services are running and starts them if they're not. I'm currently running the script manually, but it would be better if I could configure Visual Studio to run the script every time I start debugging the project.
I experimented with using the post-build events, but that only works (obviously) when the project has been changed and needs to be rebuilt. If there is a solution that allows me to run the PowerShell script regardless of whether the project is being rebuilt, that would be excellent.
I had a similar requirement. This is what i did:
Installed the powershell tools from the Visual Studio 2013 gallery
Added a project to the solution of the (newly installed) Powershell Project type
Added a Powershell script to start the services (in my case a Redis Server)
Added this project to the solution "set startup projects" (right-click on the Solution Explorer top level solution node) using the multiple startup projects setting

Check out files modified outside VS from TFS

If a file is modified in Visual Studio, the files are automatically checked out from Team Foundation Server. However, sometimes there are files not modified in VS, is there command to check out those modified files only?
If you download the Team Foundation Server power tools, you can use the "tfpt online" command line.
That said, I would try and avoid this way of working. TFS much prefers to know about files that you are checking out before you start editing them and your interaction with TFS will be much happier if you can do this.
The same power tools can optionally install Windows Explorer integration for TFS which will allow you to check the files out easily outside of Visual Studio.