SQL SAMSON

everything sql

Archive for the ‘windows powershell’ Category

Windows Powershell…useful tools

leave a comment »

If you haven’t heard about Windows Powershell yet then my friend you might want to look into it. I have found several useful tools and one in particular I have used over and over again. First off what is Powershell? Well in-short it is a command-line shell and scripting language. It is now a part of Windows Server 2008. For more detailed information about Windows Powershell visit: Windows Powershell.

To download and install Windows Powershell visit: How to download

Here is what it looks like. Similar to a DOS or command prompt screen.

As far as the tools go…one that is not listed but very useful is the FSUTIL. You won’t find it listed when you run HELP, but you can find more information while in Powershell simply by entering fsutil followed by the enter key.

fsutil file createnew is my favorite for the time being.

I can create blank files and specify their sizes. Hmmm that is freaking awesome. I can create files exactly 1KB, 1MB, 64MB, 128MB 500MB or even 1000MB plus in size.

Why would I need to create blank files with specific file sizes you ask? Well I use SQL Server 2005 quite a bit and monitoring how long it takes to insert data of all sizes into the tables is one of the main reasons. I can get a baseline for the time it takes to insert data. Since all networks are not created equal, with this type of testing I can provide some realistic answers. I usually test from the closest area followed by the furthest area and time the process from start to finish of course.

Bytes [Bytes to Megabytes to Gigabytes calculator]
1048576 = 1MB
1073741824 = 1GB

Written by Samson Loo

August 30, 2008 at 3:59 am