Category Archives: Scripts

Powershell and Command Prompt

TFS Release Management trigger script fails after upgrade from 2013 to 2015 (Update 3)

We are using TFS 2013 Release Management to do deployements. This works great after some modifications (the out-of-box product isn’t that good). One of the modifications is that we use a PowerShell script to trigger releases instead of the option … Continue reading

Posted in Scripts | Tagged , , | Leave a comment

Setting permissions using ICACLS and PowerShell

  Although PowerShell offers cmdlets to get access control lists (ACL) and modify then, I found it not that convenient. The ICACLS command can also be used within PowerShell to set permissions. Here are some basic examples how to use … Continue reading

Posted in Microsoft General, Scripts | Tagged , | Leave a comment

How to find the port where SQL server is listning using PowerShell

Here is the PowerShell code snippet to find the port where the SQL server is listing:

Posted in Scripts | Tagged , | Leave a comment

How to find out if a PowerShell script is executed as Administrator

Here is a PowerShell code snippet to find out if a script is run as Administrator:

Posted in Scripts | Tagged , , | 1 Comment

How to find the SQL instance using PowerShell and store in a variable

Here is a PowerShell script to find the SQL server instance and store the value in a variable:

Posted in Scripts | Tagged , , | Leave a comment

Store and restore passwords in PowerShell scripts

Security is something that every administrator should take seriously. Clear text passwords in (PowerShell) scripts is not something that is best practice and should be avoided or handled differently. In this post I am going to encrypt a password (not a … Continue reading

Posted in Scripts | Tagged , , , , , , , , , | Leave a comment

How to use Gmail to send PowerShell script notifications

Gmail allows the use of SMTP, we can use SMTP for sending e-mail notifications from within PowerShell. The first step is to register an e-mail address at Gmail. This is a very straight forward step so this will not be … Continue reading

Posted in Scripts | Tagged , , | Leave a comment