Powershell Invoke-WebRequest with a cookie

Nice and quick post here, mainly so I remember when I need it again, this is a quick sample which shows how to make a web call from PowerShell including a cookie.

Most old methods will suggest using the WebClient object but the new (well newer than the WebClient) Invoke-WebRequest commandlet is a much nicer, in my opinion.

It takes a bit of fooling around to get this up and running so wanted to share.

Tagged ,

Streaming Sensor data from the Microsoft Band using Reactive Extensions and C#

Hi,

So I’ve recently been working on programming for the Microsoft Band. In particular looking at streaming sensor data back from the band in realtime to process on my Windows Phone phone and, depending on the data, push up to a cloud service.

Out of the box the Band SDK will give you a set of SensorManagers to which you can hook up .NET EventHandlers and then do what you will with the output.

However, working with streams of data in .NET using EventHandlers is a pain and there is a much nicer technology for dealing with streams -> Reactive Extensions. (It’s a pretty bit topic, if you haven’t heard of it I’d strongly recommend reading up and having a play.)

So I set about writing a little wrapper to take the input from the Band’s SensorManagers and create an IObservable stream of events.

This lets you do awesome stuff, like doing linq queries over the realtime data stream or time based operations, among other things.

Continue reading

Tagged ,

Appveyor, Github and Chocolatey: Automatically Build your project and publish updates to Chocolatey

So the aim here is to get the PowerGist project a nice CI process. I want to accept pull requests to the github repository and have these changes build, tested (future) and be published to Chocolatey for people to install/update.

Before I go on, if you haven’t used chocolatey, its a great tool similar to apt-get on linux for installing applications – have a look at it now, I’ll wait. Good, now that’s sorted lets crack on.

As this is a free time project, this CI process needs to be buttery smooth. There is nothing like a bit of friction (anywhere but mainly when releasing) to put you off doing an update, fixing a quick change or adding a feature. At the end of the day I want to write the code, accept a pull request or do a commit and have everything happen automagically.

There is one exception to this, I don’t want every build to release to Chocolatey, I want a release gate. When a build succeeds I want a versioned artifact to be created, I can then review this and click a big “Go” button, when happy, to push this to Chocolatey.

I’ve been looking at appveyor for a while now and this was the perfect project to take it for a spin, didn’t regret it – got exactly what I wanted.

So let’s get into it, first of all setup your Project:

Continue reading

Follow

Get every new post delivered to your Inbox.

Join 324 other followers