Giter Club home page Giter Club logo

psiseprojectexplorer's Introduction

Powershell ISE Addon - Project Explorer

Download

Description

Provides a tree view that enables to index and explore whole directory structure containing Powershell scripts. It has following features:

  • Visualize directory structure (also files not loaded to ISE yet) in a Solution Explorer-like tree view.
  • Show functions in leafs of the tree view and jump to the function definition (F12, similarly to some available Function Explorer plugins).
  • Search the tree view (file names, function names, optionally file contents).
  • File operations in tree view (context menu - add / rename / delete, drag&drop).
  • Find all occurrences of the text under the cursor (SHIFT+F12).
  • Locate current file in the tree view (ALT+SHIFT+L).
  • Close All But This tab (CTRL+ALT+W).
  • Automatic reindex on file system change.
  • Ask user to reload files on file system change (editor functionality missing in ISE).

Requires Powershell 3.0 or above.

If you find it useful, see any bugs or have any suggestions for improvements feel free to add an issue or comment at the project home page.

Screenshots

ScreenShot

Installation
  • Automatic - run Install_to_UserModules.bat
  • Manual:
  • Ensure all the files are unblocked (properties of the file / General)
  • Copy PSISEProjectExplorer to $env:USERPROFILE\Documents\WindowsPowerShell\Modules.
  • Launch PowerShell ISE.
  • Run 'Import-Module PsISEProjectExplorer'.
  • If you want it to be loaded automatically when ISE starts, add the line above to your ISE profile (see $profile).
Usage

When you open a Powershell file in ISE, Project Explorer will automatically set its project root directory to the last parent directory of the opened file where any .ps*1 file resides.

You can also select the root directory manually (by clicking 'Change' button) and ensure it doesn't update automatically (by unselecting 'Auto-update root dir' checkbox).

Why?

Because I work on complex Powershell modules with lots of functions, and navigating between them in ISE is painful. I wasn't able to find an ISE plugin that could search through whole directory structure, without requiring the user to load the files into the ISE first. Also, I was missing 'Go to Definition' and 'Find all references' features from Visual Studio and 'Locate in Solution Explorer' from Resharper.

Implementation details

Written in C#, .NET 4.5, WPF using Microsoft Visual Studio Express 2012 for Desktop.

Uses three background threads:

  • One for indexing directory structure and file contents. Indexes are stored in RAM only (not stored on disk), so they need full refresh after closing Powershell ISE.
  • Second one for searching the indexes.
  • Third one for listening on file system changes (checking for accumulated changes each 100 ms).

Uses a configuration file PsISEProjectExplorer.config stored next to PsISEProjectExplorer.dll ($env:USERPROFILE\Documents\WindowsPowerShell\Modules\PsISEProjectExplorer). Currently it contains only the last state of the UI.

To modify keyboard shortcuts, edit PsISEProjectExplorer.psm1 file.

How to build
  • Open PsISEProjectExplorer.sln.
  • Select 'Release' configuration.
  • Build Solution (F7).

It will create output in bin\Release directory.

How to debug
  • Ensure you don't have PsISEProjectExplorer module in your profile directory (see Debug_LoadToIse.bat).
  • Open PsISEProjectExplorer.sln.
  • Select 'Debug' configuration.
  • Start Debugging (F5). It will run Powershell ISE with Debug_LoadToIse.ps1 opened.
  • Run Debug_LoadToIse.ps1 in Powershell ISE (F5). It will start PsISEProjectExplorer in debug mode.
Third party libraries

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.