vscode-powershell | Provides PowerShell language and debugging support | Command Line Interface library

 by   PowerShell TypeScript Version: v2023.6.0 License: MIT

kandi X-RAY | vscode-powershell Summary

kandi X-RAY | vscode-powershell Summary

vscode-powershell is a TypeScript library typically used in Utilities, Command Line Interface, Visual Studio Code applications. vscode-powershell has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

This extension provides rich PowerShell language support for Visual Studio Code (VS Code). Now you can write and debug PowerShell scripts using the excellent IDE-like interface that Visual Studio Code provides. This extension is powered by the PowerShell language server, PowerShell Editor Services. This leverages the Language Server Protocol where PowerShellEditorServices is the server and vscode-powershell is the client. Also included in this extension is the PowerShell ISE theme for Visual Studio Code. It is not activated by default, but after installing this extension either click "Set Color Theme" or use the theme picker and select "PowerShell ISE" for a fun and familiar experience.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              vscode-powershell has a medium active ecosystem.
              It has 1557 star(s) with 493 fork(s). There are 110 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 311 open issues and 2311 have been closed. On average issues are closed in 455 days. There are 3 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of vscode-powershell is v2023.6.0

            kandi-Quality Quality

              vscode-powershell has 0 bugs and 0 code smells.

            kandi-Security Security

              vscode-powershell has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              vscode-powershell code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              vscode-powershell is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              vscode-powershell releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              It has 385 lines of code, 0 functions and 46 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of vscode-powershell
            Get all kandi verified functions for this library.

            vscode-powershell Key Features

            No Key Features are available at this moment for vscode-powershell.

            vscode-powershell Examples and Code Snippets

            No Code Snippets are available at this moment for vscode-powershell.

            Community Discussions

            QUESTION

            In Powershell: ToLower() works, in VSC/Powershell not?
            Asked 2021-Mar-09 at 11:40

            I have win10 Pro and Powershell 5.1 On the other hand VSC(1.54.1) with the powershell extention (ms-vscode-powershell, v2021.2.2).

            The command

            ...

            ANSWER

            Answered 2021-Mar-09 at 11:40

            $dayName.ToString().ToLower() should do what you expect here (according to your comment).

            .ToLower() is a string method and you are trying to use it on System.DayOfWeek, which doesn't have that method.

            In order to keep track of your variables and just what they are, running $myVariable.GetType().FullName can be very handy - I use it all the time.

            In your example, running

            Source https://stackoverflow.com/questions/66545766

            QUESTION

            VS Code PowerShell keeps opening cmdlet external help unexpectedly
            Asked 2020-Nov-25 at 14:50

            I'm having a very weird problem in VS Code. When writing PowerShell, very often in the middle of typing a cmdlet name, VS Code will open the cmdlet's help page in my browser, stealing focus from VS Code and putting it in my browser. This also often occurs when I hover my mouse over a cmdlet (without clicking any buttons).

            Things I've tried:

            • Resetting all custom key bindings and settings. The problem still occurs, so I don't think those are at fault.
            • Disabling all extensions. This fixes the problem, but then of course I lose out on intellisense and whatnot since the PowerShell extension is disabled.
            • Disabling all extensions except for the PowerShell extension. The problem then occurs again.
            • Installing the PowerShell Preview extension and disabling all extensions except for it. The problem still occurs.
            • Spinning up a new Windows Sandbox and installing VS Code in there, and then turning on VS Code Settings Sync and having it pull down all of my same extensions, settings, key bindings, etc. Cannot reproduce the problem in Windows Sandbox.
            • Uninstall and reinstall VS Code. The problem still occurs.

            I have a feeling that the issue is somehow tied to the PowerShell intellisense, since the help window typically opens when the intellisense / tooltip window would normally appear. Also, the issue does not happen every time I type a cmdlet or hover the mouse over a function, but pretty close; probably around 30% of the time, which makes me think there may be some kind or race condition or something involved as well.

            Here's a gif of the problem in action. Note the only keys I type on the keyboard are Test and I never click the mouse when hovering over the Get-ChildItem cmdlet.

            I've been having the issue for about a month now, and I don't recall it being tied to a particular version update or anything. I'm using VS Code 1.51.1 on Windows 10 with the PowerShell extension v2020.6.0.

            Any thoughts or suggestions would be appreciated. Thanks!

            Edit: I've also logged this as a GitHub issue with the VS Code PowerShell extension here.

            ...

            ANSWER

            Answered 2020-Nov-25 at 14:50

            Ok, I figured the issue out myself. Following the advice of this tweet I updated my PowerShell Profile to include $PSDefaultParameterValues.Add("Get-Help:Online", $true). It looks like the PowerShell extension calls the Get-Help cmdlet in order to populate intellisense and tooltips. This was resulting in the intellisense and tooltips launching the help in an external browser window. The solution was to remove the line from my PowerShell Profile.

            I tracked down the repo where the bug is actually occurring and reported the issue there, and opened a pull request to fix it, so it should be fixed in future versions of VS Code once they take the change :)

            Source https://stackoverflow.com/questions/64957934

            QUESTION

            VSCode overrides PowerShell ExecutionPolicy
            Asked 2020-Apr-14 at 13:13

            When using Get-ExecutionPolicy -list within VSCode for PowerShell v5 x64 & x86 it returns the following:

            ...

            ANSWER

            Answered 2020-Apr-14 at 13:13

            The PowerShell extension for Visual Code respects the persistent execution policy settings[1] of whatever PowerShell version / edition it is configured to use (see this answer); to manage these settings, use Set-ExecutionPolicy from the respective version / edition.

            • For instance, to persistently set the policy for the current user to RemoteSigned, run
              Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned

            If you want to override the persistently configured policy in Visual Studio Code, add a Set-ExecutionPolicy command to the $PROFILE file as used by the PowerShell extension:

            • From the PowerShell Integrated Console, execute psedit $PROFILE to open the file for editing.
            • Add Set-ExecutionPolicy -Scope Process RemoteSigned to the file.

            As for your question:

            Since HKEY_CLASSES_ROOT is a composite view of HKEY_CURRENT_USER\Software\Classes and HKEY_LOCAL_MACHINE\Software\Classes, there is only one entry in this case, which you can access with either key path.

            This entry, however, does not control the persistent execution policies for Windows PowerShell; instead, it is a convenience context-menu command definition that allows you to execute a *.ps1 file directly from File Explorer or the desktop. As a security feature, the command ensures that the execution policy in effect for the process being created only (-Scope Process) is at least as restrictive as RemoteSigned.

            [1] Optional reading: Where PowerShell editions store their (non-GPO) persistent execution-policy settings:

            The following applies to Windows only, because execution policies are fundamentally unsupported on Unix-like platforms.

            Note:

            • As shown in you question, execute Get-ExecutionPolicy -List lists all the policies in effect across scopes:

              • Settings in more specific scopes - if defined - take precedence; that is, the most specific scope that doesn't state Undefined is the one in effect for the process at hand.

              • Group policies (GPO-based settings) - i.e., scopes UserPolicy and MachinePolicy, which cannot be set with Set-ExecutionPolicy - can override the CurrentUser, LocalMachine, and Process scopes; notably, this means that even ad-hoc attempts to override the execution policy via -Scope Process Bypass / the -ExecutionPolicy Bypass CLI parameter may be prevented.

            • You should use Set-ExecutionPolicy to change the persistent settings rather than modifying these locations directly.

            PowerShell [Core] (version 6 or higher) stores the settings in .json files:

            • Current-user policy (Scope -CurrentUser; file may not exist):

              • "$([Environment]::GetFolderPath('MyDocuments'))/powershell/powershell.config.json"
            • Machine policy (Scope -LocalMachine):

              • "$PSHOME\powershell.config.json"
              • Note that the filename root is powershell, even though the actual executable filename root is pwsh:

            Windows PowerShell (version up to 5.1) stores the settings in the registry (keys won't exist, if you've never run Set-ExecutionPolicy or if you run Set-ExecutionPolicy to set a scope's policy to Undefined):

            • Current-user policy (-Scope CurrentUser): HKCU:\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell, value ExecutionPolicy

              • Both the 32-bit and the 64-bit PowerShell executables see the same value, because there are no bit-ness-specific hives for HKCU (HKEY_CURRENT_USERS).
            • Machine policy (-Scope LocalMachine): HKLM:\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell, value ExecutionPolicy

              • Caveat: The 32-bit and the 64-bit executables see distinct values, because 32-bit applications have a separate HKEY_LOCAL_MACHINE\Software hive.

            Source https://stackoverflow.com/questions/61182855

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install vscode-powershell

            If you're on Windows 7 or greater with the PowerShellGet module installed, you can easily install both Visual Studio Code and the PowerShell extension by running the following command:. You will need to accept the prompts that appear if this is your first time running the Install-Script command.

            Support

            This extension provides rich PowerShell language support for Visual Studio Code (VS Code). Now you can write and debug PowerShell scripts using the excellent IDE-like interface that Visual Studio Code provides. This extension is powered by the PowerShell language server, PowerShell Editor Services. This leverages the Language Server Protocol where PowerShellEditorServices is the server and vscode-powershell is the client. Also included in this extension is the PowerShell ISE theme for Visual Studio Code. It is not activated by default, but after installing this extension either click "Set Color Theme" or use the theme picker and select "PowerShell ISE" for a fun and familiar experience.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/PowerShell/vscode-powershell.git

          • CLI

            gh repo clone PowerShell/vscode-powershell

          • sshUrl

            git@github.com:PowerShell/vscode-powershell.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular Command Line Interface Libraries

            ohmyzsh

            by ohmyzsh

            terminal

            by microsoft

            thefuck

            by nvbn

            fzf

            by junegunn

            hyper

            by vercel

            Try Top Libraries by PowerShell

            PowerShell

            by PowerShellC#

            PSReadLine

            by PowerShellC#

            PSScriptAnalyzer

            by PowerShellC#

            platyPS

            by PowerShellC#

            GraphicalTools

            by PowerShellC#