Monthly Archives: June 2014

PowerShell Start-Job WTF

Hi folks Another WTF… Let’s consider the following scenario: Script1.ps1 Script2.ps1 Script3.ps1 Now we want to modify Script1.ps1 to run Script2.ps1 asynchronously Let’s modify line #13 If we run Script1.ps1 it fails with Stack trace is not helpful at all. … Continue reading

Posted in Uncategorized | Tagged , | 2 Comments

PowerShell Start-Process WTF

Hi folks Another WTF… Let’s try And it returned nothing. As I described in the previous blogpost, this means that some exception occurred returns That is a known PowerShell bug: Start-Process: http://connect.microsoft.com/PowerShell/feedback/details/585549/start-process-passthru-return-value and http://connect.microsoft.com/PowerShell/feedback/details/520554/start-process-does-not-return-exitcode-property And here is the workaround returns … Continue reading

Posted in Uncategorized | Tagged , | Leave a comment

PowerShell .NET property access swallows exceptions

Hi folks Recently I discovered some WTF which I would like to discuss. then check returns nothing returns True Let’s check the type of ExitCode property returns So we see a return type is System.Int32 which is not nullable. So … Continue reading

Posted in Uncategorized | Tagged , | 1 Comment

My old NUnit “pull request”

Hi folks I remember four years ago I didn’t know how to create pull requests so I’ve manually described how to fix a bug https://bugs.launchpad.net/nunitv2/+bug/666800 And the author created a commit https://github.com/nunit/nunitv2/commit/142a775ed617e6ab3e119e62ff332e2d983c6399 Unfortunately the commit does not have any mentions … Continue reading

Posted in Uncategorized | Leave a comment

NUnit pull request

Hi folks I’ve created my first NUnit pull request https://github.com/nunit/nunit-framework/pull/146

Posted in Uncategorized | Leave a comment

Escaping Invalid XML Unicode characters

Hi folks Recently I discovered a bug in NUnit Basically the issue caused by the fact that NUnit may create a XmlDocument with Unicode characters that are not valid in XML. To fix the issue we need to either strip … Continue reading

Posted in Uncategorized | 24 Comments

Stripping invalid characters from UTF-16 strings

Hi folks The more you work with Unicode the more discoveries you can make. .NET System.Char represents a character as a UTF-16 code unit. UTF-16 has a concept of surrogates: Characters from U+D800 to U+DBFF – lead surrogate aka first … Continue reading

Posted in Uncategorized | 3 Comments