Yes you can. I tried to customise my PowerShell terminal, Developer PowerShell terminal and CMD terminal with ASCII art. The way you can do this is to hack the terminal a little bit. I will give the way in which you can do this for each terminal inside Windows Terminal. For all these types of applications, the script must be executed as a parameter for their specific applications.
PowerShell terminal
You need to pass the script as a parameter to the powershell.exe the PowerShell script and give to the argument the "PowerShell -NoExit" attributes. You need to do this because PowerShell will pass its execution flow to the script and once the script finished its execution, the PowerShell will stop.
%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe PowerShell -NoExit %SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\PowerShell_Startup_Ascii_Art.ps1
Replace the above shown PowerShell script's path with your PowerShell script's path and introduce this command inside the command line section within the settings page in the PowerShell profile or within the JSON configuration file commandline section at the PowerShell profile.
PowerShell settings page script execution method [1]
https://i.sstatic.net/oifhS.png
PowerShell settings page script execution method [2]
https://i.sstatic.net/J2OsV.png
PowerShell JSON settings file script execution method [1]
https://i.sstatic.net/5LA8X.png
PowerShell JSON settings file script execution method [2]
https://i.sstatic.net/SgHoc.png
PowerShell JSON settings file script execution method [3]
https://i.sstatic.net/H9tuk.png
PowerShell terminal ASCII art script execution result
Each time PowerShell will start in Windows Terminal the script with the ASCII art will start too
https://i.sstatic.net/GCbeF.jpg
Developer PowerShell terminal
In order to run a script at Developer PowerShell terminal's startup you will need to run your script by passing it as an argument to powershell.exe as with PowerShell.
%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe PowerShell -NoExit %SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\Developer_PowerShell_Startup_Ascii_Art.ps1
The only thing that is differing is the fact that the Developer PowerShell is importing some modules that contain compilers, package-managers and different tools for different programming languages. This is done by passing a script as an argument to powershell.exe when Developer PowerShell is launched by default. Because we already launch a script, we need to import the modules to the instance of PowerShell that is running in our script. The example shown bellow is exemplifying how to import the aforementioned modules inside the instance of PowerShell in a script:
$block = @"
.^!777777777777777777777777777777777777!^.
.?55555555Y?J5555555555555555555555555555J:
!5555555Y^ :7Y55555555555555555555555557.
:J55555555!. :7Y5555555555555555555555Y:
!5555555555Y!. :7Y555555555555555555557
:Y555555555555Y!. :7Y55555555555555555Y:
!555555555555555Y!. :7Y5555555555555557.
:Y55555555555555555Y!. .!5555555555555Y:
!5555555555555555555J^ :Y5555555555557.
:Y5555555555555555J!: :!J5555555555555Y:
!55555555555555?~: :!J55555555555555557.
:Y5555555555Y?~: :!J555555555555555555Y:
755555555Y?~: :!JJJJJJJJJJJJY5555555557.
:Y5555555!. :!J55555555555555555555555Y:
.7555555557:.^!J555555555: J55555557.
:Y555555555555555555555555555555555555555J:
.^!777777777777777777777777777777777777!^.
"@
Write-Host $block -ForegroundColor Blue
PowerShell -NoExit "& 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\Launch-VsDevShell.ps1'"
At the end of the scripts' execution, the modules are imported with the attribute "PowerShell -NoExit" in order to ensure that the PowerShell instance will stay open once the modules finished importing.
PowerShell -NoExit "& 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\Launch-VsDevShell.ps1'"
The implementation of the script execution at Developer PowerShell startup is done the same way as in PowerShell.
PowerShell terminal ASCII art script execution result
Each time Developer PowerShell will start in Windows Terminal the script with the ASCII art will start too
https://i.sstatic.net/yLUWA.jpg
Command Prompt terminal
Usually command prompt ASCII art scripts and other scripts are done with BATCH files, but because BATCH is old and unstable I recommend using PowerShell scripts that are executed within Command Prompt. In order to do this you need to run PowerShell as a command argument for the cmd.exe. Within the argument passed to cmd.exe you must pass as an argument to powershell.exe the script you want to execute.
%SystemRoot%\System32\cmd.exe cmd /k "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe cmd-startup-logo-ascii-art.ps1"
The PowerShell script passed as an argument to the powershell.exe within the cmd.exe argument is "cmd-startup-logo-ascii-art.ps1". The script passed as an argument to powershell.exe is not run with the PowerShell -NoExit attribute in order not to pass the control flow to PowerShell in order for the control flow to remain in cmd.exe. Replace the aforementioned script with your desired script.
The PowerShell script running in CMD:
$block = @"
JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@: :@@@
@@@YJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJY@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@^..........................................^@@@
@@@: :@@@
@@@: .. .. :@@@
@@@: .!YP5PP5P: .P&7 :@@@
@@@: !#B?^...:^ JJJ. :#@~ :@@@
@@@: !@P. &@@: ~&&^ :@@@
@@@: G@! 7@B: :@@@
@@@: P@? JJJ. ?@P. :@@@
@@@: ^#&! &@@: Y@Y :@@@
@@@: :YBGY?77?Y: ... .P@J :@@@
@@@: .^!7??7~. :JJ. :@@@
@@@: :@@@
@@@. .@@@
@@@YJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJY@@@
&&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&
..................................................
"@
Write-Host $block -ForegroundColor White
In order to launch the script at startup pass the above shown command used to launch the powershell script in cmd.exe in the Command Prompt section of the Windows Terminal settings using the same procedures shown in the PowerShell example shown above.
Command Prompt terminal ASCII art script execution result
Each time Command Prompt will start in Windows Terminal the script with the ASCII art will start too
https://i.sstatic.net/pksBS.jpg
.bat
file will execute within a CMD shell that will terminate when it finishes. What does Windows Terminal have to do with it?.bat
files, when executed, open the CMD shell in the Windows Console terminal. The question is really how to make it default to Windows Terminal instead of Windows Console. Same for PowerShell/ps1 files, of course..ps1
and.bat
commands. The syntax for opening a new Windows Terminal session and launching a PowerShell script would bewt new-tab powershell.exe -f c:\path\to\script.ps1
. That will end up as something likewt new-tab powershell.exe -f %1
in the registry entry. There's some more info here on the "Run with PowerShell" Registry entries.