• Stars
    star
    76
  • Rank 406,627 (Top 9 %)
  • Language
    C#
  • Created almost 10 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

LINQ (LINQ2Objects) for Powershell

#pslinq

LINQ for Powershell.

##Available cmdlets

The following cmdlets are available as of now:

Aggregate-List

All-List

Any-List

Except-List

First-List

Intersect-List

Repeat-List

SelectMany-List

Single-List

Skip-List

SkipWhile-List

Take-List

TakeWhile-List

Union-List

Zip-List

Based on MoreLinq:

TakeEvery-List

###Aggregate-List

Examples:

Sum:

1..10 | Aggregate-List { $input + $acc} -seed 10
#65

Product:

1..10 | Aggregate-List { $acc * $input } -seed 1

String reverse:

"abcdefg" -split '' | Aggregate-List { $input + $acc }
#gfedcba

###All-List

Examples:

1..10 | All-List { $input -le 6 }
#False

###Any-List

Examples:

1..10 | Any-List { $input -eq 5 }
#True

###Except-List

Examples:

1..10 | Except-List 1,3,5,7
#2
#4
#6
#8
#9
#10

###First-List

Examples:

1..10 | First-List { $input -eq 5 }
#5
1..10 | First-List { $input -eq 11 }
#Throws exception

###Intersect-List

Example:

1..10 | Intersect-List $(5..15)
#5
#6
#7
#8
#9
#10

###Repeat-List

Example:

1..3 | Repeat-List 2
#1
#1
#2
#2
#3
#3

###SelectMany-List

Example:

"abc", "def" | SelectMany-List { $input.ToCharArray() }
#a
#b
#c
#d
#e
#f

###Single-List

Example:

1..10 | Single-List { $input -eq 5 }
#5
1..10 | Single-List { $input -ge 5 }
#Throws exception
1..10 | Single-List { $input -eq 11 }
#Throws exception

###Skip-List

Example:

1..10 | Skip-List 6
#7
#8
#9
#10

###SkipWhile-List

Example:

1..10 | SkipWhile-List { $input -le 8 }
#9
#10

###Take-List

Example:

1..10 | Take-List 3
#1
#2
#3

1..10 | Skip-List 3 | Take-List 3
#4
#5
#6

###TakeWhile-List

Example:

1..10 | TakeWhile-List { $input -lt 4 }
#1
#2
#3

###Union-List

Example:

"a", "b", "c" | Union-List "c", "d"
#a
#b
#c
#d

###Zip-List

Example:

"a", "b", "c" | Zip-List $(1..4) { $first + $second }
#a1
#b2
#c3

"a", "b", "c" | Zip-List $(1..3) { $first * $second }
#a
#bb
#ccc

##Based on MoreLinq:

###TakeEvery-List

1..10 | TakeEvery-List 2
#2
#4
#6
#8
#10

More Repositories

1

cmd

C# library to run external programs in a simpler way. Demonstration of "dynamic" features of C#.
C#
352
star
2

YDeliver

YDeliver is a (opinionated) build and deployment framework aimed at .NET projects.
PowerShell
48
star
3

gocd-docker

Docker build, run and push task plugin for GoCD
Java
38
star
4

ebs-snapshot-lambda

AWS lambda function to snapshot EBS volumes and purge old snapshots.
JavaScript
36
star
5

posz

z implementation for Powershell
PowerShell
32
star
6

redditps

Reddit provider for Powershell
C#
21
star
7

Pit

A git repository provider for Powershell
C#
14
star
8

Todo.ps1

A todo.txt implementation for Powershell
PowerShell
14
star
9

poshmarks

Implementation of bashmarks for Powershell
PowerShell
12
star
10

Toggler

Feature Toggling library for .NET.
C#
10
star
11

gocd-powershell-runner

A Powershell Task runner for gocd (http://www.go.cd)
Java
10
star
12

django-ansible

Ansible repo for a Nginx-gunicorn-postgres based Django stack
Ruby
8
star
13

thepill

Decision Trees with Neo4J
Kotlin
7
star
14

tinymce-image-caption

A simple plugin to add caption to images in tinymce4
JavaScript
6
star
15

hubot-gocd

Hubot script to report build status from GoCD (http://www.go.cd/)
CoffeeScript
5
star
16

django_ci_example

Sample django project for setting up CI
Python
4
star
17

EventBase

A single page app for events and conferences
JavaScript
4
star
18

cdposh

Implementation of cdpath for Powershell
PowerShell
3
star
19

powershell-docker

Powershell in Docker
3
star
20

chennai-devops

Ruby
2
star
21

rails_ci_example

Sample Rails application for CI with TeamCity
Ruby
2
star
22

sketch-ui

A skin over Twitter Bootstrap for UX Designers
CSS
2
star
23

lumenz

Lumenz
JavaScript
1
star
24

loksabha

Web app to display information about Lok Sabha
JavaScript
1
star