Category Archives: Powershell

Powershell MSBuild task

UPDATE: The source and installer for this task can now be found at Codeplex: http://powershellmsbuild.codeplex.com/  I have written an MSBuild task that hosts a Powershell runspace and allows you to embed Powershell scripts in your MSBuild build files. While MSBuild … Continue reading

Posted in Powershell | 100 Comments

DynamicMethod revisited: Making Powershell handle arbitrary delegates

  As I posted on Monday, Powershell doesn’t let you cast a scriptblock to a delegate with a signature other than void (Object, Object). Jeffrey Snover confirmed this the same day. When I learned that this was a limitation in … Continue reading

Posted in Powershell | 74 Comments

Powershell can’t do arbitrary-signature delegates?

I was asked the other day how to handle authentication in NSvn with Powershell. The scripts I’ve shown up until now([1], [2] have used the NSvn.Core.AuthenticationProvider.GetWindowsSimpleProvider() method to provide authentication when required by Subversion. Subversion uses a concept of “authentication … Continue reading

Posted in Powershell | 41 Comments

NSvn and Powershell: Log messages

All NSvn.Core.Client methods that modify the repository directly require a log message. These include MakeDir, Commit, Import, Move, PropDel, PropEdit and PropSet. To provide a log message using NSvn, you need to handle the Client.LogMessage event and set the Message … Continue reading

Posted in Powershell | 40 Comments

Setting the .NET environment for a Powershell prompt

VS.NET installs a shortcut that, when invoked, sets the necessary environment variables you need to access the command line tools that comes with VS and the .NET and brings up a command prompt. The shortcut leads to a batch file … Continue reading

Posted in Powershell | 42 Comments

Powershell script blocks as .NET event handlers

Scott Hanselman posts an interesting script where he uses the NSvn library (the .NET wrapper library for Subversion we wrote for AnkhSVN) directly from Powershell to either checkout from a Subversion repository or update an existing working copy. This is … Continue reading

Posted in Powershell | 30 Comments

SVN Tab Expansion for Windows Powershell

Windows Powershell allows the user to customize the behavior of TAB expansion/completion on the command line by replacing the default TabExpansion function. The following is a Powershell script that adds TAB completion for svn.exe subcommands and their associated options. It … Continue reading

Posted in Powershell | 12 Comments