Sunday, 8 March 2020

Adding Powershell7 to Windows Terminal

Hey,

Lets quickly go through on how to add the new Powershell7 which is GA.
If you have not downloaded , get it from here https://github.com/PowerShell/PowerShell


Open Terminal as Administrator.





Select the Settings 





It would open the settings JSON file called profiles.json.

Before adding the Powershell7,

1.We need a new GUID to set this for PowerShell7.
2. We need to know the location of the PowerShell7 executable.
3. Optional , If you want to add an icon/change settings /colors etc.

1.In Powershell run New-Guid





2.Get the path of the executable.





3. Optional [Icon]

These icons would be under 'assets'







Making the changes in the Profiles.json.

Go to the 'Profiles' section in the JSON
Example:





Prepare your code as below.

{
            "acrylicOpacity" : 0.5,
            "closeOnExit" : true,
            "commandline" : "C:\\PowerShell7\\7\\pwsh.exe",
            "fontSize" : 12,
            "guid" : "{9a5af5e5-eecf-40d3-baec-db915dee4ba3}",
            "historySize" : 9001,
            "icon" : "C:\\PowerShell7\\7\\assets\\Powershell_av_colors.ico",
            "name" : "PowerShell-7",
            "padding" : "0, 0, 0, 0",
            "snapOnInput" : true,
            "startingDirectory" : "%USERPROFILE%",
            "useAcrylic" : false,
            "hidden" : false
        },

Add the code based on your executable path, GUID generated and ICONs folder.

Save the profiles.json.

Launch the Terminal again!





Selecting






-Happy Scripting.

No comments:

Post a Comment