Skip to content

beefarino/simplex

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 

Build status

Module ZipDownload Module Zip

Simplex

A powershell module used to create powershell providers using a simple DSL.

Example Usage

This example assumes the following Simplex script file is available at c:\share\mydrive.ps1:

Simplex Script

root {
   folder MyFolder {
       script MyEnvironment -id key {
           dir env:
	   }
	   script MyModules -id guid {
			get-module
	   }
   }
}

PowerShell Session

import-module simplex
new-psdrive s -psprovider simplex -root "c:\share\mydrive.ps1"
cd s:\myfolder\mymodules
dir

Simplex DSL

The provider DSL consists of three elements:

  • root - used to define the root of the drive tree; the root may contain any number of folder and/or script elements
  • folder - used to define simple named containers on the drive; the folder may contain any number of folder and/or script elements
  • script - used to define a named collection of items; the script element uses a PowerShell script to return the items it contains; you can specify a property name use as the child name of the item

Example: Canonical Drive

root {
   folder MyFolder {
       script MyEnvironment -id key {
           dir env:
	   }
	   script MyModules -id guid {
			get-module
	   }
   }
}

Example: Generated Drive Content

root {
   folder System {
       script Processes -id id {
           get-process
	   }

	   script Errors -id index {
	       get-eventlog -log application -eventtype error -newest 50
	   }
   }

   folder Generated {
	   0..9 | foreach-object {
           $content = $_;
	       script "Generated$_" {
		       $content
		   }.GetNewClosure();
	   }
	}
}

About

A powershell module used to create powershell providers using a simple DSL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published