Huddled Masses
You can do more than breathe for free...
Browse: Home / PoshCode Updated for CTP3

PoshCode Updated for CTP3

By Joel 'Jaykul' Bennett on 24-Dec-2008

I’ve updated the PoshCode script module to support CTP3, and added a -limit parameter to the Get-PoshCode cmdlet so you can specify how many items you want retrieved in the case where there are a lot of matches for your search terms — by default the limit is 25.

Improvements to the underlying web search API

You’ve always been able to pass a LIST parameter to the API, and get more results by specifying a higher number. But it never worked with the “path” notation (until now).

That is, you used to be able to do:

  • http://poshcode.org/api1?q=start&list=10
  • http://poshcode.org/api1?q=start&list=100

To make the API a little easier to use I’ve enhanced it just now:

  1. You can now page the search results.
  2. You can use the word “limit” instead of “list”
  3. If you specify limit=0 (or list=0) I’ll give you everything I’ve got. Please use a little precaution about that, as it could be a LOT of data. I’d much rather you retrieve, say … 25, and then get the second page if you want more.
  1. You can use path notation.

So, you can use any of these URLs:

  • http://poshcode.org/api1/start/list/25/page/1
  • http://poshcode.org/api1/start/limit/25/page/2
  • http://poshcode.org/api1?q=start&list=25&page=3
  • http://poshcode.org/api1?q=start&limit=25&page=4

There are a lot of search results for “start” ... feel free to play with enhancing the PoshCode module, or incorporating this into your apps, etc.

[new] I should add that you don’t have to specify the limit or page number. By default you’ll get the first 10 items, which should be enough. :)

Similar Posts:

  • RFC: Information in PoshCode Module Manifests
  • Get-Command in PowerShell 3 (NOTE: CTP2 Bug causes module loading)
  • F.A.Q.: How do I Install a PowerShell Module
  • Working with multiple versions of PowerShell Modules
  • PowerShell Scripting Best Practices: Prefix A

Posted in Huddled | Tagged Advanced Functions, CTP3, Modules, PoshCode, PowerShell, PowerShell Functions

« Previous Next »

Lijit Search

Tags

.Net .Net 2008 Scripting Games Automation Bugs Design Development Funny Gadgets GeoShell GUI Huddled Masses Internet licensing Microsoft Modules My Software News Personal PInvoke Pipeline Politics PoshCode PoshConsole PowerBoots PowerShell PowerShell Functions PowerTips Rants Recommender Repository Scripting ShowUI Software Solutions Textile Tips User Group UserInterface WalkThrough WebHosting Windows 7 WordPress WPF Xml

About Huddled Masses

This is web site is dedicated to the musings of Joel Bennett (aka Jaykul) about technology, software, software development, the web, and the world.

Any resemblance of the views expressed and the views of my employer, my terminal, or the view out my window are purely coincidental. The resemblance between them and my own views is non-deterministic. The question of the existence of views in the absence of anyone to hold them is left as an exercise for the reader.

P.S.: I occasionally link to things I think are great. When I do, I occasionally find a "referral code" so I can make a little cash. I promise that I don't link to anything just because of that cash (I wouldn't cross the street for the amount of cash those links bring in, never mind write a whole blog post) ... but I do not promise that things I link to will stay great as time passes, nor that you will agree with me about their greatness!

Archives

  • April 2012
  • February 2012
  • January 2012
  • October 2011
  • August 2011
  • July 2011
  • June 2011
  • March 2011
  • February 2011
  • January 2011

Copyright © 2012 Joel Bennett.

Powered by WordPress and Hybrid.