Klaus

Stories kicked by Klaus

Introducing Darth Enumerator, PowerShell TIE Fighter |e| Operator(tellingmachine.com)

submitted by KlausKlaus(755) 3 years, 1 month ago

Starting this project, I assumed that the distinction between an array and a Hashtable in PowerShell is the implementation of the IEnumerable interface. Now I know that there are two kinds of IEnumerables: There is one kind that PowerShell converts into Arrays before processing it in a pipeline for example an ArrayList. And another kind like a SortedList or a HashTable that get passed to the pipeline as scalar objects. My assumption was wrong and now there is some room for speculations. I wonder whether adding an extension method like ToArray() to the .NET Hashtable class, would let me pipe a Hashtable in PowerShell as Array of Dictionary Objects. read more...

add a comment |category: |Views: 7

tags: another

Tuning Click-Once deployment performance with VRTA and PowerShell(tellingmachine.com)

submitted by KlausKlaus(755) 3 years, 1 month ago

Some of our client applications get distributed using the Click-Once paradigm. One day we noticed that the time between the initial click on the download link in the browser and the complete initialization of the Click-Once desktop client application took much longer than a user would tolerate. We decided to debug the deployment of the application and fix the problem. We chose the Microsoft Netmon 3.2 and the VRTA (Visual Round Trip Analyzer) for the initial analysis. read more...

add a comment |category: |Views: 29

tags: another

Advanced file searches using PowerShell(tellingmachine.com)

submitted by KlausKlaus(755) 3 years, 2 months ago

As far as I can remember, PowerShell v1.0’s FileInfo object didn’t have a VersionInfo property. It has been added during the PowerShell 2.0 release. This property makes it much easier to search for files that belong to a specific Product or to a specific Vendor for example. This blog post demonstrates some file system searches based on the file version information. read more...

add a comment |category: |Views: 9

tags: another

Essential LINQ Published(blogs.msdn.com)

submitted by CharlieCalvertCharlieCalvert(7875) 3 years, 2 months ago

There was a knock on my door this morning. By the time I could make it to the front of the house, the delivery man was gone, but he had left behind a box full red and white books, each with the title Essential LINQ. On the cover was my name, and the name of my good friend Dinesh Kulkarni. This was, of course, a box full of the first copies of my most recent book. They had a arrived at my house on a most propitious date: the first day of spring. read more...

add a comment |category: |Views: 296

tags: another

What ASP.NET MVC Can Learn From Ruby on Rails(kevinwilliampang.com)

submitted by kpanghmckpanghmc(2055) 3 years, 2 months ago

What I think ASP.NET MVC can learn from Ruby on Rails. read more...

add a comment |category: |Views: 482

tags: another

Git/Github survival guide(flanders.co.nz)

submitted by simonechsimonech(10.1k) 3 years, 2 months ago

Now that all the cool guys are moving to Git/GitHub, Ivan posts a survival guide, with all the most useful commands of git and how to get started with github/git read more...

2 comments |category: |Views: 322

tags: another

Silverlight 3: AVAILABLE!(nextbestgeek.com)

submitted by RemanReman(1970) 3 years, 2 months ago

Looks like Silverlight 3 is rolled-out: Runtime, SDK and documentation are already available for download. See the Client / Server libs? read more...

1 comment |category: |Views: 447

tags: another

Generating NUnit tests with PowerShell(tellingmachine.com)

submitted by KlausKlaus(755) 3 years, 2 months ago

The other day I needed to write NUnit unit tests to for a large number of method overloads. There were almost 100 methods that needed to be tested. The method signatures followed a well defined pattern. This didn’t look like much fun at first, but then I looked in my toolbox and I saw the smiling face of the PowerShell ISE shouting “Pick me! Pick me!”. About two hours later I had created a script that would parse the method signatures and generate NUnit test methods for each of the functions. read more...

add a comment |category: |Views: 29

tags: another

Getting Started: Scripting Incuity EMI models with PowerShell(tellingmachine.com)

submitted by KlausKlaus(755) 3 years, 3 months ago

The Incuity EMI (Enterprise Manufacturing Intelligence) software lets you connect to various plant historians, real time plant data servers and conventional relational database servers and access the underlying information through an unified entity model. The heart of the model is a powerful and elegant meta-repository. The setup of the data sources and the creation of the entity model can be automated by using an easy to use client .NET API. This article describes how to get started with this API and demonstrates the creation of a connector to the plant historian server from Wonderware using PowerShell. read more...

add a comment |category: |Views: 20

tags: another

When PowerShell hash table magic backfires(tellingmachine.com)

submitted by KlausKlaus(755) 3 years, 4 months ago

We just made it through the holidays and I finally found time to write about the most annoying thing in PowerShell: Hash table semi-automatic, which can easily result in some subtle bugs. And all of that, just because the hash tables don't behave as I would expect. I assumed hash tables to be implicitly sorted by the keys using the Sort-Object cmdlet and to always stay hash tables and not get converted into arrays of Dictionary Entries or even a single Dictionary entry when piped into a Where-Object cmdlet. To workaround these strange defects you need to apply some unnatural constructs and roll your own select statements. It just doesn't feel fair to make your children call GetEnumerator() before they try to find today's window on their Advents Calendar. read more...

add a comment |category: |Views: 20

tags: another

Dear PowerShell Santa...(tellingmachine.com)

submitted by KlausKlaus(755) 3 years, 5 months ago

PowerShell has a great potential, but it needs professional tool support in order for it to mature. The current solutions are far too amateur. Here is my list of PowerShell improvements for Santa Claus read more...

add a comment |category: |Views: 17

tags: another

One PowerShell Script to download PDC2008 Videos, Code and PowerPoints(tellingmachine.com)

submitted by KlausKlaus(755) 3 years, 5 months ago

Yes I did it. I downloaded all 65,563,667,714 bytes and saved them as 407 files on my nice new WD Passport hard drive that I brought home from the PDC2008. And, yes I did it the old fashioned manual way: Right-Click on link and Save-As. But you don't have to do it. In this blog post I provide the metadata of all the files I downloaded and a PowerShell script that will help you automating the download process. Besides the PDC content you also get to a treasure trove of PowerShell scripting techniques ranging from dynamically generating Regular Expressions to loading meta-data form XML and CSV files. read more...

add a comment |category: |Views: 229

tags: another

Meta-Programming with PowerShell and Regular Expressions(tellingmachine.com)

submitted by KlausKlaus(755) 3 years, 6 months ago

I am almost done with my biggest PowerShell scripting project so far. The last feature that I implemented was a flexible pattern matching facility. I wrote a procedure that would try to filter out a set of file names based on the first letters and the extensions of the file. The possible name prefixes and extensions would be provided by string arrays that could contain zero or more elements. The challenge as always with PowerShell is to understand its type conversion magic. One approach to this is to use baby steps while morphing the static regex string to a dynamically built regex string. This progression and the result is captured in this blog post. read more...

add a comment |category: |Views: 23

tags: another

Set-Content -Encoding parameter matters, if the content says so...(tellingmachine.com)

submitted by KlausKlaus(755) 3 years, 6 months ago

I use a simple PowerShell script to replace some of the URLs in my blog post's html source before I publish them to www.tellingmachine.com. In my case the posts are stored as XML files. Usually I use Windows Live Writer to write my posts. I publish the documents for test purposes frequently during the authoring to the VisualStudio 2008 development web server that runs locally on my machine. Once the post is ready to put online, I take the XML file, run the PowerShell script against it and then copy it to my production server. Occasionally the XML files refuse to open in Internet Explorer after I ran the script. It took me few minutes to figure out why. Here is the story! read more...

add a comment |category: |Views: 12

tags: another

What is the coolest thing on the planet? - PowerShell(tellingmachine.com)

submitted by KlausKlaus(755) 3 years, 7 months ago

Walter and I gave a presentation at the WonderWorld 2008 conference in Las Vegas last week. To get many people exited about our talk, we asked customers what they think the coolest thing on the planet is. They thought first that this is a trick question, but we didn't keep them in the dark for too long. The coolest thing on the planet is: PowerShell read more...

add a comment |category: |Views: 12

tags: another

Converting a Generic List of Custom Objects & Property to a Formatted (codezest.com)

submitted by daveschinkeldaveschinkel(1720) 3 years, 7 months ago

Today I had the need to take a list of names from a returned list of Custom Objects, and convert one of its properties it to a string that included some HTML. This is nothing fancy, and pretty standard/simple but I thought I’d post about it anyway. Since I did not need a custom ToString() method here to convert all properties of my object, I just created a simple method to iterate through the list of objects and add one of the properties to the StringBuilder object which is ultimately being returned to give me the nice string with HTML. read more...

add a comment |category: |Views: 11

tags: another