TechProsaic

I write about great software, Internet technology, cool gadgets, and The Next Big Thing.

May 8th, 2008

Usability–what’s that?

Earlier today I clicked on a link to go to some intranet app.  I forgot about it and came back later.  I filled in my user ID and password then clicked login.  Here’s the message I received:

HTTP Status 408 - The time allowed for the login process has been exceeded. If you wish to continue you must either click back twice and re-click the link you requested or close and re-open your browser

I’m sorry, but that’s about the dumbest thing I’ve seen in a couple of weeks.  Please, people!  If you have to instruct your users to “click back twice” or “close and re-open your browser”, then you are doing it wrong!  Computers are supposed to work for us, not the other way around.

Jeez!

May 4th, 2008

How to Automate iTunes and iPod Synchronization Using PowerShell

Music Powershell

I realized lately that one thing I do every day before I leave the office is to ensure that my iPod has been sync’d recently.  It’s a major bummer to get into the car only to realize that the latest “The Guild” or “Totally Rad Show” is sitting on my computer and completely inaccessible during the long drive home.

I decided to create a scheduled task which will sync my iPod around 3:50 PM, so it’ll be ready to go when I am.  These instructions were made on a Windows XP box, the same thing applies on Vista but the steps to do it will be slightly different.  Here’s how you do it:

  1. Go to your Control Panel, Scheduled Tasks, then click on Add Scheduled Task.
    image
  2. Click Next, then Browse.
    image
  3. imageType this into the Open File dialog box and hit enter:
    %windir%\system32\windowspowershell\v1.0\powershell.exe
  4. Name the task “Sync iPod” or something like that, choose an interval (such as daily) and hit Next.
     
  5. Choose a time of day for the task to execute, and hit Next.
  6. Supply your credentials so that the task can run even when you are not logged in but your PC is on.
  7. Check the box labelled “Open Advaned Properties” and then Finish.
  8. imageClick in the Run field and hit the End key.  You should see “powershell.exe” then your cursor.  Hit the space bar, then paste in the following text, all on one line:

    -noprofile -command &{ write-host ‘Synchronizing iPod’; (New-Object -ComObject iTunes.application).UpdateIPod(); write-host ‘Sync complete!’; start-sleep 5 }

  9. Finally, click Ok. 

 

 

image

 

Now, assuming your iPod was already plugged in and iTunes is running, your iPod is not syncing at the moment.  If it is, wait till its finished so that you can test the task.  If you didn’t forsee the above, go ahead and do that; we’ll all wait for you.

And we’re back.  Now simply go the Scheduled Tasks control panel applet again, right-click on the new task and choose Run.  Within a few moments you should see that iTunes has started synchronizing.  If it does not work for you, please leave a comment and hopefully we can figure it out.

April 25th, 2008

Live Mesh is pretty sweet!

Windows

image If you’ve been under a rock, Live Mesh is Microsoft’s latest foray into the cloud computing space.  So far it’s just a “tech preview” and feature-wise, it’s fairly limited.  Today, it’s basically FolderShare with a few extra features.

But if you read up on the Live Mesh blog, there is a ton of cool stuff in store.  It’s very visionary–hopefully that stuff lands here on Earth with us.  :)

If you need an invite, leave a comment on the blog.  Also, if you are interested in joining a little proof-of-concept file sharing group we have going right now for sharing PowerShell scripts, let me know.

P.S. Sorry I’m so light on blogging lately–Twitter has sorta caught my fancy lately and I’ve been writing more there.

April 4th, 2008

VMware + PowerGUI = Great Combo

Powershell

Check out this blog post by Carter @ VMware.  Great stuff!

The PowerGUI VMware PowerPack has lots of great features, including the ability to manage your ESX Hosts and VMs, as well as doing bulk operations. In my opinion, PowerGUI’s best feature is that as you interact with PowerGUI, it generates PowerShell code as you go. You can take this code and re-run it later or you can parameterize it and turn it into a script. This is especially great if you’re not a hard-core scripter, or if you aren’t very familiar with PowerShell.

image

Hmmph, can’t figure out how to make it connect to the server.  I tried making a script node with this snippet: Get-ViServer (read-host “Server Name”).  No luck.  Will mess more with it later.

April 1st, 2008

PowerShell Version 2 Released!

Powershell

According to the PowerShell Team Blog, Jeffrey Snover has announced the surprise release of PowerShell Version 2.  New features include:

  • Remoting - this is the ability to execute powershell statements on remote computers
  • Script Cmdlets - you can now make real cmdlets using only powershell script–no C# required!
  • Tons of new cmdlets for controlling popular web-services such as:
  • Out-Flickr
  • Get-OrkutProfile
  • Post-DelIcioUsBookmark
  • Find-Yahoo
  • Out-Digg
  • They finally fixed the WMI authentication bugs!
  • Now I find the most intriguing aspect of the new cmdlets is that it shows a strange confluence of Microsoft and Yahoo technologies.  Did MSFT play their hand too early?  I wonder if this means more than it appears…Watch the two stock prices today.

    Go download it now!  Here’s a screencast I did of the new stuff in action.

    March 24th, 2008

    PowerShell Haiku: How to Use Here Strings

    Powershell

       1: # My first PowerShell haiku
       2: $herestring = @”
       3: This is the best way
       4: when you want to span across
       5: multiple lines, dude.
       6: “@

    Hope this helps. :)

    March 24th, 2008

    Consistent Command-Line Interface: One More Reason to Like PowerShell

    Powershell

    I just have trouble believing that a currently developed OS (NetBSD for the record) still has this kind of opaqueness. This is a problem I will never have again when working in PowerShell!

    image

    On PowerShell all cmdlets have built-in help which can be accessed a variety of ways, the simplest of which is:

    cmdlet-name -?

    The more verbose versions include “help <cmdlet-name>”, and “get-help <cmdlet-name>” with increasingly higher levels of detail obtained by supplying parameters to Get-Help such as “-example”, “-detailed”, and “full”.

    March 18th, 2008

    PowerShell Tip: Line Continuation Characters

    Powershell

    Line continuation (and termination for that matter) characters are not required that often.

    • An open brace { , parenthesis ( , or square bracket [ will allow for continuation across multiple lines until the block is closed by the corresponding } ) ]
    • A trailing comma (the array operator) will allow for a line break until the next array member
    • Single and double-quotes will work as well, but I really don’t recommend doing so just because its unexpected and confusing to read the code. If you want to do this, instead use the “here string” feature and enclose your multi-line string with @” and “@

    So you can do this without a single line-continuation character (a trailing back-tick ` )

    function test {
      param (
        $firstname,
        $lastname
      )
      (get-process) [
        1
      ]
      write-host "$firstname
    $lastname" # don't do this, or kittens will die
    }

    March 15th, 2008

    VMware PowerShell Toolkit Open Beta

    Powershell

    At long last, VMware has released their PowerShell toolkit to the public.  You can grab it at this convenient URL (love it when companies do that):

    http://vmware.com/go/powershell

    There is already an official forum online for the toolkit which those in the closed beta were already participating.  That means there’s already some content in there for new users.  It’s a great place to ask questions. 

    The toolkit is still beta, and the documentation is unfinished.  But what’s in there now is really cool and very stable.  I believe it is covered by VMware Support already so you can actually open a support case if you run into trouble, if you have a support contract.  Below is a list of the scope of the cmdlets included.  Instead of waste 102 lines of text I’ve grouped them by verb and noun for clarity.

       1: 76# Get-Command -PSSnapin v* | group verb | ft count,name -auto
       2:  
       3: Count Name
       4: —– —-
       5:     1 Add
       6:     1 Dismount
       7:     2 Find
       8:    28 Get
       9:     1 Load
      10:     1 Mount
      11:     7 Move
      12:    16 New
      13:    17 Remove
      14:     1 Restart
      15:     1 Save
      16:    18 Set
      17:     1 Shutdown
      18:     1 Start
      19:     2 Stop
      20:     2 Suspend
      21:     1 Update
      22:     1 Wait
      23:  
      24: 77# Get-Command -PSSnapin v* | group noun | ft count,name -auto
      25:  
      26: Count Name
      27: —– —-
      28:     5 VMHost
      29:     3 Tools
      30:     1 EntityView
      31:     1 EntityViews
      32:     4 CDDrive
      33:     5 Cluster
      34:     5 Datacenter
      35:     4 Datastore
      36:     1 Event
      37:     4 FloppyDrive
      38:     5 Folder
      39:     3 HardDisk
      40:     3 Inventory
      41:     1 Log
      42:     1 LogType
      43:     4 NetworkAdapter
      44:     4 OSCustomizationSpec
      45:     5 ResourcePool
      46:     4 Snapshot
      47:     1 Stat
      48:     3 Task
      49:     4 Template
      50:     1 View
      51:     1 Views
      52:     4 VirtualSwitch
      53:     1 VIServer
      54:     1 VIToolkitVersion
      55:     8 VM
      56:     4 VMGuest
      57:     2 VMHostNetwork
      58:     1 VMHostStorage
      59:     2 Session
      60:     3 CustomField
      61:     3 VMHostNetworkAdapter

    Supposedly there was going to be a PSDrive provider as well but I don’t see it anywhere.  Maybe it’ll turn up.  :)

    March 14th, 2008

    So, I’m Writing A Book

    Powershell

    No, seriously!  I’ve never written anything longer than a lengthy blog post or maybe a two-page email.  Now’s my chance to shatter that record.  Anybody who knows me has heard me say before that I have zero creativity.  Luckily, that’s not required when writing a technical manual.  :D  We’ll see how it goes. 

    Anyway, the book is to be published by Sapien Press.  I’m not saying when the book will be ready at this point because I have no clue how these things work.  I guess it is safe to say, “this year”.  Hopefully, well inside of that time period.  :)

    If you read my blog, you probably know my current passions are PowerShell and VMware.  Well, it should come as no surprise that the working book title is: Managing VMware Infrastructure with PowerShell: TFM.  I’m really excited about the project and I hope it turns out well.  And if nothing else it’ll be good fuel for a fire.  Win-win for everyone!

    Wish me luck, and may God grant my wife patience!

    Close
    E-mail It