Adding Exchange Online PowerShell to Windows Terminal

Windows Terminal, makes it easy to manage command-line environments and allows you to run multiple sessions in a single window. Exchange Online PowerShell'I Windows Terminalby adding:

  • You can get quick access.
  • You can easily switch between terminal sessions.
  • You can automate your commands with a customized profile.

Previously Exchange Online PowerShell Module from the installation and Exchange Online PowerShell We mentioned the link, you can access the relevant articles via the links below;

What is a GUID and How is it Created?

GUID (Globally Unique Identifier)is a unique ID number for each profile. In Windows Terminal, each profile must have a unique ID number GUID you must use. GUIDis a randomly generated set of numbers and should have a different value in each profile.

Playing Run PowerShell as Administrator You need to run it as and then use the following commands: GUID You can create.

New-Guid
PS C:UsersCengizYILMAZ> New-Guid

Guid
----
b3bd8e4c-6a17-421d-b1c6-a33a7482e8aa


PS C:UsersCengizYILMAZ>
17 picture

Created GUID' in Windows Terminal JSON We will need to use it when editing.

Add Exchange Online PowerShell by Editing a Windows Terminal JSON File

To add a new profile in Windows Terminal JSON You need to edit the configuration file. You can follow the steps below;

  1. Open Windows Terminal
  2. Access the Settings Menu: Click on the drop-down menu in the upper right corner and Settings Select the option.
  3. Edit JSON File: In the settings menu, bottom left OpenJSON File Click on the option. This will take you to settings.json will redirect you to the file.
18 picture

You can then add the following commands to an appropriate profile range in the opened JSON file.

            {
                "guid": "{b3bd8e4c-6a17-421d-b1c6-a33a7482e8aa}",
                "name": "Exchange Online PowerShell",
                "commandline": "powershell.exe -NoExit -Command "Import-Module ExchangeOnlineManagement; Connect-ExchangeOnline"",
                "icon": "ms-appx:///ProfileIcons/{61c54bbd-c2c6-5271-96e7-009a87ff44bf}.png",  
                "startingDirectory": "%USERPROFILE%",
                "hidden": false,
                "useAcrylic": true,
                "acrylicOpacity": 0.65
            },

My current JSON file looks like below

19 picture

If you are constantly connecting with a single Exchange Online Tenant, you can edit the JSON file as follows;

[email protected] You can replace the section with your own admin information.

            {
                "guid": "{f1b08b12-5d41-4c4b-9f9a-9d8ad75a1bc8}",
                "name": "Exchange Online PowerShell",
                "commandline": "powershell.exe -NoExit -Command "Import-Module ExchangeOnlineManagement; Connect-ExchangeOnline -UserPrincipalName [email protected]"",
                "icon": "ms-appx:///ProfileIcons/{61c54bbd-c2c6-5271-96e7-009a87ff44bf}.png", 
                "startingDirectory": "%USERPROFILE%",
                "hidden": false,
                "useAcrylic": true,
                "acrylicOpacity": 0.65 
            }

After saving the JSON file, close it. Now the “Exchange Online PowerShell” profile will be added to Windows Terminal.

20 picture

You can facilitate your Exchange Online PowerShell profile connections via Windows Terminal.

21 picture

In this article, we talked about adding an Exchange Online PowerShell profile by editing a JSON file on Windows Terminal.


Similar Posts – Adding Exchange Online PowerShell to Windows Terminal

Comment