Setting up Visual Studio Code for PowerShell Development

  Рет қаралды 121,099

Trevor Sullivan

Trevor Sullivan

Күн бұрын

Пікірлер: 76
@elitehaxxor8025
@elitehaxxor8025 2 жыл бұрын
Thank you for the amazing video. I've always used PowerShell Studio and wanted to make a change and you made that extremely easy. I also love the inclusion of the script analyser because, not sure if it's just me, but I absolutely hate coming across shared code that has aliases or shortended names for parameters.
@seangraylin
@seangraylin 3 жыл бұрын
okay so this settings.json file does not show up for me at all and I do not know why. I keep getting this error message "PowerShell does not support debugging this file type: '/Users/sean/Desktop/Test.psd1'."
@seangraylin
@seangraylin 3 жыл бұрын
​@@TrevorSullivan I am not sure how else you would run the code other than pressing F5 or the run arrow. When I press F1 a search dialogue box appears and not really sure what you mean by command pallete. I seem to be getting different results for instance when you created the folder you get a settings windows with settings.json which is not something I am seeing at all. sorry if this is stupid I am not a coder but an administrator and I am just looking for a better way to look at and manage PS scripts without opening up a VM with windows to run PS ISE.
@fredflintstone505
@fredflintstone505 Жыл бұрын
Your instructions for setting up an older version of PowerShell (5.1) with the latest VSCode (1.76.2) does not work. Any change on updated instructions?
@utilars
@utilars 4 ай бұрын
How do we setup PowerShell Extension for VSCode to use the Powershell version that comes preinstalled in MS Windows?
@TrevorSullivan
@TrevorSullivan 4 ай бұрын
@@utilars check out the VScode settings for the extension. There's a property you can set that specifies paths to different PowerShell executables on your system
@shaundbritto3471
@shaundbritto3471 Жыл бұрын
i dont know if you still upload videos, i just have one request, whenever i am working on a react project and the terminal is listening to a port, the terminal works for 3 to 4 minutes and terminates with exit code 2, how to resolve, no solution found on google
@TrevorSullivan
@TrevorSullivan Жыл бұрын
Hey there, have you tried replicating this behavior on another system? Have you filed a bug report with the appropriate GitHub repository?
@shaundbritto3471
@shaundbritto3471 Жыл бұрын
@@TrevorSullivan everytime time i run js file on a port, the terminal works for 2 minutes and then The terminal process "C:\Program Files\PowerShell\7\pwsh.exe" terminated with exit code: 2148734499. This error appears, i have tried on cmd prompt, powershell all the terminals abruptly shut
@tompaget83
@tompaget83 2 жыл бұрын
Trevor, you're AWESOME! This video is so very useful!
@thomasmartin9232
@thomasmartin9232 5 жыл бұрын
How do I pass in command line parameters in Visual Code to debug a PowerShell application?
@AndyHelsby
@AndyHelsby 7 жыл бұрын
Great tutorial - Completely new to vscode here so these tweaks are very handy. The format brace on new line doesn't seem to work for me though - the formatting is working as it automatically puts the space between the ) and { in the code but doesn't drop the { to the new line. Small detail and the rest of the tips will come in handy so thanks.
@daviwil
@daviwil 7 жыл бұрын
Slight correction on "powerShell.startAutomatically": that setting is used to disable automatic startup of PowerShell Editor Services when a PowerShell file is opened. Some users requested this to shorten startup time when browsing PowerShell files in short-lived VS Code windows. Great video, thanks Trevor!
@daviwil
@daviwil 7 жыл бұрын
No problem! The setting's name is a little confusing, so I blame it on myself :)
@daviesmotivation8864
@daviesmotivation8864 4 жыл бұрын
sorry for late asking. i'm new here. i wanna ask why if i download something in vcs, don't have reload button. please help me.
@chamaco7500
@chamaco7500 6 жыл бұрын
When attempting to start the integrated Terminal in OSX I get an err: terminal process terminated with exit code: 64 I tried to use the directory of: "/usr/local/bin/powershell" but there's no powershell "executable" in this directory. I ran powershell from my MAC and found that it loads from : "/usr/local/microsoft/powershell/6.0.1/pwsh " but when I use this path I get the error
@cyborgdc5017
@cyborgdc5017 6 жыл бұрын
I get the same error. Have you found a solution to this problem?
@mikekim6966
@mikekim6966 6 жыл бұрын
Hi Trevor, this is really helpful. Just like invoking PS command from editor by F8 and stay focus on the editor, is there a similar way to do it in git bash shell terminal. I have a file containing a list of shell command and would like to execute one command at a time and see the execution in the bash terminal. How do I do that? Basically, i would like to run current line in the active terminal(bash). Thanks. Solved: There is a command that I created a shortcut : terminal run the selected text in active terminal..
@oliawak
@oliawak 4 жыл бұрын
Hello Trevor, can you do a tutorial on how to connect to office 365 services? I’m getting a WSMan error in vscode on macOS. Thank you!
@simonberg5694
@simonberg5694 4 жыл бұрын
Hi Trevor Great video! I used this video as reference for my first try out of VS Code for Powershell. But in time the VSCode settings has changed, and i found that the AutoIndent settings has changed and is reliable of an formatter, with containing rules for AutoIndent regarding Powershell formatting guidelines. Have you stumpled on the same issue and might have an solution? Best Regards Simon Berg
@simonberg5694
@simonberg5694 4 жыл бұрын
Hey Trevor After starting using the VS code i found this setting "editor.autoIndent": "True" And it worked like a charm and the FormatOnSave or FormatOnTrue triggered, the formatting and the AutoIndent kicked in, when i was writing my powershell documents. So my indentation was working like a charm whenever i startet writing som code wrapped with brackets. But many updates for VS Code has arrived since, and suddenly it stopped working and now i have to set "editor.autoIndent": to one of these "Advanced, Brackets, Full, Keep or None" but neither works. Then i googled and some bloggers mentions the AutoIndent formatting rules is now dependent og the specific formatter. VS Code expects the formatter is known about the specific document code language AutoIndent rules. But i dont think Microsoft included these rules in ex. the "ms-vscode.powershell" formatter. Maybe you have seen this problem before? [settings.json] "workbench.colorTheme": "Default Dark+", "powershell.integratedConsole.focusConsoleOnExecute": false, "powershell.integratedConsole.showOnStartup": false, "powershell.enableProfileLoading": false, "powershell.codeFormatting.newLineAfterCloseBrace": true, "powershell.codeFormatting.openBraceOnSameLine": false, "powershell.codeFormatting.whitespaceAroundOperator": true, "editor.defaultFormatter": "ms-vscode.powershell", "editor.tabCompletion": "on", "editor.autoIndent": "full", "editor.formatOnSave": true, "editor.formatOnType": true, "git.enableSmartCommit": true, "git.confirmSync": false, "git.autofetch": true, "powershell.scriptAnalysis.enable": true
@GosuHub
@GosuHub 4 жыл бұрын
6:27 how do i know the path to powershell ? please answer
@jasonthurston799
@jasonthurston799 6 жыл бұрын
VS Code lacks some nice features of ISE. 1. In the terminal I'd like to be able to start typing parameters and have it show me a menu of available parameters. 2. I'd like to have something like the two green arrow buttons in ISE for running all code in the buffer or just select code. F8 is hard to reach accurately in the dark . 3. Not and ISE feature but since VSCode has tasks, I don't seem to be able to get a task to run against my active terminal so the task can prepare/affect my environment.
@elmuziko
@elmuziko 7 жыл бұрын
I myself am an ISE veteran, only given the size of the scripts I've wrote and the small changes I keep making I'm wanting to move to something that tracks changes. I've read a lot of docs and this is coming up trumps every time. Whilst it looks good, and I immediately feel at ease writing code - I can't for the life of me figure out how to run it? You know like in ISE you just hit the green run button? If I highlight everything and press F8 I get : Executable script code found in signature block., and the internet is being less than helpful in solving. Am I being a total jackass or is it meant to be this difficult?
@elmuziko
@elmuziko 7 жыл бұрын
Thanks for the swift response Trevor. My execution policy is unrestricted. If I hit F8 on, say, New-Item c:\test.txt -itemtype file It works fine. If I do: Test-Path C:\test.txt It works fine. If I do: IF ( ( Test-Path C:\test.txt ) -eq $FALSE ) { "No file" } Then this is when I get the error: Executable script code found in signature block I won't cry if I can't get it to work, it's just a shame because the idea of version control on my scripts would be heavenly. Quite frankly I'm surprised half of them still work given the sheer size and rubbish coding of them all!!!
@RandomTorok
@RandomTorok 5 жыл бұрын
I'm with you Graham, F8 will run a selection but I want to run an entire script. I've got a script that works fine from the ISE but when I load it into VS Code I can't figure out how to run the entire script. Can someone please explain how to do a simple thing like run a script.
@issiewizzie
@issiewizzie 7 жыл бұрын
whats the diff between visual studio code for mac and visual studio for mac
@NirHason
@NirHason 7 жыл бұрын
Thank you for the video! really informative. When I mouse right-click on the script document I have the open of "Run code" (can be done also by clicking on the play button on the top right corner) it's just running the script to the 'output' window and it shows "[Running] powershell -ExecutionPolicy ByPass . . . " But it's just stays like that forever. my code includes some 'Read-Host' cmdlet so it won't ask for any input or anything. Why is that? we can't use the 'run code' option for Powershell?
@NirHason
@NirHason 7 жыл бұрын
tnx for the answer :)
@MSMgamer190
@MSMgamer190 6 жыл бұрын
Thanks Trevor you've helped increase my productivity. very helpful tutorial!!
@pranjalpagaria322
@pranjalpagaria322 4 жыл бұрын
can you help me with this problem kzbin.info/www/bejne/faWxnpagrZ2daNE in visual studio not getting sollution
@outworkthework
@outworkthework 6 жыл бұрын
Good solid video with useful tips. So my next question is there a way to insert all of your suggestions into a script or update a ini file so we can repackage the msi with them already incorporated for less experienced developers?
@karlstenator
@karlstenator 3 жыл бұрын
Great video, thanks for sharing. I can now use Powershell via VS Code. 🏆
@baref0ot455
@baref0ot455 5 жыл бұрын
Is Visual Studio Code different from Visual Studio? I use VS 2019. Thanks guys
@baref0ot455
@baref0ot455 5 жыл бұрын
Trevor Sullivan Already ahead of you I downloaded and right out the box (since I already had Node JS installed) it works great. Been at for about 4 hours lol
@TH4445
@TH4445 5 жыл бұрын
Thanks for the video but... the current version of VScode editor is 1.32.3 There have been changes. Also I,m not sure about the extensions . I say this because of experience. Trevor could you please make a video on setting up VSC on windows for Html and CSS with the current version. Thanks.
@martinwhite7340
@martinwhite7340 6 жыл бұрын
Might help others having trouble getting the integrated terminal to work in OSX: "terminal.integrated.shell.osx": "/usr/local/bin/pwsh", "terminal.integrated.shellArgs.osx": []
@olpner
@olpner 6 жыл бұрын
Martin white solved my problems. Cheers mate!
@jamescontreras6323
@jamescontreras6323 5 жыл бұрын
THANK you, should have read all of these comments for this :O
@dastushar8539
@dastushar8539 6 жыл бұрын
how to run powershelgl as an adminstrator
@snap-off5383
@snap-off5383 3 жыл бұрын
I don't get why powershell isn't natively supported in Visual Studio Community.
@Vern.Anderson
@Vern.Anderson 7 жыл бұрын
Thank you! I'm glad some one finally made a tutorial for this. Any way to make VS code make good use of multiple monitors like ISE can? For example the console would take up one monitor and the editor the other.
@daviwil
@daviwil 7 жыл бұрын
At the moment there's no way to split panes from VS Code out of the single window. In the future you may see horizontal layout of the window so that the console can be on the right side rather than the bottom, but I doubt it will ever be detachable. However, we might be able to launch an external console using the PowerShell extension.
@Vern.Anderson
@Vern.Anderson 7 жыл бұрын
David, thank you. Yea detachable is not necessary for me personally, I just meant the capability to SPAN multiple monitors. In my case just 2 monitors. Thanks for taking time out to reply.
@wolfrackham
@wolfrackham 7 жыл бұрын
Spanning monitors would be a most welcome feature. I use my monitors in portrait mode so having the terminal being able to support this would be great.
@ItzV85100
@ItzV85100 5 жыл бұрын
Nice, clear and well explained. very useful. thanks a lot (y) :)
@HappyYankeeFan
@HappyYankeeFan 7 жыл бұрын
Great job as always, Trevor!
@pranjalpagaria322
@pranjalpagaria322 4 жыл бұрын
can you help me with this problem kzbin.info/www/bejne/faWxnpagrZ2daNE in visual studio not getting sollution
@dsfarag
@dsfarag 7 жыл бұрын
Great video, very well laid out and explained.
@Macadoof
@Macadoof 7 жыл бұрын
Absolutely fantastic video, great presentation. Thank you. Subbed!
@will0282
@will0282 5 жыл бұрын
Awesome vid. Keep up the good work.
@AdrianMoseley
@AdrianMoseley 6 жыл бұрын
Very useful. Thanks for this.
@MarkFugel
@MarkFugel 5 жыл бұрын
Yet another great video that is packed with some nice Visual Code goodies...especially for powershell. Quick question...i am trying to run AWS commands and so am running core...i think. My settings point to C:\\Program Files\\PowerShell\\6\\pwsh.exe but when i try to run Get-AWSPowerShellLambdaTemplate i get an error that i am running 5.1 and i need 6.0 powrshell
@bsbs1841
@bsbs1841 6 жыл бұрын
Awesome. Thanks for the vid!!!
@delphi88
@delphi88 7 жыл бұрын
Thx a lot. Also thx for good voice quality.
@LettersByPooja
@LettersByPooja 2 жыл бұрын
Thanks Travel, this was super useful to me. I have a query: the formatter did not work for me on the fly. It asked me to install the formatter and took to the extension section with search string "category:formatters powershell" and none of the results match with powershell. Any way I can bring the formatter rightly? My VS code version is 1.67.1
@akshay2012rdts
@akshay2012rdts 4 жыл бұрын
Good Video. Thanks man
@mtbcyclist
@mtbcyclist 7 жыл бұрын
Great video! Thanks!
@howardwalowitz3600
@howardwalowitz3600 7 жыл бұрын
very helpful! thank you!
@marcelo1302
@marcelo1302 5 жыл бұрын
Cool video, bro!
@AyanMullick
@AyanMullick 6 жыл бұрын
Thanks for the video
@yilgullive
@yilgullive 6 жыл бұрын
Cant realy focus on the content with u swinging that claw
@diogosilva9492
@diogosilva9492 Жыл бұрын
slayermusiq1? is that you?
@boolgeriyi1286
@boolgeriyi1286 5 жыл бұрын
Where the FUCK is the PowerShell extension located on Windows?? If you say this is a guide for both Windows and MacOS then tell us what to do too!
@Whitecat2304
@Whitecat2304 4 жыл бұрын
You look like David Warner
@bobkrang5007
@bobkrang5007 2 жыл бұрын
Be careful!!! This video is 5 years old (out of date) and the presenter is using a MAC and not Windows 10!!!
@gangu74
@gangu74 6 жыл бұрын
Thanks A Lot
@systemm1157
@systemm1157 5 жыл бұрын
hi guys....
@nickryansanjuan4727
@nickryansanjuan4727 2 жыл бұрын
noice o.o
@RedHairGildarts
@RedHairGildarts 3 жыл бұрын
in kitchen?
@oliawak
@oliawak 4 жыл бұрын
Very useful thanks!
@anycaroliny9209
@anycaroliny9209 4 жыл бұрын
Very useful, thank u!
How to Crack Software (Reverse Engineering)
16:16
Eric Parker
Рет қаралды 795 М.
Как Ходили родители в ШКОЛУ!
0:49
Family Box
Рет қаралды 2,3 МЛН
УНО Реверс в Амонг Ас : игра на выбывание
0:19
Фани Хани
Рет қаралды 1,3 МЛН
Advanced PowerShell Module Development with Visual Studio Code - David Wilson
59:25
PowerShell Conference EU
Рет қаралды 13 М.
I Redesigned the ENTIRE YouTube UI from Scratch
19:10
Juxtopposed
Рет қаралды 792 М.
Microsoft FINALLY killed it
6:45
Alex Ziskind
Рет қаралды 680 М.
Why Linux Is Better For Programming
13:32
Hallden
Рет қаралды 2,8 МЛН
Optimizing Visual Studio Code for Powershell Development
51:26
PowerShell.org
Рет қаралды 15 М.
PowerShell 7 Tutorials for Beginners : Fundamentals
30:25
JackedProgrammer
Рет қаралды 107 М.
7 Amazing CLI Tools You Need To Try
18:10
Josean Martinez
Рет қаралды 411 М.
PowerShell Master Class - PowerShell Scripting
33:42
John Savill's Technical Training
Рет қаралды 110 М.
Windows PowerShell vs PowerShell Core - What Is It?
11:19
ThioJoe
Рет қаралды 94 М.