You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a user of standardized pipeline automation (same build on over 50 DSC repos), I want to be able to set my Integrated Terminal session when I open the repository (set the $Env:PSModulePath for that session to path within the workspace, and alert of missing required modules defined in a RequiredModules.psd1 file).
The only "missing" part here is that it's not running in the integrated terminal.
Even better would be to enable those tasks to be "Optionally Integrated within the VSCode PowerShell extension", so that we could run the same tasks either inside or outside the integrated terminal (useful to do validate a build/test run on a clean session).
We could imagine having powershell extension configurations in settings.json like so:
As a workaround, you could add code to your VSCode specific profile prompt {} function that, if you are in a directory that matches a particular pattern, to run that check and display the error at the console. You could then set a global variable so that it doesn't run it every time the prompt comes up, just upon first access.
Example (pseudocode, I didn't actually test this)
functionprompt {
if ($PWD-match'/my/projects/folder/.*'-and$PWD-notin$GLOBAL:MyAlreadyTestedFolders) {
build.ps1 -tasks noop $pwd#Your script at this point would issue write-warning for any issues$GLOBAL:MyAlreadyTestedFolders+=$PWD
}
#Prompt code goes here
}
@gaelcolas With the runup to PS7 it'd probably be a while before this got implemented especially because it may not be something the extension can do directly but requires some vscode-level changes (since the task json definition is defined there), so this would be a workaround in the meantime.
You can set a prompt from a script you could instruct your users to use, but that doesn't do you much better than just having them run your build script. I personally would not want a project executing arbitrary code on startup without my confirmation so there's a security aspect here that has to be carefully considered as well.
Summary of the new feature
As a user of standardized pipeline automation (same build on over 50 DSC repos), I want to be able to set my Integrated Terminal session when I open the repository (set the $Env:PSModulePath for that session to path within the workspace, and alert of missing required modules defined in a
RequiredModules.psd1
file).Proposed technical implementation details (optional)
This could be handled by a task, currently we're running
./build.ps1 -tasks noop
, but it shouldrunOn
when thefolderOpen
, IN the integrated terminal.The task looks like this:
The only "missing" part here is that it's not running in the integrated terminal.
Even better would be to enable those tasks to be "Optionally Integrated within the VSCode PowerShell extension", so that we could run the same tasks either inside or outside the integrated terminal (useful to do validate a build/test run on a clean session).
We could imagine having
powershell
extension configurations insettings.json
like so:The text was updated successfully, but these errors were encountered: