Giter Site home page Giter Site logo

disco0 / pscode Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wtjones/pscode

0.0 0.0 0.0 17 KB

PSCode launches VS Code in a PowerShell context to avoid the limitations of cmd.exe and UNC paths. The familiar code command is aliased.

Home Page: https://www.powershellgallery.com/packages/PSCode

License: MIT License

PowerShell 100.00%

pscode's Introduction

PSCode

Overview

VS Code currently uses code.cmd for shell duties. The drawback is this issue, related to the limitations of cmd.exe and UNC paths.

PSCode aliases the familar code to run a cmdlet that launches the editor in a powershell context. The behavior of code.cmd is maintained (as of 1.19.1).

Usage

Step 1: Installation

Install-Module -Name PSCode

Via GitHub (PowerShell v3+ required)

Clone or download this repo to $env:homepath\documents\WindowsPowerShell\Modules

Step 2: Load the module

Import-Module PSCode

I suggest putting this line in your $PROFILE

Launch VS Code

Do exactly as before:

code somefile.txt

Try it from a network path:

code \\MyNas\docs

Other features

In addition, Resolve-Path is used to allow for wildcards and Array/Object inputs:

code *.txt
$files = (Get-Item *.txt)
code $files

Optional

If using a portable install of VS Code, specify the folder when loading the module:

import-module PSCode -ArgumentList 'D:\downloads\VSCode-win32-1.11.2'

pscode's People

Contributors

wtjones avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.