May 162013
 

PowerGUI_Badge_SeeYouAtFollowing on from the last instalment where I looked at supporting PowerShell script development in Visual Studio 2010, I’m going to take a closer look at PowerShell integration with the newer Visual Studio 2012.

Again, I’ll be leveraging the excellent Quest PowerGUI product and the associated Visual Studio extension.

Installation

You’ll also need PowerGUI 3.2, but this time there’s an updated Visual Studio extension which you’ll need, version 1.6.1

Install PowerGUI 3.2 first, and once complete then install the Visual Studio extension.  PowerGUI has a dependency on the .NET Framework 3.5, on newer OSes (like Windows 8) you might not have this pre-installed, don’t worry – the installer will warn you if anything’s missing.

Getting Started

Once you’ve installed, you will see a new option in Visual Studio’s File –> New Project dialog for PowerShell.  This creates a fairly sparse new project with a .ps1 file in it ready to go.

Troubleshooting

The first two times I tried to get everything installed and running, I kept getting issues with Visual Studio 2012 warning it couldn’t load PowerGUI.  I tried everything until I realised what the problem was.  I’d downloaded the .vsix but one thing finally dawned on me:

image
Unblock

Therefore, unblocking the file before installing seemed to do the trick.  If you’re having problems loading the extension this might be a problem for you as well.

Looking at the Project

As with Visual Studio 2010, you get the PowerShell project type available in the New Project dialog:

image
New Project

A closer look

Some of the advantages of using Visual Studio to write your PowerShell scripts are easy to highlight.  The debugging support is obviously a huge advantage, but so to is the Intellisense support. 

It’s really evident when there’s an issue with the script, if you aren’t seeing the right info in Intellisense.  Rather than go into detail, they say a picture is worth a thousand words, so let’s see some examples of the value in writing your PowerShell scripts in Visual Studio:

image
Debugging Support

image
IntelliSense Support

image
PowerGUI integrated Console

image
Best of all – Tooltips which provide CmdLet syntax

What’s Next?

Now that we’ve explored both Visual Studio 2010 and Visual Studio 2012 options for PowerShell, the next step is to take a look at some of the advantages of using either environment when building your PowerShell scripts.  We’ll also look at trace/output options and how to best handle errors.

Check back for the next article..soon.

Feb 192013
 

Recently, I had to authenticate to Team Foundation Server using an account with greater permissions to perform some administrative tasks.  As you may know, this requires entering alternate credentials when you add the server to the list of TFS servers, or when you need to connect to the server.  Once you’ve connected once, you aren’t prompted again as the credentials are cached locally.

In the past, to remedy this, you could simply delete the local TFS cache, which is located in the following directory (Windows Vista and onwards):

<system drive>\Users\<your profile>\AppData\Microsoft\Team Foundation

image

However, in more recent versions this has changed somewhat, and the user’s credentials are no longer linked to the local TFS cache or configuration.

Where are the Credentials?

Good question.  After some digging about, it seems that the credentials are now stored in the user’s Credential Manager store within Windows.  If you aren’t familiar with this, it was introduced on the more recent versions of Windows, and it lives via the Control Panel, under the following path: Control Panel->User Accounts

image

Inside this location, you can view all the locally cached credentials, including Windows Credentials:

image

Note: that it appears that for TFS credentials used by Team Explorer and other applications, the credentials are the ones under “Generic Credentials” not under “Windows Credentials” (in case you have TFS entries in both).

Making Changes

To modify or remove the credentials you use to connect to TFS, simply expand the appropriate entry and click on “Edit”, or to delete the local credentials, click on “Remove”.  If you opt to remove the credentials, you’ll be prompted to enter new credentials next time you connect to the specified TFS server.

image

 

So that was a little out of the way. When I tested this, I made sure that I’d disconnected from TFS before changing/removing the credential configuration.

It would be nice if Team Explorer linked to the Credentials Manager so we didn’t have to go digging to work this out, wouldn’t it?

Nov 162012
 

It was a little while ago that I blogged about Richard Bank’s approach to revert the menu in Visual Studio 2012 back to the friendly and reliable sentence case style that we all know and love.  Since then, Visual Studio 2012 has launched with the RTM version, moving out of pre-release status.

In the time between, I had installed the RTM version only to find that the registry key which was used previously to suppress the ALL CAPS menu was seemingly not being recognised.  It turns out I had a unwanted space at the end of the key name – be wary when copying and pasting names into Reg Editor

Drat.  Oh well, I did find some alternate ways of solving the menu casing problem without editing the registry: 

How to solve that ALL CAPS menu problem (again)..

If you would prefer to avoid editing the windows registry, you have at least two options:

  1. Squared Infinity’s VSCommands are a Visual Studio extension which you can download, or,
  2. There’s a NuGet package you can use to achieve the desired outcome (I haven’t tested this yet)

For the first option, here’s how to change the menu.

  1. Download and install the VSCommand extension
  2. Open Visual Studio
  3. Under Tools:

    menu

  4. 4. Select ‘VSCommands->Options’
  5. 5. Select your preferred menu case:

    case

The VSCommands extension is listed as free – however once installed the menu mentions ‘Activate License’ (as seen in the above screenshot). 

image

 

The squared infinity site lists prices for various licensing models, I therefore don’t know if the free extension is function limited, or a timed trial – but it doesn’t look free to me.  To be fair though, the VSCommands extension does way more than change the casing of the VS Menu, so it might be worth checking out.

If you don’t want to be buying a license, then I suggest you try the NuGet package, or use the registry key mentioned in the previous article.

Styling and Colours

While I was busy researching options to revert the Visual Studio menu to sentence case, I came across this really excellent “Visual Studio 2012 Color Theme Editor” by Microsoft which is a free Visual Studio extension.  Installing the extension presents you with a settings page when you launch Visual Studio.

image

You can also import custom themes.  This is a nice option if you want an easy way to switch visual themes, or to export them and take them with you between machines.

Installing and Removing Visual Studio 2012 Extensions

If you’re not sure how to install or remove extensions, check out this page on MSDN.

Enjoy,

/R

Oct 312012
 

As the BUILD conference (formerly PDC) kicks off in Redmond, we are finally treated to the official launch of the long, long awaited Windows Phone 8 SDK.

Held under wraps for months, with precious few copies of the pre-release being seen, this SDK has been a long time coming.  The only way to get an early look at the unfinished SDK was through hard core NDA agreements, and even these were strictly limited.  One copy leaked onto the Internet, but it was extremely early and offered very few insights into the platform itself.

The official reason for delaying the SDK?  It was held back due to sensitivities around “unannounced features” in the Windows Phone 8 platform (which the SDK ROM image would give away).  At any rate, from today we all finally get a look in at what the future holds for apps development on the new Windows phone platform.

To jump straight into the SDK, check out the What’s new page on MSDN.  If, for some weird reason, you’d prefer to read some marketing hype around the platform, perhaps have a read over here at the Windows phone site.

Finally.. Download the SDK

Aug 172012
 

It’s been a massive week for Microsoft.  We are really in full swing when it comes to the largest release cycle in Microsoft’s history.

It all began on Wednesday at 10 AM PST (Pacific) which is an appallingly wee-hours 3 AM AEST (Australian East).  Insomnia had gripped me, so with a glance at the clock, I decided to stumble online.  Just on the release time, my machine decided that it had to reboot owing to a security patch.

By the time the damned thing rebooted it was too late – MSDN/TechNet were being pummelled by eager subscribers all intent on downloading the RTM ISOs.  I simply couldn’t get launch an Akamai download.

In the end I had to wait until yesterday afternoon, when the queue had died down.  There is quite a lot to digest, including the dark horse, Team Foundation Server 2012.  Word on the grapevine is that Windows Server 2012 will also go RTM shortly as well.

There are quite a number of considerations confronting the subscriber – platform (x86 or x64), locale (US or UK English?), license (Retail, VL, MSDN) and flavour (Win 8 or Win 8 Enterprise, Visual Studio Ultimate/Professional or Premium?).  As one friend put it to me: “What’s the difference?”

For a good look at the differences, here are some helpful links:

Compare Flavours of Windows 8

Compare Editions of Visual Studio 2012

Noting that Windows 8 Enterprise has the features of Windows Pro but has extra support for large organizations.

There are also quite a few additional installation packages to compliment Visual Studio 2012 including the Test Agents (which I’ve mentioned in previous articles to do with establishing load testing), Intellitrace Collector, Remote Tools and the ever handy TFS Everywhere.

Once Windows Server 2012 joins the fray, we will have a very busy period indeed.  Much to write about, so little time.  You’ll also hear from me (with no undue level of verbosity) as I blog live from Microsoft Australia’s annual tech-fest, TechEd 2012 which is on the Gold Coast this year.

Enjoy the new releases and check back here for more, as I begin my long journey diving into the latest tech.