PowerShell – Get a file’s MD5 checksum

To get a file’s MD5 checksum, you can use Get-FileHash. This has been available since PowerShell v4. Use it like this: This file’s MD5 checksum is AE34D271ACC9C242BC9EED2E0EA72093. If Get-FileHash isn’t available Get-FileHash was put in PowerShell v4. If you’re on an earlier version, you’ll get following error when you try to use this: Get-FileHash is … Read more

PowerShell – Saving SQL query results to a CSV file

Here’s how to execute a SQL query and export the results to a CSV file: If Invoke-SqlCmd is missing, install the SqlServer module If it’s complaining about not having Invoke-SqlCmd available, you will need to install the SQL Server PowerShell module. 1 – Run PowerShell as administrator 2 – Add Microsoft’s PSGallery as a trusted … Read more