- Poll: How reliable are ChatGPT and Bing Chat? - Tue, May 23 2023
- Pip install Boto3 - Thu, Mar 24 2022
- Install Boto3 (AWS SDK for Python) in Visual Studio Code (VS Code) on Windows - Wed, Feb 23 2022
First, copy and paste the PowerShell module to an editor on your computer. I suggest you save the file to one of your PowerShell module folders. With $env:PSModulePath, you can get a list of your module paths.
PS C:\> $env:PSModulePath C:\Users\administrator\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
In this example, we use C:\Users\Administrator\Documents\WindowsPowerShell\Modules. You have to create a folder with the name PinnedApplications in the module folder and then save the file as PinnedApplications.psm1 to this folder. This would be the file path:
Make sure your execution policy is set to unrestricted (Set-ExecutionPolicy Unrestricted). Next, you can import the module with the Import-Module cmdlet.
PS C:\> Import-Module PinnedApplications PS C:\>
If no error message appears, you are fine. Use the Get-Command cmdlet to check what commands the module contains.
PS C:\> Get-Command -Module PinnedApplications CommandType Name ModuleName ----------- ---- ---------- Function Set-PinnedApplication PinnedApplications
From now on, you can use Set-PinnedApplication to pin and unpin apps to the Windows Taskbar.
With Get-Help Set-PinnedApplication, you get an overview of the cmdlet.
The synopsis indicates that the cmdlet was made for Windows 7 and Windows 2008 R2. I tried the module with Windows 8.1, and it appears to work fine for pinning and unpinning apps to the Taskbar. However, in my tests, the actions PinToStartMenu and UnPinFromStartMenu didn’t work on Windows 8.1 but worked well on a Windows 7 machine.
The example below demonstrates how you can pin Notepad to the Taskbar:
PS C:\> Set-PinnedApplication -Action PinToTaskbar -FilePath C:\Windows\system32\notepad.exe PS C:\>
Notepad pinned to Taskbar
Wouldn’t it be wonderful if you could unpin the Store app from the Taskbar with PowerShell? It is not easy as one might think. In my next post, I show you how you can use the Set-PinnedApplication function of Jan Egil Ring’s module in a logon script so you can unpin the Store app on all computers in your network.