0% found this document useful (0 votes)
102 views

Pin and Unpin Apps To The Windows Taskbar With PowerShell - 4sysops

Uploaded by

Chad Dole
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views

Pin and Unpin Apps To The Windows Taskbar With PowerShell - 4sysops

Uploaded by

Chad Dole
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Pin and unpin apps to the Windows

[email protected]

Taskbar with PowerShell (https://twitter.com


Subscribe to Newsletter
Home (https://4sysops.com) / Blog (https://4sysops.com/archives/) / Pin and unpin apps to the Windows Taskbar with PowerShell
4sysops - The online community for SysAdmins and DevOps (https://www.face

PowerShell Security Windows Server 202


(https://www.linke
Free eBook Michael Pietroforte
Free eBook

Limit language Tue, Sep 2 2014 (https://4sysops.com/archives/pin-and-unpin-apps-to- New Roadmap


(https://4sysops.c
Secure connection the-windows-taskbar-with-powershell/)
Fewer Editions
Track abuse More Security
deployment, powershell, modern apps 7 
Download now! Download now!
Microsoft doesn’t officially support programmati-
cally changing the Taskbar pins. However, with
the PowerShell module PinnedApplications from
Jan Egil Ring, you can easily pin and unpin apps
to the Taskbar on Windows 7 and Windows 8.x
computers.

 
(https://twitter.com

(https://www.face

(https://www.linke

(https://4sysops.c
(https://4sysops.com/b55481940f256ccc8356a209e4cb485cjk1sh65x.php?
adclick.g.doubleclick.net%2Fpcs%2Fclick%3Fxai%3DAKAOjsv5qGVCqRXo4BmIQ936fWcuoVysSSR1a
xqZ3T5v9yqur9uimFCOVFGEGUHOJV22VXRq8vhWpGMPyK6Tq--1r9wBGclKI40ME7Uc11ND8gJw19
5v5W1d6tDD9ujFBeTBPUJYSRJvgLs5NFRUjYUUeGKITJC8kExpHDud0bXpivWlhi7hx2s1nqjtVWCc_q
DAMfl-YQMWbchs_8QgKZ22ecWxlJLjdAArjZxpdRkW-To3X0TrQJl6_eN7novcKHla__at5ZksIoCCts9RFs
fbsaeid%255D%26urlfix%3D1%26adurl%3Dhttps%3A%2F%2Fround-lake.dustinice.workers.dev%3A443%2Fhttps%2Flp.scriptrunner.com%2Fen%2Fpowersh
Poster%26utm_source%3D4sysops%26utm_medium%3Dcpm%26utm_term%3DDisplay%2520Ad)
NEW: Big PowerShell cheat sheet for your office wall
6ccc8356a209e4cb485cjk1sh65x.php?url=https%3A%2F%2Fround-lake.dustinice.workers.dev%3A443%2Fhttps%2Fadclick.g.doubleclick.net%2Fpcs%2Fclick%3Fxai%3DAKAOjsv5qGVCq
XF44dlRHfP_TxqZ3T5v9yqur9uimFCOVFGEGUHOJV22VXRq8vhWpGMPyK6Tq--1r9wBGclKI40ME7Uc11ND8gJw19xadkokDu5J5j
W1d6tDD9ujFBeTBPUJYSRJvgLs5NFRUjYUUeGKITJC8kExpHDud0bXpivWlhi7hx2s1nqjtVWCc_qRBeivSNCwWSkHdUZEJDKDHQ
YQMWbchs_8QgKZ22ecWxlJLjdAArjZxpdRkW-To3X0TrQJl6_eN7novcKHla__at5ZksIoCCts9RFsu1u4%26sig%3DCg0ArKJSzL-
%3D%255Bgw_fbsaeid%255D%26urlfix%3D1%26adurl%3Dhttps%3A%2F%2Fround-lake.dustinice.workers.dev%3A443%2Fhttps%2Flp.scriptrunner.com%2Fen%2Fpowershell-poster%3Fu
Poster%26utm_source%3D4sysops%26utm_medium%3Dcpm%26utm_term%3DDisplay%2520Ad)

Author Recent Posts

Michael Pietroforte
(Https://4sysops.Com/Members/Mic
hael-Pietroforte/)
Michael Pietroforte is the founder and editor in
(https://4s chief of 4sysops. He has more than 35 years of
ysops.co experience in IT management and system
m/membe administration.
rs/michae (https://4sysops.com/archives/results-of-the-
l- 4sysops-member-and-author-competition-in-
pietro- 2018/)

forte/)

 
First, copy and paste the PowerShell module
(http://gallery.technet.microsoft.com/scriptcenter/b664
34f1-4b3f-4a94-8dc3-e406eb30b750) to an editor on
your computer. I suggest you save the file to one of (https://twitter.com
your PowerShell module folders. With
$env:PSModulePath, you can get a list of your mod- (https://www.face
ule paths.

(https://www.linke

(https://4sysops.c

9e4cb485cjk1sh65x.php?url=https%3A%2F%2Fround-lake.dustinice.workers.dev%3A443%2Fhttps%2Fadclick.g.doubleclick.net%2Fpcs%2Fclick%3Fxai%3DA
6vptq86Ue4VjXX4ACVwK9kSFCXbJMQKJAZDq8M8k9DzY8GnKyqUZICreSmb9Lh6K9BJzg8pOoKQp3
h6WCtl3ZOU-GCkaN4_PooMbqZbJPnFA5ajGBIohEZryLnwvK5BJt437gLEOshn1dszpRmZeOBZQjtW
sig%3DCg0ArKJSzIb34l13E6REEAE%26fbs_aeid%3D%255Bgw_fbsaeid%255D%26urlfix%3D1%26ad
mpaign%3DPowerShell-Poster%26utm_source%3D4sysops%26utm_medium%3Dcpm%26utm_term%3 

NEW: Big PowerShell cheat sheet for your office wall


481940f256ccc8356a209e4cb485cjk1sh65x.php?url=https%3A%2F%2Fround-lake.dustinice.workers.dev%3A443%2Fhttps%2Fadclick.g.doubleclick.net%2Fpcs%2Fclick%3Fxai%3DAKAO
wK9kSFCXbJMQKJAZDq8M8k9DzY8GnKyqUZICreSmb9Lh6K9BJzg8pOoKQp3ffs7kRLyx8Jy7Exkr6zXHTXPlFtHR1txQIcBTl-DfMn-f
_PooMbqZbJPnFA5ajGBIohEZryLnwvK5BJt437gLEOshn1dszpRmZeOBZQjtWnYqyQ%26sai%3DAMfl-YTXijjs3PAE_mfygqn1-HMO
DCg0ArKJSzIb34l13E6REEAE%26fbs_aeid%3D%255Bgw_fbsaeid%255D%26urlfix%3D1%26adurl%3Dhttps%3A%2F%2Fround-lake.dustinice.workers.dev%3A443%2Fhttps%2Flp.scriptr
Poster%26utm_source%3D4sysops%26utm_medium%3Dcpm%26utm_term%3DDisplay%2520Ad)

1. PS C:\> $env:PSModulePath
2.
C:\Users\administrator\Documents\WindowsP
owerShell\Modules;C:\Program
Files\WindowsPowerShell\Modules;C:\Window
s\system32\WindowsPowerShell\v1.0\Modules
\

In this example, we use


C:\Users\Administrator\Documents\WindowsPowerSh
ell\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:
1.
C:\Users\Administrator\Documents\WindowsP
owerShell\Modules\PinnedApplications\Pinn
edApplications.psm1 (https://twitter.com
Make sure your execution policy is set to unrestricted
(Set-ExecutionPolicy Unrestricted). Next, you can im- (https://www.face
port the module with the Import-Module cmdlet.

1. PS C:\> Import-Module PinnedApplications


2. PS C:\> (https://www.linke
If no error message appears, you are fine. Use the
Get-Command cmdlet to check what commands the (https://4sysops.c
module contains.

1. PS C:\> Get-Command -Module


PinnedApplications
2. CommandType Name
ModuleName
3. ----------- ----
----------
4. 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.

(https://4sysops.com/wp-
content/uploads/2014/09/Get-Help-Set-
PinnedApplication.png)

Get-Help Set-PinnedApplication

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 pin-  
ning 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.
(https://twitter.com
The example below demonstrates how you can pin
Notepad to the Taskbar:
(https://www.face
1. PS C:\> Set-PinnedApplication -Action
PinToTaskbar -FilePath
C:\Windows\system32\notepad.exe
2. PS C:\> (https://www.linke

(https://4sysops.c

(https://4sysops.com/wp-
content/uploads/2014/09/Notepad-pinned-to-

Taskbar.png)

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.

Hi! I am 4sysops AI. Ask a question about this arti-


cle! Powered by GPT 3.5 Turbo.
Members (https://4sysops.com/join/) get free ac-
cess to an augmented ChatGPT 4 trained with the
latest IT content.  
Type your question... Send

(https://twitter.com

(https://www.face

(https://www.linke

(https://4sysops.c

(https://4sysops.com/b55481940f256ccc8356a209e4cb485cjk1sh65x.php?
GFAcgvJ5h9RLBmsefy1oEgBzSdxu_WOYGBqTNJ5s2kKhiWCJVi_h81oBfdjV0Ppyu8eSi4_UJ41ErK72
nuOB6MkkNCCn-gI6HOihGOgzMJgKxNYBG_FOenqjyarpOuav7INb9vGluFW1hi1kMt6pRaTt5D0Zvcys
6BIYuvg5Sjuu5g%26sig%3DCg0ArKJSzLVbQkOSJO0nEAE%26fbs_aeid%3D%255Bgw_fbsaeid%255
mpaign%3DPowerShell-Poster%26utm_source%3D4sysops%26utm_medium%3Dcpm%26utm_term%3
NEW: Big PowerShell cheat sheet for your office wall
Get it now for free! (https://4sysops.com/b55481940f256ccc8356a209e4cb485cjk1sh65x.php?
Ojstr8RTsvwygGFAcgvJ5h9RLBmsefy1oEgBzSdxu_WOYGBqTNJ5s2kKhiWCJVi_h81oBfdjV0Ppyu8eSi4_UJ41ErK72ivV_wMkefTQ
u5m3GTZcjPijjnuOB6MkkNCCn-gI6HOihGOgzMJgKxNYBG_FOenqjyarpOuav7INb9vGluFW1hi1kMt6pRaTt5D0ZvcysibIUY3NERrzw
vg5Sjuu5g%26sig%3DCg0ArKJSzLVbQkOSJO0nEAE%26fbs_aeid%3D%255Bgw_fbsaeid%255D%26urlfix%3D1%26adurl%3Dhttps 
Poster%26utm_source%3D4sysops%26utm_medium%3Dcpm%26utm_term%3DDisplay%2520Ad)

Join the 4sysops PowerShell group!


(https://4sysops.com/groups/powershell?
utm_source=4sysops&utm_medium=endpage&ut
m_campaign=PowerShell&utm_term=member)

Your question was not answered? Ask in the


PowerShell forum!
(https://4sysops.com/groups/powershell/forum/?
utm_source=4sysops&utm_medium=endpage&ut
m_campaign=PowerShellForum)

Articles in series

Remove the Windows Store app


1. Remove Windows Store app from Taskbar with Group  
Policy (https://4sysops.com/archives/remove-windows-store-
app-from-taskbar-with-group-policy/)
2. Remove the Windows Store app from the Start Screen
(https://4sysops.com/archives/remove-the-windows-store-
app-from-the-start-screen/)
(https://twitter.com
3. Pin and unpin apps to the Windows Taskbar with PowerShell

4. Unpin Windows Store app from Taskbar with PowerShell lo-


gon script (https://4sysops.com/archives/unpin-windows- (https://www.face
store-app-from-taskbar-with-powershell-logon-script/)

5. Convert REG to XML to import Registry key into Group


Policy Preferences (https://4sysops.com/archives/convert- (https://www.linke
reg-to-xml-to-import-registry-key-into-group-policy-
preferences/)
(https://4sysops.c
6. Configure pinned programs on the Windows Taskbar with
Group Policy (https://4sysops.com/archives/configure-
pinned-programs-on-the-windows-taskbar-with-group-
policy/)

R E L AT E D A R T I C L E S

 (https://4sysops.com/archives/using- 
(https://4sysops.com/archives/use-
(https://4sys
power-automate-with-the- unattendxml-to-skip-out-of- and-decrypt
powerapps-v2-trigger/) box-experience-oobe-when- vault/)
installing-windows-11/)
Using Power Automate with Encrypt an
the PowerApps V2 Trigger Use unattend.xml to skip Ansible Va
(https://4sysops.com/archives/using-
Out-of-Box Experience (https://4sy
power-automate-with-the- (OOBE) when installing and-decryp
powerapps-v2-trigger/) Windows 11 vault/)

(https://4sysops.com/archives/disable-strict-name-
7 COMMENTS
checking-with-powershell/)
(https://4sysops.com/archives/windows-8-1-august-
Chris Zheng
updates-are-available-again/)
10 years ago
 
Can’t wait to see the next post about
removing store app from taskbar by logon
script!
(https://twitter.com
0

REPLY (HTTPS://4SYSOPS.COM/ARCHIVES/PIN-AND-UNPIN-APPS- (https://www.face


TO-THE-WINDOWS-TASKBAR-WITH-POWERSHELL/?

REPLYTOCOM=289537#RESPOND)

(https://www.linke
Michael Pietroforte
(https://4sysops.com/members/michael-
pietroforte/) (https://4sysops.c
10 years ago

The article is scheduled for this week.

+1

REPLY (HTTPS://4SYSOPS.COM/ARCHIVES/PIN-AND-UNPIN-APPS-

TO-THE-WINDOWS-TASKBAR-WITH-POWERSHELL/?

REPLYTOCOM=289538#RESPOND)

Simon
8 years ago

Hello,
Have this been tested on Win10?

Best Regards,
Simon

REPLY (HTTPS://4SYSOPS.COM/ARCHIVES/PIN-AND-UNPIN-APPS-

TO-THE-WINDOWS-TASKBAR-WITH-POWERSHELL/?

REPLYTOCOM=293694#RESPOND)

Stéphane J.
8 years ago

It doesn’t in W10. Verbs function is unknown.

+1  
REPLY (HTTPS://4SYSOPS.COM/ARCHIVES/PIN-AND-UNPIN-APPS-

TO-THE-WINDOWS-TASKBAR-WITH-POWERSHELL/?

REPLYTOCOM=312076#RESPOND)
(https://twitter.com

Michael Pietroforte
(https://4sysops.com/members/michael- (https://www.face
pietroforte/)
8 years ago

Yes, the module doesn’t work in Windows (https://www.linke


10. You now can pin apps to taskbar with
Group Policy
(https://4sysops.c
(https://4sysops.com/archives/pin-apps-to-
the-taskbar-in-windows-10-1607-with-group-
policy/).

REPLY (HTTPS://4SYSOPS.COM/ARCHIVES/PIN-AND-UNPIN-APPS-

TO-THE-WINDOWS-TASKBAR-WITH-POWERSHELL/?

REPLYTOCOM=312078#RESPOND)

Ryan Dikabo
7 years ago

Hello,

Is it possible to pin folders and shortcuts to


the task bar using this script? For now I’m
only able ton pin .exe

Thanks

REPLY (HTTPS://4SYSOPS.COM/ARCHIVES/PIN-AND-UNPIN-APPS-

TO-THE-WINDOWS-TASKBAR-WITH-POWERSHELL/?

REPLYTOCOM=319896#RESPOND)

Dave
4 years ago
 
I would like to be able to pin icons to the
taskbar using PowerShell within Windows 10
(instead of using group policy).
(https://twitter.com
Is there any way that this can be done within
Windows 10?
(https://www.face
Can you provide a
different PinnedApplications.psm1 file that
will work within Windows 10?
(https://www.linke
+2

REPLY (HTTPS://4SYSOPS.COM/ARCHIVES/PIN-AND-UNPIN-APPS- (https://4sysops.c


TO-THE-WINDOWS-TASKBAR-WITH-POWERSHELL/?

REPLYTOCOM=924000#RESPOND)

Leave a reply

Please enclose code in pre tags: <pre></pre>

Your email address will not be published. Required


fields are marked *

Comment

Name * Email* Website

Notify me of followup comments via e-mail. You can also


subscribe (https://4sysops.com/comment-subscriptions/?
srp=19616&srk=&sra=s&srsrc=f) without commenting.

POST COMMENT  
Receive new post notifications

(https://twitter.com

(https://www.face

Subscribe to Follow 4sysops


Newsletter (https://www.linke

Email Address (https://twitter.com/4sysops/) (https://4sysops.c


Subscribe
(https://www.facebook.com/4sysops)

(https://www.linkedin.com/company/4sysops/)

(https://4sysops.com/feed/)


© 4sysops 2006 - 2024
WindowsUpdatePreventer (https://4sysops.com/windowsupdatepreventer-for-windows)

 

You might also like