PowerShell tips: Sending emails in PowerShell

In today’s fast-paced IT environments, automating routine tasks is not just beneficial; it’s essential. One of the most common automation tasks is sending emails. PowerShell, with its versatile cmdlets and scripting capabilities, provides a powerful tool for this purpose. This article delves into how you can leverage PowerShell to send emails, both with and without

Read More

C# Detect HTTPS in a load balanced environment

Detecting HTTPS in your asp.net c# web app is fairly straight forward in a normal environment with a single server solution, as you can see from the below example: if (HttpContext.Current.Request.IsSecureConnection) { Response.Write("Using HTTPS"); } else { Response.Write("Using HTTP"); } The problem comes when your web application is on multiple servers and behind a load

Read More

How to delete files by age with PowerShell

You can easily use PowerShell to delete files that are older than x minutes/hours/days. This is useful if you have a temporary folder which you would like to regularly clear down. Please see the below examples: Delete files older than x minutes Get-ChildItem -path C:\temp | where {$_.Lastwritetime -lt (date).addminutes(-5)} | remove-item Delete files older

Read More

Force the compatibility mode in IE8

If your website doesn’t display properly in IE8, then it’s recommended that you amend your code, but in the meantime you could force Internet Explorer 8 to run in the compatibility mode. Simply add the below line to the top of the <head></head> section of your website: <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> An example of this is place would be:

Read More

Bullet point spacing with css

To increase the spacing between bullet points with CSS simple add the below code to your .css file: ul li { margin:.5em 10% .5em 0; } Obviously you can change the values to reach your desired spacing, but the above works well and looks neat and tidy. An example using this method would look like

Read More

Enable Browsers to see XML/RSS feeds

If you want internet browsers to recognise your XML/RSS feeds as soon as a visitor reaches your website, then this article is for you. Browsers such as Internet Explorer 7 have XML/RSS functionality built in and you can make the most of this by enabling the feed button on the toolbar. To do this, all

Read More