Import-CliXml is a rather convenient way to import (configuration) data from serialized XML files which then can be easily processed as hashtables. But unfortunately, there seem to be some subtle […]
Microsoft PowerShell module manifests allow you to define scripts that are run prior to actual loading of the module itself. These scripts run in the caller’s scope (and not in the module’s scope) and can be defined by stating them in the ‘ScriptsToProcess’ attribute of the manifest. However, each of these scripts will appear as if they have been loaded […]
[UPDATE 2014-10-21] the code and the assembly are now available under Apache 2.0 license on GitHub at https://github.com/dfch/biz.dfch.CS.System.Utilities [UPDATE 2014-12-10] see below for further details on this issue and a workaround to this that does not need PSRemoting Recently I observed a strange bug that occured when trying to invoke a PowerShell job via the Windows Task Scheduler. In my […]
As already described on elsewhere on the Internet and on Microsoft Connect, the new Invoke-WebRequest Cmdlet, that comes with PowerShell v3, handles form fields incorrectly. Instead of referring to the name attributes of input elements within a form the Fields Collection stores the ids of the attributes under the ‘key’ property. As in the following example you see the text […]
Serialising and Deserialising data structures is pretty easy when using Export-CliXml/Import-CliXml. However, there are some gotchas. In addition to the already described bug when using [ordered] hashtable in PowerShell v3 with Import-CliXml there is another error when importing [Array] with Import-CliXml: an [Array] becomes an [ArrayList]. The following code shows the problem: Again, this error seems to occur when you do […]
The new powershell feature “ordered” hashtable (a new PowerShell feature in v3. See OrderedDictionary Class) becomes an ordinary hashtable when it is imported via Import-CliXml. There is a “active” bug on Microsoft Connect OrderedDictionary becomes Hashtable when exported to and imported from clixml but no action for a couple of months. As a workaround do not use ordered hashtables but […]
Microsoft PowerShell allows us to create, read and write performance counters via .NET with ease (check PerformanceCounterCategory in System.Diagnostics). However, there are some gotchas when trying it the first time …