Getting the server response when Invoke-Webrequest results in error 5xx

Hi there, lately, I’ve been confronted with a problem where I simply couldn’t get meaningful error messages from failing runs of Invoke-Webrequest. In doing something like this:

$err would only ever contain the error code like “500 bla”, but not what the server actually returned as the error message. I was querying a REST […]

Read More

Testing IMAP4 + TLS + AUTH with cygwin (or linux), Thunderbird debug

From time to time I have to do some troubleshooting for the IMAP4 protocol on our Exchange infrastructure. Most of the clients are running Thunderbird. For this purpose you can do two things. Start Thunderbird in debugging mode As described in this wiki article, create a batch with the following content:

This will generate […]

Read More

Use Powershell and 7-zip to zip up files in a directory individually

Today I needed to put the files I had in a directory into zip files, each one in its own archive. After fiddling around with how to quote and double quote stuff in PoSh I found this link on the technet forums. See Section 5 there. This is how it’s done:

$arg1…$arg4 are the […]

Read More

Windows admin’s heaven: chocolatey.org

Recently, Microsoft issued Windows Management Framework v5 preview, which introduces a Powershell module called OneGet: “OneGet is a new way to discover and install software packages from around the web.” OneGet itself in its first version introduces the repositories from chocolatey.org. To explain what Chocolatey is, the analogy to apt or apt-get in Debian linux […]

Read More

Browser with a small memory footprint

Been searching for a small memory footprint web browser for quite a while, and finally found Slimboat. It’s webkit based. I haven’t done extensive memory comparison, but with 5 open tabs on different websites, and the ad blocker active, it uses around 150MB… FF uses >500MB at all times 😉

Read More

How to delete files older than x

Something I regularly need to do is search for files that are older than a certain amount of time and do something with them, like move or delete. Here’s a handy snippet how to do it in PoSh.

The question mark is an alias for Where-Object, -le means “less than or equal”, and AddMinutes […]

Read More