PowerShell script to Show icons on Windows 11


xenscrober

Member
Local time
10:55 PM
Posts
6
OS
Window 11
Hello Everyone,
I'm very new to PowerShell Script. I've been tasked to show some icons not all icons via the system Tray, next to the clock and thought using PowerShell deployed via SCCM would be appropriate. I've included an image of what we can enable manually by hand however as we have over 5000 desktops, manual approach is out of the window. Have anyone PowerShell script I could modify for the Appid needed to showup on the system tray please ?
 

Attachments

  • SystemTrayIcons.webp
    SystemTrayIcons.webp
    34.3 KB · Views: 5

My Computer My Computer

At a glance

Window 11OCTA Core 864GB
OS
Window 11
Computer type
PC/Desktop
Manufacturer/Model
IBM, Lenovo, HP
CPU
OCTA Core 8
Motherboard
HP
Memory
64GB
Monitor(s) Displays
2
Screen Resolution
1980 by 1200
Hard Drives
SSD
Keyboard
1
Mouse
1
Internet Speed
1 GB/s
Browser
Chrome and Edge
Antivirus
Sophos
Other Info
Support Engineer
Thank you Pseymour for that quick response and the provided PowerShell link. I have turned on NHS credentials app in the system Tray image below but not sure what I'm supposed to do with this ? Am I supposed to modify the PowerShell script in any way or just run it ?
 

Attachments

  • NHS-Creds.webp
    NHS-Creds.webp
    3.6 KB · Views: 3

My Computer My Computer

At a glance

Window 11OCTA Core 864GB
OS
Window 11
Computer type
PC/Desktop
Manufacturer/Model
IBM, Lenovo, HP
CPU
OCTA Core 8
Motherboard
HP
Memory
64GB
Monitor(s) Displays
2
Screen Resolution
1980 by 1200
Hard Drives
SSD
Keyboard
1
Mouse
1
Internet Speed
1 GB/s
Browser
Chrome and Edge
Antivirus
Sophos
Other Info
Support Engineer
I've updated my script to provide a new command-line option "-List", which reports all apps currently docked on the task tray.
When you know the app's filename, it's possible to select it for hiding or unhiding.

Code:
PS C:\Users\GARLIN\Downloads> .\Set-TrayNotify.ps1 -list
IARegistryEditorTool
IARegistryEditorTool
SecurityHealthSystray
OneDrive
vmtoolsd

PS C:\Users\GARLIN\Downloads> .\Set-TrayNotify.ps1 -hide IARegistryEditorTool OneDrive vmtoolsd
PS C:\Users\GARLIN\Downloads> .\Set-TrayNotify.ps1 -unhide IARegistryEditorTool

The argument list is handled a string match so "IARegistry" works the same as "IARegistryEditorTool" if it's an unique pattern.
 

Attachments

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
Thank you Garlin for your effort and time spent on this for us. I'll go away and work on the script and feedback with any questions or updates on progress.
 

My Computer My Computer

At a glance

Window 11OCTA Core 864GB
OS
Window 11
Computer type
PC/Desktop
Manufacturer/Model
IBM, Lenovo, HP
CPU
OCTA Core 8
Motherboard
HP
Memory
64GB
Monitor(s) Displays
2
Screen Resolution
1980 by 1200
Hard Drives
SSD
Keyboard
1
Mouse
1
Internet Speed
1 GB/s
Browser
Chrome and Edge
Antivirus
Sophos
Other Info
Support Engineer
Hello Garlin, this script works flawlessly on manually running the script from the PowerShell window. The only aspect left for me now to be tested out on SCCM facing over 5000 device is to write another PowerShell script that calls on this with these 4 commands as shown on the image below and I'll test that out with some devices first before deployment Trust wide ?
 

Attachments

  • Progress01.webp
    Progress01.webp
    57.5 KB · Views: 3

My Computer My Computer

At a glance

Window 11OCTA Core 864GB
OS
Window 11
Computer type
PC/Desktop
Manufacturer/Model
IBM, Lenovo, HP
CPU
OCTA Core 8
Motherboard
HP
Memory
64GB
Monitor(s) Displays
2
Screen Resolution
1980 by 1200
Hard Drives
SSD
Keyboard
1
Mouse
1
Internet Speed
1 GB/s
Browser
Chrome and Edge
Antivirus
Sophos
Other Info
Support Engineer
Hello Garlin,

Can I write at the end of the same script to start-Process Start-Process -FilePath C:\System-Tray .\Set-TrayNotify.ps1 -unhide IdentityAgent and repeat this line of code to other 4 commands still to be appended on the same script. Not sure if there's any quotes "" and where on these line of codes ?
 

My Computer My Computer

At a glance

Window 11OCTA Core 864GB
OS
Window 11
Computer type
PC/Desktop
Manufacturer/Model
IBM, Lenovo, HP
CPU
OCTA Core 8
Motherboard
HP
Memory
64GB
Monitor(s) Displays
2
Screen Resolution
1980 by 1200
Hard Drives
SSD
Keyboard
1
Mouse
1
Internet Speed
1 GB/s
Browser
Chrome and Edge
Antivirus
Sophos
Other Info
Support Engineer
Hello Garlin trust your well?, I've tried to run these script with unhide or hide by appending your script with but gave an error - any ideas please ?

1757075321136.webp
 

My Computer My Computer

At a glance

Window 11OCTA Core 864GB
OS
Window 11
Computer type
PC/Desktop
Manufacturer/Model
IBM, Lenovo, HP
CPU
OCTA Core 8
Motherboard
HP
Memory
64GB
Monitor(s) Displays
2
Screen Resolution
1980 by 1200
Hard Drives
SSD
Keyboard
1
Mouse
1
Internet Speed
1 GB/s
Browser
Chrome and Edge
Antivirus
Sophos
Other Info
Support Engineer
Hello Garlin trust your well?, I've tried to run these script with unhide or hide by appending your script with but gave an error - any ideas please ?
@xenscrober
Like in most forums, if you want someone to be aware of your posts, you need to put @ in front of their user name.
 

My Computers My Computers

  • At a glance

    All Branches but ReleaseAMD Ryzen 7 7735HS 3200-4500 Mhz 8 cores x 232 GB DDR5Radeon Graphic / NVIDIA GeForce RTX 4060 8 GB...
    OS
    All Branches but Release
    Computer type
    Laptop
    Manufacturer/Model
    Acer Nitro ANV15-51
    CPU
    AMD Ryzen 7 7735HS 3200-4500 Mhz 8 cores x 2
    Motherboard
    Sportage_RBH
    Memory
    32 GB DDR5
    Graphics Card(s)
    Radeon Graphic / NVIDIA GeForce RTX 4060 8 GB GDDR6
    Sound Card
    AMD/Realtek(R) Audio
    Monitor(s) Displays
    Integrated Monitor (15.3"vis)
    Screen Resolution
    FHD 1920X1080 16:9 144Hz
    Hard Drives
    KINGSTON OM8SEP4512Q-AA 1TB
    Western Digital 256GB
    PSU
    19V DC 6.32 A 120 W
    Cooling
    Dual Fans
    Mouse
    MS Bluetooth
    Internet Speed
    Fiber 1GB Cox -us & 1GB Orange-fr
    Browser
    Edge Canary- Firefox Nightly-Chrome Dev-Chrome Dev
    Antivirus
    Windows Defender
  • At a glance

    Windows 11 BetaAMD A9-94208 GB of DDR4AMD Radeon R5
    Operating System
    Windows 11 Beta
    Computer type
    Laptop
    Manufacturer/Model
    Asus X751BP
    CPU
    AMD A9-9420
    Memory
    8 GB of DDR4
    Graphics card(s)
    AMD Radeon R5
    Screen Resolution
    1600x900
    Hard Drives
    Seagate 1 TB
You can just call the other script with the ampersand operator. If the scripts are in the same folder...

& (Join-Path $PSScriptRoot 'other-script-name.ps1')

with parameters...

& (Join-Path $PSScriptRoot 'other-script-name.ps1') @("One", "Two", "Three")
 

My Computer My Computer

At a glance

Windows 11 Enterprise 25H2 [rev. 8893]
OS
Windows 11 Enterprise 25H2 [rev. 8893]
Code:
Start-Process powershell -ArgumentList "-ExecutionPolicy Bypass -f C:\System-Tray\Set-TrayNotify.ps1 -Unhide IdentityAgent App2 App3"
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
That’s so hideous 🤣🤣
 

My Computer My Computer

At a glance

Windows 11 Enterprise 25H2 [rev. 8893]
OS
Windows 11 Enterprise 25H2 [rev. 8893]
Back
Top Bottom