GithubHelp home page GithubHelp logo

isabella232 / ships Goto Github PK

View Code? Open in Web Editor NEW

This project forked from powershell/ships

0.0 0.0 0.0 327 KB

Simple Hierarchy in PowerShell - developing PowerShell provider got so much easier

License: MIT License

C# 64.26% PowerShell 34.66% Shell 1.08%

ships's Introduction

Simple Hierarchy in PowerShell (SHiPS)

A PowerShell provider allows any data store to be exposed like a file system as if it were a mounted drive. In other words, the data in your data store can be treated like files and directories so that a user can navigate data via cd or dir. SHiPS is a PowerShell provider. To be more precise it's a provider utility that simplifies developing PowerShell providers.

Build Status

Development branch

AppVeyor (Windows) Travis CI (Linux / macOS)
av-image-dev tv-image-dev

Master branch

AppVeyor (Windows) Travis CI (Linux / macOS)
av-image-master tv-image-master

Nightly run Master branch

AppVeyor (Windows)
av-image-master-n

Supported Platform

Downloading the Source Code

git clone https://github.com/PowerShell/SHiPS.git

Building the Source Code

cd <yourclonefolder>\SHiPS\src\
# get the dotnet CLI tool
# and Windows10 SDK if you are running on Windows
.\bootstrap.ps1

# build SHiPS
.\build.ps1 Release

Installing SHiPS

  • You can install SHiPS from the PowerShell Gallery
  • Install SHiPS' binaries which you just built on your box:
    # you need to launch PowerShell as Administrator
    cd <yourclonefolder>\SHiPS
    Import-Module .\tools\setup.psm1
    Install-SHiPS

Running Unit Tests

Import-Module .\tools\setup.psm1
Invoke-SHiPSTest

Try It Out

Let's take the FamilyTree module as our example here. Assuming you have done the above steps, i.e., git clone, build, and run Install-SHiPS, now try the following.

Import-Module SHiPS
Import-Module  .\samples\FamilyTree

# create a PowerShell drive.
new-psdrive -name Austin -psprovider SHiPS -root 'FamilyTree#Austin'
cd Austin:

dir
cd Ben
dir

The output looks like below.

PS Austin:\> dir
    Container: Microsoft.PowerShell.SHiPS\SHiPS::FamilyTree#Austin
Type       Name
----       ----
+          Ben
.          Bill

PS Austin:\> cd .\Ben\
PS Austin:\Ben> dir
    Container: Microsoft.PowerShell.SHiPS\SHiPS::FamilyTree#Austin

Type       Name
----       ----
.          Chris
.          Cathy

PS Austin:\Ben> dir | %{$_.Data}
Name  DOB  Gender
----  ---  ------
Chris 5034 M
Cathy 5050 F

In fact, we can create a drive at any level. Let's say we are interested in Ben only, we can do something like this:

new-psdrive -name son -psprovider SHiPS -root 'FamilyTree#Ben'
cd son:
dir

In addition, this can be useful for the isolated testing.

See more samples under sample folder to try out.

Get Started with Writing a PowerShell Provider

If you'd like to try out writing a SHiPS-based provider in PowerShell, we recommend reviewing the getting started documentation.

SHiPS Architecture

See here for design details.

FAQ

See known issues, FAQ, etc.

Developing and Contributing

Please follow the PowerShell Contribution Guide for how to contribute.

Legal and Licensing

SHiPS is under the MIT license.

ships's People

Contributors

jianyunt avatar glennsarti avatar jaykul avatar matt9ucci avatar hemantmahawar avatar bellali avatar maertendmsft avatar jzabroski avatar liampkemp avatar kvprasoon avatar wgross 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.