Grep on Windows – Searching in all files recursively

There’s no command line tool on Windows like Grep on Linux to search for a specific text in all files recursively. But there’s a simple alternative.


grep -r "peter" *


ls * -r | sls "peter"

Lazy Loading with the Lazy class

Did you know the Lazy class in the System namespace?

This little useful helper was introduced with .NET 4. You can use it to lazy initialize properties.

The ResolvePackagePath()-method gets called if the value is needed the first time.
The property IsValueCreated lets you check if the value is already initialized.

ALM Team Foundation Server VSO

TFS/VSTS agent behind a corporate proxy

Many companies use a http proxy with authentication. Since TFS 2017 the agents are based on .NET Core to be cross-platform. The new agents are unable to obtain the proxy settings from the operating system (Internet Explorer settings).

I’ve found this solution¬†to set a http proxy for the VSTS agents.

  1. Create a file .proxy in the agents root folder and write the proxy in it.


  2. Username and password can be set with environment variables
    [Environment]::SetEnvironmentVariable("VSTS_HTTP_PROXY_USERNAME", "proxyuser", "User")
    [Environment]::SetEnvironmentVariable("VSTS_HTTP_PROXY_PASSWORD", "proxypassword", "User")

    See also the documentation on GitHub.


Sending all e-mails in development environment to a local folder

In the app.config/web.config you can use the configuration section <> <mailSettings> <smtp> to configure how to deliver e-mails which are sent using the MailMessage and SmtpClient classes in your program.

In development environment you usually don’t want the e-mails to be delivered. Today I’ve found a awesome configuration option, which enables that all outgoing e-mails go to an local folder or file share as eml files.

app.config / web.config
Sending an e-mail with .NET
Local pickup folder