This tutorial will show you how to create a shortcut to run a command or a set of commands on PowerShell (Powershell Script Shortcut).
<aside> âšī¸ Note: I created this tutorial solely for my personal reference. It may contain errors, mistakes, or incomplete information. Use it if still you find it helpful.
Created by @menukaonline (GitHub) / (Reddit)
</aside>
For this tutorial, we will create a PowerShell script to restart the taskbar (or Windows Explorer) and make it more accessible by creating a shortcut for it.
Create a PowerShell script with any name using the extension .ps1 .

Add relevant commands to the PowerShell script and save it.

Create a shortcut of this file and give it a relevant name.

Right click on the shortcut and go to Properties. Under the Shortcut tab, there you will find the Target field.

Target field displays the location of the source file (in this case, the PowerShell script we just created).
"C:\\SoftwareData\\CMDAlias\\PowerShell Scripts\\restart-explorer.ps1"
Change it as shown below to tell the system to launch PowerShell and then run the script.
powershell.exe -ExecutionPolicy Bypass -File "C:\\SoftwareData\\CMDAlias\\PowerShell Scripts\\restart-explorer.ps1"
Now press OK button to save changes.
Then save the shortcut and move it to where you want to run it from. Additionally you can change the icon of the shortcut as per your choice.
<aside> đ This tutorial is created reading the following pages.