Install Windows Updates using PowerShell

Install Windows Updates using PowerShell

In this post I show you how to use PowerShell to install Windows Updates. Quickly and silently. This makes the use of PSWindowsUpdate module perfect for your day to day automation. The module even supports scheduling (on remote computers too!), it has the ability to search WSUS and Windows Update for updates, scheduling and performing the download and installation of updates.

Send email with PowerShell

In this post I provide you with a small PowerShell function you can use to send email over a TLS secured SMTP connection with SMTP authentication. As a framework you can use in your own scripting and extend it. You can even create a PowerShell module of it.
PowerShell 5.0

Emulate ternary operator in PowerShell

Emulate ternary or conditional operator in PowerShell 5. It takes three operands: a condition followed by a question mark (?), then an expression to execute if the condition is truthy followed by a colon (:), and finally the expression to execute if the condition is falsy. This operator is frequently used as an alternative to an if...else statement.

MySQL Connector/ODBC C# test script

Whenever you need to test your ASP.NET connection to your MySQL database, using ODBC, you can use the following C# test script. Currently it uses MySQL ODBC 8.0 Unicode Driver, but you can easily change the version used. As a bonus it prints some connection information and it requires an SSL connection to your MySQL database (SslMode=REQUIRED).

Working with file attributes in PowerShell

Here is how to use Get-Item and Get-ItemProperty in PowerShell to perform and streamline day to day tasks like installing or updating software based on file versions. Working with PowerShell's Get-ItemProperty to get file attributes may boost your work productivity. It's often easier to getting things done if you have a more generic way of doing something. I also address changing timestamps on files in short.