Combining Files in PowerShell

If you need to combine text files in cmd.exe, you would issue the following command:

If you wish to do the same for binary files, you would use the following command:

To do the same in PowerShell is pretty straightforward.  If the destination file does not already exist or already contains content, you’ll want to issue the New-Item command first.  If you know it doesn’t exist or is empty, you can skip that line, below.

Thanks to Gerardo Lopez for his “Combine or Join Two Text Files Using PowerShell” article, which is the basis for this information.

Rob

This post was migrated from https://blogs.msdn.microsoft.com/rob/2012/11/21/combining-files-in-powershell/.

Solved: The working folder is already in use by the workspace

When trying to map a local folder to a TFS server as a different user than the one under which I was logged in, I kept getting the message:

I was finally able to map the folder by first deleting the local workspace as the logged in user:

Note that the “owner” was the currently logged-in user.

Thanks to the “Geek-A-Boo” blog for the solution at this page.

Rob

This post was migrated from https://blogs.msdn.microsoft.com/rob/2012/10/13/solved-the-working-folder-is-already-in-use-by-the-workspace/.

TFS Quick Tip: Cloaking

In the Source Control Explorer in Visual Studio (VS) 2010 or VS 2012, you can cloak any folder in the source tree that you want to recursively exclude from “Get Latest Version” operations.  Just right-click on the folder, select “Advanced” and “Cloak…”.  VS 2010/2012 will even delete all the local files and folders for those that are checked in; this means you will have to manually delete any obj and bin directories, etc.

I have found that this saves me a lot of time when pulling files from TFS repositories.

Rob

This post was migrated from https://blogs.msdn.microsoft.com/rob/2012/09/24/tfs-quick-tip-cloaking/.

Hyper-V Client Problem Due to Time/Date Difference

I ran into a problem yesterday where I couldn’t use the Remote Desktop client in Windows 8 to connect to a client-side Hyper-V guest.  I got the following error:

Remote Desktop cannot verify the identity of the remote computer because there is a time or date difference between your computer and the remote computer.  Make sure your computer’s clock is set to the correct time and then try connecting again.  If the problem occurs again, contact your network administrator or the owner of the remote computer.

The solution was to connect using the IP address of the Hyper-V guest instead of using the hostname.  I got this solution from both a coworker of mine and via the results of a Bing search.

Rob

This post was migrated from https://blogs.msdn.microsoft.com/rob/2012/08/23/hyper-v-client-problem-due-to-timedate-difference/.

Setting the Title of the Command Prompt Window

I was wondering how you change the title of the Command Prompt window.  A little searching found that Scott Hanselman had answered this question here.  All you have to do is type:

and press Enter to change the title of your Command Prompt window.  It should look like the following:

Command Prompt

Note that if you are running Console2 to host your command prompt window, it works just fine.

Console2

Finally, if you want to do the same thing in PowerShell, just execute the following command:

Note that you have to have the quotes around the text to which the title should be set; they may be single or double quotes.

PowerShell Prompt

Rob

This post was migrated from https://blogs.msdn.microsoft.com/rob/2012/08/21/setting-the-title-of-the-command-prompt-window/.

Load more