I was considering installing the timeit.exe command on my new laptop, but read that it may not work on the latest versions of Windows. So, I found an article on StackOverflow that recommended using the Measure-Command command in PowerShell. You use it as follows, where Get-ChildItem is just listing the current directory as an example command …
Tag: PowerShell
Nov 21 2012
Combining Files in PowerShell
If you need to combine text files in cmd.exe, you would issue the following command:
1 |
<span style="font-family: Consolas;">copy file1.txt+file2.txt+file3.txt combined_files.txt</span> |
If you wish to do the same for binary files, you would use the following command:
1 |
<span style="font-family: Consolas;">copy /b file1.bin+file2.bin+file3.bin combined_files.bin</span> |
To do the same in PowerShell is pretty straightforward. If the destination file does not already exist or already contains content, you’ll …
Aug 21 2012
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:
1 |
title <your text> |
and press Enter to change the title of your Command Prompt window. It should look like the following: Note that if you are …
Jun 27 2012
Afraid of PowerShell? Watch this video now.
I have been working more and more with PowerShell lately and I love it. If you want to watch a great introductory 75 minute video to get up to speed quickly, look no further than here: Windows PowerShell Crash Course https://channel9.msdn.com/Events/TechEd/NorthAmerica/2012/WSV321 It is presented by Don Jones and Jeffrey Snover. They share a number of great tricks and …
Mar 08 2012
Want to add color to PowerShell code in your docs?
I was writing a Word document and wanted syntax highlighting for my PowerShell scripts. It turns out that ISE (Integrated Scripting Environment) has an extension for copying text with color (and for copying text with color as HTML). Just do the following: Install the PowerShellPack.msi file from here. Open ISE and your .ps1 PowerShell file. …