Scott Hanselman

Windows Live Writer and DasBlog 1.9

August 13, '06 Comments [7] Posted in DasBlog
Sponsored By

Microsoft just released Windows Live Writer, an offline blogging editor tool.

It's beta, so there's a few bugs.

  • The first glaring one is that if you have a lot of categories on your blog, the categories dropdown goes forever and continues down past the toolbar.
  • Another irritating one is that only GIF and JPG show up in the file types list when adding an image to a post - um, PNG?
  • There's also no syntax highlighting or auto-formatting for the HTML view.

All in all, it looks a AWFUL lot like BlogJet, my preferred blog editor, down to the properties tab. The irony is, of course, that all these editors basically use the same DHTML Editing stuff built into IE or some flavor of it, so the actual editing experience will feel much the same.

Here's a list of other VERY good blog editors that I've used personally. I posted about a few last year as well, but John Forsythe has the complete list of ones that work well with DasBlog.

  • Zoundry is also a great blog writer that supports DasBlog swimmingly.
  • Rocketpost is nice, clean and lightweight and has some nice Photo effects.
  • WB Editor has a fresh and clean interface, but a smallish text editing area at low resolutions.

One important thing to note about Windows Live Writer (and Zoundry as well) is the support for RSD - Really Simple Discovery. Omar added this to the current source tree of DasBlog recently. This will be in DasBlog 1.9, but, as always, you can compile the source yourself and get it now.

RSD worked great during the setup phase with Windows Live Writer as seen in the screenshots below. The writer detected DasBlog's capabilities and API support and configured itself without asking me a single technical question. Nice.

Windows Live Writer also has an SDK for extending the application.

Here's my final thought - why would a Product Group that offers a blogging editor and has their own blog, ask users to go to an MSN Group to offer feedback?  Isn't that kind of not-bloggy?  Remember earlier in your post where it was said blogging was a two-way medium?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Hanselminutes Podcast 28 - Open Source Options

August 10, '06 Comments [7] Posted in Podcast
Sponsored By

My twenty-eighth Podcast is up. This episode is about the Open Source Community. This is a pretty open ended talk, as there really isn't an easy solution.

We're listed in the iTunes Podcast Directory, so I encourage you to subscribe with a single click (two in Firefox) with the button below. For those of you on slower connections there are lo-fi and torrent-based versions as well.

This show was FULL of links, so here they are again. They are also always on the show site. Do also remember the archives are always up and they have PDF Transcripts, a little known feature.

Links from the Show

Blog: Is Open Source A Crap Idea? (h73)
Open Source: Free as in "Free" (h77)
Free as in Beer (h7c)
Blog: Patching with CVS/Diff Files (h74)
Free like a Puppy (h79)
Open Source Licenses (h7d)
Blog: Patching an OS Project (h75)
The Free Software Definition (h7a)
Problems in OS Licensing (h7e)
Free Like a Flower (h76)
Categories of Free and Non-Free Software (h7b)
WP: There Ain't No Such Thing As A Free Lunch (h78)

Subscribe to my Podcast in iTunes

NEW COUPON CODE EXCLUSIVELY FOR HANSELMINUTES LISTENERS: The folks at XCeed are giving Hanselminutes listeners that is Coupon Code "hm-20-20." It'll work on their online shop or over the phone. This is an amazing deal, and I encourage you to check our their stuff. The coupon is good for 20% off any component or suite, with or without subscription, for 1 developer all the way up to a site license.

Our sponsors are XCeed, CodeSmith Tools, PeterBlum and the .NET Dev Journal. There's a $100 off CodeSmith coupon for Hanselminutes listeners - it's coupon code HM100. Spread the word, now's the time to buy.

As I've said before this show comes to you with the audio expertise and stewardship of Carl Franklin. The name comes from Travis Illig, but the goal of the show is simple. Avoid wasting the listener's time. (and make the commute less boring)

  • The basic MP3 feed is here, and the iPod friendly one is here. There's a number of other ways you can get it (streaming, straight download, etc) that are all up on the site just below the fold. I use iTunes, myself, to listen to most podcasts, but I also use FeedDemon and it's built in support.
  • Note that for now, because of bandwidth constraints, the feeds always have just the current show. If you want to get an old show (and because many Podcasting Clients aren't smart enough to not download the file more than once) you can always find them at http://www.hanselminutes.com.
  • I have, and will, also include the enclosures to this feed you're reading, so if you're already subscribed to ComputerZen and you're not interested in cluttering your life with another feed, you have the choice to get the 'cast as well.
  • If there's a topic you'd like to hear, perhaps one that is better spoken than presented on a blog, or a great tool you can't live without, contact me and I'll get it in the queue!

Enjoy. Who knows what'll happen in the next show?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Signing PowerShell Scripts

August 9, '06 Comments [4] Posted in PowerShell
Sponsored By

Geoff Bard at Corillian (we work together) wrote up a good tutorial on working/playing with Signed PowerShell scripts. He graciously agreed to let me reprint a linted version here:

Signing PowerShell Scripts

Execution Policies

PowerShell supports a concept called "execution policies" in order to help deliver a more secure command line administration experience.  Execution policies define the restrictions under which PowerShell loads files for execution and configuration.  The four execution policies are Restricted, AllSigned, RemoteSigned, and Unrestricted.

PowerShell is configured to run in its most secure mode by default.  This mode is the "Restricted" execution policy, in which PowerShell operates as an interactive shell only.  The modes are:  Restricted (default execution policy, does not run scripts, interactive only); AllSigned (runs scripts; all scripts and configuration files must be signed by a publisher that you trust; opens you to the risk of running signed (but malicious) scripts, after confirming that you trust the publisher); RemoteSigned (runs scripts; all scripts and configuration files downloaded from communication applications such as Microsoft Outlook, Internet Explorer, Outlook Express and Windows Messenger must be signed by a publisher that you trust; opens you to the risk of running malicious scripts not downloaded from these applications, without prompting); Unrestricted (runs scripts; all scripts and configuration files downloaded from communication applications such as Microsoft Outlook, Internet Explorer, Outlook Express and Windows Messenger run after confirming that you understand the file originated from the Internet; no digital signature is required; opens you to the risk of running unsigned, malicious scripts downloaded from these applications).

Changing Execution Policy

Run the following from a PowerShell prompt (AllSigned is an example):

Set-ExecutionPolicy AllSigned

This command requires administrator privileges.  Changes to the execution policy are recognized immediately.

Restricted Execution Policy

If you're reading this for the first time, PowerShell may have just displayed the error message as you tried to run a script:

The file C:\my_script.ps1 cannot be loaded. The execution of scripts is disabled on this system. Please see "Get-Help about_signing" for more details.

The default execution policy of PowerShell is called "Restricted."  In this mode, PowerShell operates as an interactive shell only.  It does not run scripts, and loads only configuration files signed by a publisher that you trust.

Environment

The AllSigned execution policy is best for production since it forces the requirement for digital signatures on all scripts and configuration files. 

Script Signing Background

Adding a digital signature to a script requires that it be signed with a code signing certificate.  Two types are suitable: those created by a certificate authority (such as Verisign etc.), and those created by a user (called a self-signed certificate).

If your scripts are specific to your internal use, you maybe able to self-sign. You can also buy a code signing certificate from another certificate authority if you like.

For a self-signed certificate, a designated computer is the authority that creates the certificate.  The benefits of self-signing include its zero cost as well as creation speed and convenience.  The drawback is that the certificate must be installed on every computer that will be running the scripts, since other computers will not trust the computer used to create the certificate.

To create a self-signed certificate, the makecert.exe program is required.  This is available as part of the Microsoft .NET Framework SDK or Microsoft Windows Platform SDK.  The latest is the .NET Framework 2.0 SDK  – after installing, makecert.exe is found in the "C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\" directory.

Viewing Certificates

Set up to view the Certificates by running mmc.exe and adding the Certificates snap-in:

Image001

Image002 

Image003

Setting Up a Self-Signed Certificate

Run the following from a Command Prompt.  It creates a local certificate authority for your computer:

makecert -n "CN=PowerShell Local Certificate Root" -a sha1 -eku 1.3.6.1.5.5.7.3.3 -r -sv root.pvk root.cer -ss Root -sr localMachine

You will be prompted for the private key:

Image004

Next you’ll be prompted for the private key you entered above:

Image005 

This will create the trusted root certificate authority:

Image006

 

Now run the following from a Command Prompt.  It generates a personal certificate from the above certificate authority:

makecert -pe -n "CN=PowerShell User" -ss MY -a sha1 -eku 1.3.6.1.5.5.7.3.3 -iv root.pvk -ic root.cer

You’ll be prompted for the private key:

Image007

There will now be a certificate in the Personal store:

Image008

After the above steps, verify from Powershell that the certificate was generated correctly:

PS C:\ > Get-ChildItem cert:\CurrentUser\My -codesign

Image009

You can now delete the two temporary files root.pvk and root.cer in your working directory.  The certificate info is stored with that of others, in "C:\Documents and Settings\[username]\Application Data\Microsoft\SystemCertificates\My\".

Signing a Script

To test the effectiveness of digitally signing a Powershell script, try it with a particular script “foo.ps1”:

PS C:\> Set-ExecutionPolicy AllSigned

PS C:\> .\foo.ps1

The file C:\foo.ps1 cannot be loaded. The file C:\foo.ps1 is not digitally signed. The script will not execute on the system. Please see "get-help about_signing" for more details..

At line:1 char:9
+ .\foo.ps1 <<<<

Now sign the script:

PS C:\> Set-AuthenticodeSignature c:\foo.ps1 @(Get-ChildItem cert:\CurrentUser\My -codesign)[0]

Directory: C:\

SignerCertificate                         Status             Path
-----------------                         ------             ----
A180F4B81AA81143AD2969114D26A2CC2D2AD65B  Valid              foo.ps1

This actually modifies the end of the script with a signature block.  For example, if the script consisted of the following commands:

param ( [string] $You = $(read-host "Enter your first name") )
write-host "$You so totally rocks"

After the script is signed, it looks like this:

param ( [string] $You = $(read-host "Enter your first name") )
write-host "$You so totally rocks"

# SIG # Begin signature block
# MIIEMwYJKoZIhvcNAQcCoIIEJDCCBCACAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR
# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQU6vQAn5sf2qIxQqwWUDwTZnJj
...snip...
# m5ugggI9MIICOTCCAaagAwIBAgIQyLeyGZcGA4ZOGqK7VF45GDAJBgUrDgMCHQUA
# Dxoj+2keS9sRR6XPl/ASs68LeF8o9cM=
# SIG # End signature block

Execute the script once again:

PS C:\> .\foo.ps1
Do you want to run software from this untrusted publisher?

The file C:\foo.ps1 is published by CN=PowerShell User. This publisher is not trusted on your system. Only run scripts from trusted publishers.

[V] Never run  [D] Do not run  [R] Run once  [A] Always run  [?] Help (default is "D"):

Answer "A" and the script proceeds to run, and runs without prompting thereafter.  A new certificate is also created in the Trusted Publishers container:

Image010

If the certificate is missing the script will fail.

Running Signed Scripts Elsewhere

PowerShell will be unable to validate a signed script on computers other than the one where it was signed.  Attempting to do so gives an error:

PS C:\ > .\foo.ps1
The file C:\foo.ps1 cannot be loaded. The signature of the certificate can not be verified.
At line:1 char:9
+ .\foo.ps1 <<<<

Signed scripts can be transported by exporting (from original computer) and importing (to the new computer) the Powershell certificates found in the Trusted Root Certification Authorities container.  Optionally, the Trusted Publishers can also be moved to prevent the first-time prompt.

From the Current User certificate store, go to the Trusted Root Certification Authorities container and locate the PowerShell Local Certificate Root certificate.  Right-click on it and click All Tasks, Export:

Image011

Click Next at the prompt:

Image012

Leave the format at the default DER and click Next:

Image013

Enter your desired path and name of the exported certificate, and click Next:

Image014

Click Finish and close out the wizard:

Image015

Login on the target machine as the user under which scripts will be running.  Open MMC and add the Certificates snap-in for the current user, locating the Trusted Root Certification Authorities container. 

Expand the container to find the Certificates store.  Right-click on it and select All Tasks, Import:

Image016

Click Next to continue:

Image017

Locate the certificate you exported earlier and click Next:

Image018

Leave the next step at its default and click Next:

Image019

Read the security warning and click Yes to install the certificate:

Image020

Your signed script should now run on the new computer.  Note that Powershell will prompt you the first time it’s run unless you also import the Trusted Publishers certificate.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Scott Hanselman: Developer Productivity Tools Video Part 4

August 4, '06 Comments [6] Posted in Programming | TechEd | Tools
Sponsored By

Scottvideo4When I was at TechEd I visited the Beantown.net INETA User Group and gave a (fairly ad-hoc) talk on Developer Productivity Tools. Jim Minatel loaned me his microphone and a copy of Camtasia and we recorded the talk. Thanks Jim!

It was a great crowd, a lot of fun. We had a number of "off the cuff" discussions about random stuff so I hope it doesn't take away from the gist of the talk.

The complete presentation was around 1 hour 45 minutes, so for online, Jim has split it into 4 segments. This week's final segment is #4 and is available now and is about 30 minutes long. If you watch it in your browser, I recommend you double click on Windows Media Player to make the video go full screen. You can also download the full video.

This episode covers mostly CodeRush and a number of questions are answered from the audience.

Here's a few notes about the video quality from Jim:

1. Why can't I fast forward or skip ahead through the video while it's streaming? Answer: We're running these off of a standard IIS server, not a Windows Media Server. IIS supports streaming, but not indexed playback during streaming to allow skipping ahead. If you want to do that, just download the whole video and all of the forwarding and timeline controls will be available in Windows Media Player.

2. Why isn't the video quality better? Is Camtasia to blame? No, Camtasia rocks. The raw videos I'm getting in Camtasia format are 100% clear, as if you were looking right at the presenter's monitor. The problem I've discovered is with the Windows Media Encoder. It just isn't well suited to on-screen presentation videos like this. The blurring and color blotching seems worst in Scott Hanselman's videos and I think I know why. When I watch the raw presentation, he's flying back and forth between open windows, background tools that pop up, and his desktop. It's just faster switching between very varied images than the encoder can seem to keep up with. I've twidled all the settings and got the best I can for now without doubling or tripling the file sizes. The other option would be to post an alternate version in Camtasia format and a link to download their playback codec [Scott: or a large FLV]. Because WMV is universal for my .NET developer audience, that has to be my common choice though.

There's also some other good screencasts up at Wrox. The growing list of videos is available at wrox.com. The first few videos in the series are:

If you want to download the files directly, do a SAVE AS on these links:

We'll be re-releasing them soon as reencoded high-quality Flash very soon, as well as one uber-large 2 hour Flash Video. I hope you enjoy them.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Replacing Start Run - The Quest Continues

August 4, '06 Comments [21] Posted in Reviews | Tools
Sponsored By

So many ways to launch programs. A good launcher doesn't just launch, it also auto-completes paths for you, starts your search engine or browser and generally saves you 15 minutes a day. No need to learn all the hotkeys like those Keyboard wonks who try to guilt you. Just learn ONE and make it do everything.

Given these offerings, if you open your Start Menu at all, at any point in the day, you're doing something wrong. Try them all, pick one, and save 15 min * 5 days * 52 weeks = 65 hours a year you'd have spent futzing around in your Start Menu*.

* These numbers came straight out of my butt.

  • Slickrun - still the sexy favorite, this little floating magic bar keeps me moving fast, launching programs, macros and explorer with it's shiny simplicity.
    Tell them I sent you. ;)
    Startrun1

 

  • SmartStartMenu - Shaun Harrington has created this elegant little application that lives in the task bar and automatically indexes the list of items in your Start Menu for quick access with the speed of AutoComplete.
    Startrun4
    It will take system commands, paths to launch explorer, even UNC paths. Launch anything on your system with less than 4 keystrokes. It also adds new context menus to Explorer like CopyPath and Open in DOS box to Explorer.

 

  • Startrun2Martin Plante, hot off his gig at Xceed has created slimKEYS, a "universal hotkey manager" with a simple .NET plugin architecture. If you've got ideas or thoughts, visit the slimCODE Forums.
    Have you ever wanted to bind something to Shift-Ctrl-Alt-Window-Q but didn't know how to grab a global hotkey?
    This will launch programs, watch folders, and find files. It has great potential as more and more plugins appear.
    The current version already comes with the following built-in plug-ins:
    • slimSIZE: Change the current window's position, size or monitor location to any area of your choice.
    • slimLAUNCH: Open applications, documents or folders by typing a few letters from their name. 
    • slimVOLUME: Display the volume level when you use your keyboard's volume control.

 

  • Colibri - The closest thing so far, IMHO, to Quicksilver on Windows, although this little gem has a slow startup time, it runs fast! It's being actively developed and promises integration with a dozen third party programs. It also formally supports "Portable Mode" for those of you who like to carry your apps around on a USB key.
    Startrun3

 

  • Launchy - Another do it all application, this one Open Source and written entirely in .NET, Launchy binds to Alt-Space by default. This app also has the potential to be Quicksilver like if it start including support for stringing together verb-noun combos. It's pretty as hell and totally skinnable (there's TWO Quicksilver skins included!)
    Startrun7

 

  • AppRocket -this little bar sits at the top of your screen, popping down an active list of Bookmarks, Programs, Music, Web Queries and more.  It's unclear if this tool is being enhanced for future versions as folks have reported not hearing from the company in a while.
    Startrun5

 

  • ActiveWords - Arguably the most minimal of these launchers (as it can have no UI at all if you like!), but the most configurable. ActiveWords watches everything you type, in every application, so anything you've just typed could potentially be used by you to launch a program, a macro, send email, or give you Auto-Correct in any application. Check out their screencast/demos and their scripting language. It also is the only launcher (I've seen) with explicit support for the Tablet PC and allows ink to trigger an "Active Word."
    Startrun6

 

  • Dave's Quick Search Bar - Written orignally in JavaScript and now written in magic and ensconced in voodoo, this little Toolbar sits in your Windows Task bar (or wherever you choose to drag it) and supports a huge community of macro writers who've enabled it as a Calculator, Web Searcher, People Finder, Currency Converter and literally hundreds of other tasks via simple to write plugins. Very actively developed and on the web for over 5 years (that's like 100 people years).Startrun8
    It even has a Search Wizard to create your own web searches by example.

UPDATE: I forgot a few that were totally worth mentioning. My bad.

  • Google Desktop - Startrun10Google Desktop has an option that let's you use it as a quick program launcher along with fantastic search abilities by tapping Ctrl-Ctrl.
    Startrun9

 

  • Find and Run Robot - Lightweight, small, quiet until you need it. This little application allows for tuneable heuristics to make it work like you think. Demo Screencast here.
    Startrun11

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.