Running PowerShell script on debugging project - powershell

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

Related

How to run Gtest in powershell with set debug environment

Currenlty I am using Visual Studio community edition and Gtest.
When I run my test using the Visual Studio debug, my test are running fine
But when I build the solution and run my test fail.
Is there a way I can pass the PATH environment to the command I am runnig?
Try to set the PATH on powershell so it would load while running the command.
Thanks to #273k I was able to solve my problem.
The reason this test did not pass on the command line, was due to this was being run on a different folder.
Once I moved the relevant support files in the same folder the test started to pass

Launching Visual Code .net debugger from 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.

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.

Global variables and sessions in Developer Studio

Now it starts a session for each file you run. Is there any way to run two files using the same session (and the same global variables) in Eclipse Progress Developer Studio 3.7 (without one file running the other)?
Yes I know global variables should be avoided but that's not the topic.
You can start the Procedure Editor from Developer Studio by clicking the highlighted button.
The Procedure Editor will contain the currently active file from Eclipse. It is running in the progress process from Developer Studio that is used for compilation of the current project. So all files you start this way will be executed using the same process (as long as you do not restart the OpenEdge AVM).
In the Procedure Editor just hit F2 to execute the file. Note that this will only work for procedure files, not for classes.
There is an option in the run configuration to use the project avm instead of starting a new one.
That way subsequent runs will be in the same session.
You'll need to restart the avm to get rid of the context created by those runs
Only if you run it from the char or GUI client, and then it would still be:
run prog1.p.
run prog2.p.
so there's now way to do this w/out having a "stub" program which runs the two programs in sequence.

How do I run a windows installer via telnet using the trial version?

I'm evaluating install4j in our company.
We build a win32 installer and we are trying to set up a continuous integration environment to test it.
The CI server is able to upload the installer to the windows target machine (which is a virtualized environment) using FTP, and run batch script that looks like
cd c:\tmp\upload\
my_installer.exe -q -varfile response.varfile -console
Currently we're using the trial version of install4j 5.
When the installer is ran from the command line (cmd.exe over remote desktop) I get a popup window that warns about the trial version.
Installation is frozen until I click ok.
When the installer is ran from telnet the command just hangs and never returns. I believe the reason is that popup window.
To fully evaluate install4j we need to be able see how it fits our CI process.
Is there any workaround for this?
This is a restriction of the evaluation version, with a permanent license key the evaluation dialog will not be shown and the problem will go away.