Friday, December 30, 2016

Working with git

I took the function I had from last week and got it into git for proper source control. Now you can always find it there and always the most up to date version.

You can find that particular scrip here: PowerShellGit/get-DellTagInfo.ps1

I am still working on this git thing, bear with me here.

Monday, December 26, 2016

Civ V

I play a lot of Civilization 5. I mean a lot.


I have a tendency to to restart a game if I do not like the starting position. I will spends hours restarting a game until I get the environment I want.
I have this horrible fantasy that they are each real worlds that I destroy each of them in an apocalypse right when their history began.
Muhahahahahah!

Monday, December 19, 2016

Starting early

I am going to try and get into the habit about posting often now. Why wait?

I wrote this today when I had to look up a bunch of warranty info for some Dell laptops at work. This is much easier than typing the service code into the webpage.
The formatting is currently VERY ugly, but I will work on rearranging the page to adjust and make it prettier. For now I have added #lineBreak at the end of every line so you can format it properly if you C&P.
Quick context

ps c:\ get-dellTagInfo (yourDellServiceTag#)

Pretty straight forward. You should be abel to add this to your $profile and use it, and/or use it in any scripts where you have a lot of service tag numbers. I may write that up and post it to here soon.
Let me know if you have an Qs!


function get-dellTagInfo {  #lineBreak
    param  ($svcTag) #lineBreak
    $url = "https://api.dell.com/support/v2/assetinfo/warranty/tags.xml?svctags=" + $svcTag + "&apikey=849e027f476027a394edd656eaef4842" #lineBreak
    Invoke-WebRequest -Uri $url | Select-Object -ExpandProperty content | Out-File .\"$svctag".dell.xml #lineBreak
    [xml]$xml = Get-Content .\"$svctag".dell.xml #lineBreak
    write-host "Service tag:" $xml.GetAssetWarrantyResponse.GetAssetWarrantyResult.Response.DellAsset.ServiceTag #lineBreak
    write-host "ShipDate:" $xml.GetAssetWarrantyResponse.GetAssetWarrantyResult.Response.DellAsset.ShipDate #lineBreak
    write-host "ModelInfo:" $xml.GetAssetWarrantyResponse.GetAssetWarrantyResult.Response.DellAsset.MachineDescription #lineBreak
    write-host "Warranty End Date:" $xml.GetAssetWarrantyResponse.GetAssetWarrantyResult.Response.DellAsset.Warranties.Warranty[1].EndDate #lineBreak
    write-host "Warranty Service Levels:"  #lineBreak
    write-host "-----" $xml.GetAssetWarrantyResponse.GetAssetWarrantyResult.Response.DellAsset.Warranties.Warranty[0].ServiceLevelDescription #lineBreak
    write-host "-----" $xml.GetAssetWarrantyResponse.GetAssetWarrantyResult.Response.DellAsset.Warranties.Warranty[1].ServiceLevelDescription #lineBreak
    write-host "-----" $xml.GetAssetWarrantyResponse.GetAssetWarrantyResult.Response.DellAsset.Warranties.Warranty[2].ServiceLevelDescription #lineBreak
    write-host "-----" $xml.GetAssetWarrantyResponse.GetAssetWarrantyResult.Response.DellAsset.Warranties.Warranty[3].ServiceLevelDescription #lineBreak
    write-host "-----" $xml.GetAssetWarrantyResponse.GetAssetWarrantyResult.Response.DellAsset.Warranties.Warranty[4].ServiceLevelDescription #lineBreak
    write-host "-----" $xml.GetAssetWarrantyResponse.GetAssetWarrantyResult.Response.DellAsset.Warranties.Warranty[5].ServiceLevelDescription #lineBreak
} #lineBreak

Friday, December 16, 2016

A few thoughts and some powershell

I am setting an early goal for 2017.
One hundred blog posts. That sounds a little daunting, but that is really only 2 a week. When I first started blogging (before it was called that) I did 3 a week for close to a year. Back then (in the mid to late 90s ) it was a much more manual process. I had to create an entire new page every time I updated it. None of this fancy stuff. Actually, I had a fancy tool called DreamWeaver that helped me write the code and manage the site.
But yeah... 3 posts a week. MWF. Then something happened... not sure what. I got married maybe?

So 100 posts in 2017. I hope to cover a few things, some personal, some professional, some silly.
On the professional side I will push some powershell. It has been my interest lately as I have been using it more and more at work. Since I am a silly manager my uses for it are a little different that my minions.I will try and get some of that stuff on here.

We'll see.