You will need at least version 3 of PowerShell to run these scripts.
Here is what you will need to do in the Windows PowerShell Graphical User Interface window as an administrator. To pin apps like Microsoft Office Applications, Outlook or games using a PowerShell script, you will need to point the script to the path of the application executable. Method 1 offers a way to only pin apps that come with windows or are downloaded from the store. Method 2: Pin apps on Windows applications using PowerShell script
These scripts will work for most of Windows 10 apps, but it will not work if your apps are not installed (i.e., are just links to the store) you will need to turn off consumer experience in the group policy here “Computer Configuration > Policies > Administrative Templates > Windows Components > Cloud Content > Turn off Microsoft consumer experiences.” This will be set as default for new accounts in your computer. To run your saved script on a computer without having to reopen Windows PowerShell, right click on the script file you saved, and choose ‘Run with PowerShell’.Choose a location and type the name of your file in the window that appears. To save the script, go to file > Save As.To run the script, click on the Run Script button (play button) on toolbar (if not available, you can set its visibility from the view menu).
These scripts are similar to command prompt batch scripts. The first is the use of cmdlets (lightweight command used in the Windows PowerShell environment command line) and the second is the use of scripts that you can save and run later or on another computer. Windows PowerShell offers two ways of executing your commands. Anyone could now develop commands to use with PowerShell. PowerShell was made open-source and cross-platform on 18 August 2016 after initially being a Windows component only. NET framework and it includes a command-line shell and a scripting language. Windows PowerShell is a shell program developed by Microsoft to automate tasks and configuration management.