Welcome to MSDN Blogs Sign in | Join | Help

Oscar Calvo's Blog

Random thoughts focused on Modeling, Software Factories, Visual Studio Extensibility, Xbox 360, Windows Media and Windows MCE.

Syndication

News


Not really the last vsvars32 you will ever need...but close

I took Peter avise and for a while I've been using Chris's vsvars32, however it had some drawbacks,

1. It did not work from a 64bit PowerShell

2. For some reason Get-Batchfile did not work for me, I had to modify to call "echo" explicitly.

I also added a helper VsInstallDir and a alias for devenv.

 Enjoy,

 Oscar

function global:VsInstallDir($version="10.0")

{

  $VSKey = $null

  if (test-path HKLM:SOFTWARE\Wow6432Node\Microsoft\VisualStudio\$version)

  {

    $VSKey = get-itemproperty HKLM:SOFTWARE\Wow6432Node\Microsoft\VisualStudio\$version

  }

  else

  {

    if (test-path HKLM:SOFTWARE\Microsoft\VisualStudio\$version)

    {

        $VSKey = get-itemproperty HKLM:SOFTWARE\Microsoft\VisualStudio\$version

    }

  }

 

  if ($VSKey -eq $null)

  {

      throw "Visual Studio not installed"

  }

  [System.IO.Path]::GetDirectoryName($VsKey.InstallDir)

}

 

function Get-Batchfile ($file) {

    $cmd = "echo off & `"$file`" & set"

    cmd /c $cmd | Foreach-Object {

        $p, $v = $_.split('=')

        Set-Item -path env:$p -value $v

    }

}

 

function global:VsVars32($version="10.0")

{

  $VsInstallPath = VsInstallDir($version)

  $VsToolsDir = [System.IO.Path]::GetDirectoryName($VsInstallPath)

  $VsToolsDir = [System.IO.Path]::Combine($VsToolsDir, "Tools")

  $BatchFile = [System.IO.Path]::Combine($VsToolsDir, "vsvars32.bat")

  Get-Batchfile $BatchFile

  [System.Console]::Title = "Visual Studio shell"

}

 

set-alias devenv ((VsInstallDir)+"\devenv.exe") -scope global

 

Posted Wednesday, November 25, 2009 11:49 AM by ocalvo | 0 Comments

Filed under: ,

How to: Run Expression Encoder 3 under PowerShell remoting

James wanned me to explain the set of steps I use to enable Convert-Media under a PowerShell remoting.

First a disclaimer: running these steps will lower the security settings of your PC, use with caution. 

Here there are:

In your encoding server (mine is called tv-server):

Enable-PSRemoting  -force # Enables remoting
set-item WSMan:\localhost\Client\TrustedHosts * -force # I am not running a domain controller, so my server needs to trust everybody
set-item wsman:localhost\Shell\MaxMemoryPerShellMB 1024 -force # The default allowed memory is very low, we need to bump it so that Convert-Media have room to work.
Enable-WSManCredSSP -Role Server -force # I need the server to have access to my Windows Home Server, so it needs to autenticate using credential delegation

In your client:

function AllowDelegation($policyName)
{
    $keyPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation\"+$policyName
    if (test-path $keyPath)
    {
        rmdir $keyPath -force -rec
    }
    $key = mkdir $keyPath
    $key.SetValue("1","WSMAN/*");
}
AllowDelegation "AllowDefaultCredentials"

AllowDelegation "AllowFreshCredentials"

Enable-WSManCredSSP -Role Client -DelegateComputer * -force

In order to remote into your server do:

Enter-PSsession <ServerName> –cred <UserName>

I have used “*” (star) in two places, that’s too broad, if you are already using a DNS suffix I would recommend to use it and change “*” to “*.mydomain.com”.

In that case you need to refer to your server as:

Enter-PSsession <ServerName>.mydomain.com –cred <UserName>

Once inside, load the Encoder module as usual and execute Convert-Media.

You could Batch background encoding jobs using the instructions from the PowerShell team.

Enjoy,

 

Posted Friday, November 06, 2009 7:31 PM by ocalvo | 0 Comments

Announcing Dev10 Beta 2

 

Visdual Studio 2010 Beta is now available here.

Please start pounding it on it and let us know what you think.

 

Posted Thursday, October 22, 2009 9:52 AM by ocalvo | 0 Comments

Filed under: ,

Notes on the Synthesis of Form

I have been reading Christopher Alexander's "Notes on the Synthesis of Form", if you are into "Test Driven Design", Software Design and AgileSoftware Development you will find this book written by a building architect 45 years ago fascinating.

The author explains why some unconsiuos cultures can come up with better home designs than the developed (or self-consiuos) cultures. It also explains why a desing can only be created using test or "proofs".

Form there you can extrapolate to software development and see with a complete new perpective how the agile process approach the process of "Design".

In my personal case, It allow me to see why principles like YAGNI and KISS are fundamental to the process of design.

Even if you are not into agile, I definitely recommend this book, its a short read.

 

 

Posted Friday, May 22, 2009 5:13 PM by ocalvo | 2 Comments

Filed under: ,

Visual Studio 10 CTP

There are tons of new cool features in Visual Studio Team Architect 10.

- New UML Designers 

- Architecture Explorer

- Layer Designer

 

Please download a give us feedback at Dev10 CTP Feedback page

 

If you have questions about the UML designers use the forums, we will be watching.

 

 

Posted Tuesday, October 28, 2008 1:07 PM by ocalvo | 1 Comments

Filed under: ,

Powershell

As Peter I have became infected with Powershell, and to make it worse, there is console mode editor support. Sweet!!!

I have one week using it, I am not going back to cmd.exe ever!! 

Here is a great replacement for vsvars32.bat made by Brad Wilson.

 

Posted Friday, July 25, 2008 8:28 PM by ocalvo | 3 Comments

Filed under:

Going to TechEd

I'll be in TechEd at the Visual Studio Team Architect demo station.

See you there.

 

Posted Saturday, May 31, 2008 3:46 PM by ocalvo | 0 Comments

Intro

Hello, after working with DevDiv and p&p as vendor for the past 7 years (wow, I can't believe it's so long) I finally joined Microsoft as a full time employee. I joined the VS Team Architect team as an SDE 2 months ago. I joined the team just in time for the Visual Studio 2008 release, I am really excited of the features that my team is delivering but more so about the ones in the future.

Joining Microsoft has been a huge change for me, both professionally and personally (I relocated from Costa Rica) and it's been an incredible busy year, so forgive me if I haven't answer your CAB and/or GAT questions (I know there are a couple here and there). Meanwhile I move the CAB and GAT articles from my previous employer web site to the msdn blog site.

Regards,

Oscar Calvo

 

Posted Thursday, December 27, 2007 12:01 AM by ocalvo | 2 Comments

Filed under: , ,

The Evil EnvDTE namespace
Link

Posted Wednesday, December 26, 2007 9:54 PM by ocalvo | 0 Comments

Filed under: ,

Page view tracker