By KlausG
via tellingmachine.com
Published: Aug 14 2008 / 00:39
PowerShell provides the += operator to add one hash table to another hash table. By default this operation will result in an error, if both hash tables have at least one key that is common in both collections. In some cases you may want to have a more granular control. For example, you don't want to get an error, if not only the key, but also the value is common in both collections. On top of this somebody might want to allow an overwrite, if the key and the value are going to be identical as result of the merge. This could be useful, if the hash table is used as template for replacing strings. Updating the master table by adding a key value pair that refers to the same string would mean to exclude this particular replacement pair from the replacement transactions.
Add your comment