Sometimes you just gotta kick it old school!

Kicking it 8-bit this morning!  Wicky Wicky Old School!

Happy Monday Everyone!

Powershell and HP ILO

Today on the job I was tasked with attempting to rewrite some old VBS scripts that pull information from our HP Server Ilo’s.  I did some thinking about how I wanted to approach this and then headed to the interwebs.  A short GOOGLE search later and I found exactly what I was looking for.

Thank you Mike @ Practical Kung Fu Dot Net for the great post!

http://www.practicalkungfu.net/2011/04/using-powershell-to-get-info-out-of-hp.html

Updating Facebook from Powershell!!

I was perusing my Twitter feed the other day and I noticed something interesting, a link to a codeplex project for Powershell Facebook cmdlets.  I headed over to the codeplex page and grabbed them. http://facebookpsmodule.codeplex.com/ Ater downloading the module and installing it I took a quick look under the hood.  John_msft did all the heaving lifting on these cmdlets and did a great job with documentation!

The first thing of note is that according to the documentation the commands currently have to be run through the Powershell ISE.  This is because the New-FBConnection function pops a window that authenticates you to the FB API.

In order to authenticate to the API you simply run the New-FBConnection command.

FBLogin

I noticed in the documentation for the Facebook cmdlets that the only Set or Add event was an Add-Event function that allows the user to create a calendar event in Facebook.

I thought it would be pretty cool to be able to update my status from Powershell.

Let me know what you think 😮

–ScriptWarrior

So here goes… with a slight modification to the Add-Event function that John_MSFT included in the module we come to Set-FBStatus:

<pre>function Set-FBStatus
{

    Param(
        [string][Parameter(ValueFromPipelineByPropertyName=$true,Mandatory=$true)]$Message
        )
    process
    {

        Set-StrictMode -Version 2.0  #Force Version 2
        trap { "Error in Set-FBStatus: $_"; break }

       $parameters = new-object 'system.collections.generic.dictionary[string,object]'  #Create new object
       $parameters["message"] = $Message
       $parameters["access_token"] = $(Get-FBConnection).AccessToken
       $raw = $(Get-FBConnection).Post("me/feed", $parameters)   #Set FB Ojbect to the $raw variable
       Convert-FBJSON $raw   #Call the Convert-FBJSON function from the Facebook cmdlets to send update
    }
}

Set-FBStatus "GOD IS SOOO GOOD!  Praise him today."    #Actual Function Call</pre>

Happy Mothers Day!

What an amazing day.  We spent the morning Praising and Serving the Lord at Beaming Hope Church in St. Petersburg.  Then off to my beautiful Mother-In-Law’s house for an awesome family lunch and a relaxing afternoon.  Now some time for just me and my beautiful wife to enjoy the rest of our evening.

God Bless all you Mothers out there!  Especially those that are fighting for the freedom that we enjoy every day.  You are in our thoughts and prayers.

–ScriptWarrior