PowerShell example: adding items from a changeset to a label

A recent request: “I want to be able to add a label to all files that were modified/added/whatever as part of a changeset.”  Sounds like a job for PowerShell! function label-changeset (      [string] $serverName,       [string] $labelName,       [int] $changeset = $(throw ‘Usage: label-changeset <server> <labelName> <changeset>’) ){      # get TFS object      $tfs = get-tfs $serverName      #…

1

add-types.ps1 – poor man’s "using" for PowerShell

One thing that’s missing from PowerShell is the ability to import foreign namespaces into the current context.  That leads to a lot of typing at the interactive prompt and bloated hard-to-read lines in your scripts.  For example, even if you’ve loaded the TFS client assemblies, you still have to write out fully-qualified type names like…

1