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 123

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 ExitCode property cannot return null. Hmm… How is that possible? Let’s try another way it […]

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 code unit aka high surrogate Characters from U+DC00 to U+DFFF – tail surrogate aka second […]