Archive for the 'software development' Category

PowerShell for acceptance testing

PowerShell with its .NET integration and more and more products/platforms shipping with native PowerShell cmdlets is a great tool for automated testing. (I even posted a sample PowerPack helping organize tests in PowerGUI a few years ago.)

We at Quest Software are using PowerShell a lot for our software development and testing. Our SharePoint management team is on the cutting edge and extended acceptance testing Fitnesse framework to PowerShell.

But wait, now it gets really cool: they have open-sourced the PowerShell Fitnesse framework – PowerSlim at codeplex for everyone to download, use, modify, and update!

Read more about PowerSlim in Konstantin’s blog here.

Advertisements

TFS inside PowerGUI

Steve Crouse has recently published his PowerGUI pack for Microsoft Visual Studio Team Foundation Server – thus, fulfilling James Manning’s long time wish. 😉

This is a very nice tool allowing for browsing the work items for all the projects on a Team Foundation Server either by area or iteration. In addition you can view all open work items assigned to you, regardless of project. Project metadata such as the work item editing form definitions can be viewed for each project.

PowerShell-based PowerGUI console for Visual Studio Team Foundation Services

The default work item edit form can be launched for work items (although until PowerShell 2.0 is released with support for execution under Single-threaded Apartment mode the form does not function correctly.)

And, as usual the PowerShell code tab lets you easily see how everything you do translates into PowerShell – so you can later use this knowledge to automate things in your project (Steve basically loads the Team Explorer assemblies and uses them to connect to the server and retrieve data.)

You can download the VSTFS pack and leave your comments and feedback to Steve.

Tags: , , , , ,

Counting lines of source code with PowerShell

How do you count the lines of code your application has? As far as I know Visual Studio does not provide this functionality, so needless to say, we are doing that with PowerShell 😉

$num = 0
dir c:\root\ -include *.cs -Recurse | ForEach-Object { 
	$file=[array](Get-Content $_ ) 
	$num += $file.length 
}
$num

You obviously need to change c:\root to your root folder path, and change the *.cs mask to the one applicable to your source code.

Tags: , ,

Automated Software Testing with PowerShell and PowerGUI

PowerShell is great for automated software testing. We all know that and some of us even have some experience doing that. However, wouldn’t it be great to have a UI console to manage and run the individual test scripts?

Now you have one!

UI Console for Automated Software Testing based on PowerShell

This PowerGUI-based console allows you to:

  1. Run selected/all/based on criteria test scripts.
  2. See results, last run time, modification time, error messages.
  3. Filter and sort by any of the aforementioned properties.
  4. Add new test scripts.
  5. Edit test scripts.
  6. Copy test scripts to serve as models for new scripts.
  7. Delete scripts.
  8. Produce reports.
  9. Schedule tests for regular automated runs.

You can watch the automated software testing demo and download (absolutely free) the testing console at PowerGUI.org.

Enjoy and let me know if you have any feedback/feature requests!

Dmitry

Tags: , , , , , , , , , ,

PowerShell session at St. Petersburg .NET Usergroup – July 6th

Next Friday, July 6th 2007 I will be presenting at St. Petersburg (Russia) .NET Usergroup.

The usergroup will start at 6 pm local time and will go till approximately 9. We will start with Gaidar Magdanurov demoing some of his WCF work, and then I will do a PowerShell for developers session, sharing our experience and evangelizing PowerShell as the best command-line you can implement for your applications.

If you happen to be in St. Petersburg, Russia please register and drop by:

http://sp.ineta.ru/Events/EventInfo.aspx?ID=2b472d76-b54f-41dd-b753-4a793eba19ff

Tags: , , , , , ,

Autoupgrade for PowerShell snapins?

There’s an interesting side-effect of being agile and releasing updates too often – not everyone is able to keep track of your updates and upgrade to the latest version.

With rich applications this is kind of easier. For example, PowerGUI checks for newer version on start-up (we even have a bug when it manages to display the notification behind the splash screen) and offers to perform the upgrade.

By how would you handle the same issue in the command-line?

AD cmdlets 1.0.0 had issues installing on Vista/Longhorn. We fixed this in 1.0.1. The current version freely available for download is 1.0.3 and there are still people trying to use 1.0.0 and suffering from all the issues we have fixed a long time ago.

Is anyone trying to solve similar issues with other PowerShell snapins? Any advice?

One thing I find useful is making PowerShell at least display the snapin version so you know which computer has which version installed (yes, you can look this up in Add/Remove Programs but that’s not that handy.) For AD cmdlets you can do this by checking the version info with the following command:

(get-command (get-pssnapin Quest.ActiveRoles.ADManagement).ModuleName).FileVersionInfo.ProductVersion

Or even modify your profile to have that displayed at each startup:

# add the following code to your profile
# this gives the greeting message with the version info

"Loaded AD cmdlets v."+ (get-command (get-pssnapin Quest.ActiveRoles.ADManagement).ModuleName).FileVersionInfo.ProductVersion

# this changes the window caption:
function Prompt
{
$host.ui.RawUI.WindowTitle = "ActiveRoles Management Shell for Active Directory (beta) v."+ (gcm (get-pssnapin Quest.ActiveRoles.ADManagement).ModuleName).FileVersionInfo.ProductVersion
"PS> "
}

But this still does not give auto-update… Can you even have the snapins go to the internet, check for latest version, download it and start the upgrade?

Tags: , ,

PowerGUI 1.0.6 released!

We have just made PowerGUI 1.0.6 available for download from http://PowerGUI.org.

As I mentioned before, stability was a priority for this release, so there are no radical changes apart from multiple bugfixes and minor improvements.

Setup should stop giving weird messages on Vista and Longhorn, filters work correctly even when 0 objects are displayed, PowerShell snapins don’t disappear and so on. You can read more information on the fixes 1.0.6 has on the PowerGUI Feature Roadmap page.

Also, because of the issues we had with the initial 1.0.5 setup, we are now taking a more staging approach: we put the new version on site couple of days ago and waited for some time before making the announcement in this blog. (As usual, Richard was the first to spot that and report in his blog! I wonder where he finds time for all that?)

No one reported any issues – so I am posting this. However, that’s not the last stage. We will leave it for a few more days in the manual update mode. Only if we get no complaints we will turn on autoupdate for 1.0.5 so all PowerGUI installations connected to the internet prompt user to perform the upgrade.

Tags: , , , ,


My Recent Tweets

Legal

The posts on this blog are provided “as is” with no warranties and confer no rights. The opinions expressed on this site are mine and mine alone, and do not necessarily represent those of my employer - WSO2 or anyone else for that matter. All trademarks acknowledged.

© 2007-2014 Dmitry Sotnikov

June 2019
M T W T F S S
« Oct    
 12
3456789
10111213141516
17181920212223
24252627282930
Advertisements

%d bloggers like this: