Category: PowerShell

Add Git Bash (or other) to Windows Terminal

Add Git Bash (or other) to Windows Terminal

This is my quick, 1 minute, method to add ‘Git for Windows’ bashto Windows Terminal. But you can use the same process for any other command line.

  1. Either use the shortcut CTRL+, or the menu to open the settings.json
  1. This will open the settings.json file in you default editor.
  2. Now generate a new GUID by either
    1. go to https://www.guidgenerator.com/online-guid-generator.aspx or
    2. Enter [guid]::NewGuid() into the PowerShell terminal window
  1. Add the following json to the bottom of the “Profile”:”List” section
,
{
  "guid": "{REPLACE THE GUID HERE WITH YOUR ONE}",
  "hidden": false,
  "name": "Git bash",
  "icon": "C:\\Program Files\\Git\\mingw64\\share\\git\\git-for-windows.ico",
  "commandline": "C:\\Program Files\\Git\\bin\\bash.exe",
  "colorScheme": "One Half Dark",
  "startingDirectory": "%USERPROFILE%"
}
  1. Remember to replace the GUID with the one you created earlier.
  2. Save the file and you should now see the option in the drop down.

If you want this to be your default terminal, then just add the GUID to the “defaultProfile” setting in the json file and save.

I used a simple colour scheme to distinguish this terminal from the other. I also changed the PowerShell one by adding

"colorScheme": "Campbell Powershell"

to that profile to bring back the good ol’ blue background 😉

This is just the tip of the iceberg. You can customise Windows Terminal to your hearts delight.

For more details see the full Windows Terminal docs here https://docs.microsoft.com/en-gb/windows/terminal/

Keeping your managed PC from locking all the time

I know you shouldn’t try and subvert your companies internal security policies, but sometimes the security department just don’t seem to understand the consequences of what they do…especially when using multiple computers simultaneously!

The following script essentially presses the inaccessible F15 key at regular time intervals to ensure the screen timeout is reset and you avoid locking out.

Continue reading “Keeping your managed PC from locking all the time”
‘*** Execution Timeout Expired’ with SqlPackage.exe on Azure DevOps Release Pipeline Fix

‘*** Execution Timeout Expired’ with SqlPackage.exe on Azure DevOps Release Pipeline Fix

A while ago I was having an issue deploying a SQL Data Tools project using the Azure DevOps pipelines. It worked fine when there was no data in the database, but once there was some data to preserve in the release the DACPAC deployment started to timeout with the following error when running SqlPackage.

Continue reading “‘*** Execution Timeout Expired’ with SqlPackage.exe on Azure DevOps Release Pipeline Fix”

Resource Tag management in Microsoft Azure

Adding tags to resources in Azure is generally a good idea. This helps administrators manage billing, knowing what things are and when they can be safely decommissioned etc..

I have includes here some guidance and useful scripts for adding tags and managing tags on resources and resource groups.

Continue reading “Resource Tag management in Microsoft Azure”

Azure Active Directory – How to give a Registered Application an AD Directory Administrative Role

By default a ‘Registered Application’ account is not a member of any Directory Roles and/or group memberships and there is no easy way to make these changes using the portal. You may have an API or back-end application that will be required to perform actions on your AD that requires elevated permissions (e.g. Reset passwords or delete accounts etc..)

Normally for advanced configuration, you will need to start editing the manifest file. Luckily this has been made easy using the Portal. You can now edit the file directly, or download, make changes and then upload.

However, to make a ‘Registered Application’ a member of a ‘Directory Administrative Role’ you need to use PowerShell to add the role member to the ‘Service Principal’ (as I couldn’t find a way to do this in the manifest!).

Continue reading “Azure Active Directory – How to give a Registered Application an AD Directory Administrative Role”

How to delete an Azure Active Directory (ADD) Tenant

You may have discovered that deleting an Azure Active Directory is a particularly frustrating experience that ultimately ends in failure. The new portal have improved things a bit, by running through a series of check before the delete button is enabled.

You may need to go back to the Classic portal (https://manage.windowsazure.com) to see some of the objects/resources to delete.

However, although this will help you remove ‘most’ of what you need to, unfortunately NOT all!

In this case I got a “Unable to delete directory

Continue reading “How to delete an Azure Active Directory (ADD) Tenant”