flancy icon indicating copy to clipboard operation
flancy copied to clipboard

Support for OData Queries

Open adamdriscoll opened this issue 9 years ago • 0 comments

It would be super awesome to support OData filtering\sorting\paging. There is a Nancy extension to do it but it creates LINQ queries which might not be one-to-one to PowerShell but we might be able to use the OData query parsing capabilities as a starting point.

https://github.com/adamhathcock/Nancy.OData https://bitbucket.org/jjrdk/linq2rest

The endpoint would just be:

@{
Path='/process'
Method='Get';
Script={
Get-Process
}
}

Then we could do cool stuff like:

Invoke-WebRequest http://localhost:8000/process?$filter=Name -eq 'PowerShell'

It would automatically do something like:

Get-Process | Where Name -eq 'PowerShell' 

adamdriscoll avatar Nov 03 '15 22:11 adamdriscoll