Comments (3)
Thank you for the suggestion.
I usually suggest using the collections in configmgr for this purpose, but I see how collection refreshes combined with how often hardware inventory is run can results in unwanted toast notifications. Added to my 'might do-list'. Another possibility is that I add the option to only allow the toast notification to run once a day regardless of how the deployment schedule in configmgr may be configured.
from toast-notification-script.
It should be easy modification. Just add this code at start of function Display-ToastNotification:
if ($RunApplicationIDValue -and $RunApplicationIDEnabled -eq "True") {
$TestApplicationID = Get-CimInstance -ClassName CCM_Application -Namespace ROOT\ccm\ClientSDK -ea SilentlyContinue | Where-Object { $_.Id -eq $RunApplicationIDValue }
if ($TestApplicationID -and $TestApplicationID.InstallState -eq "Installed") {
Write-Log -Message "Application $RunApplicationID is already installed. Toast notification won't be displayed"
return
}
}
So in case, that you define RunApplicationID XML tag, and such application will be already installed, notification won't show.
Of course this code can be placed earlier in the New-ToastNotification script, for sake of better effeciency..
from toast-notification-script.
I went a slightly different route and added the following code towards the end of the script, just before it defaults to the fallback toast notification.
# Toast used for Application installation
if ($RunApplicationIDValue -and $RunApplicationIDEnabled -eq "True") {
$TestApplicationID = Get-CimInstance -ClassName CCM_Application -Namespace ROOT\ccm\ClientSDK -ErrorAction SilentlyContinue | Where-Object { $_.Id -eq $RunApplicationIDValue }
if ($TestApplicationID -and $TestApplicationID.InstallState -eq "Installed") {
Write-Log -Message "Application $RunApplicationIDValue is already installed. Toast notification won't be displayed"
}
else {
Write-Log -Message "Application $RunApplicationIDValue is not installed. Displaying toast notification"
Display-ToastNotification
}
# Stopping script. No need to accidently run further toasts
break
}
from toast-notification-script.
Related Issues (20)
- Feature request "vanilla config" HOT 1
- Reboot button action do not install updates pending reboot. Think I found a solution that works for me. HOT 1
- Hidden.vbs is detected as malware HOT 2
- Log Action in log file HOT 9
- Select-Object : Property "#text" cannot be found.
- Get-Culture vs. Get-UICulture
- reboot MSI package missing from ZIP
- Images not loaded when on share HOT 2
- Pending reboot detection HOT 1
- Run as non-admin? HOT 4
- The pending reboot doesn't work ok on new W10 builds with new shutdown menu.
- The PendingFileRename registry key check should be removed from the reboot check
- bug if running RunToastHidden.cmd on 64bit OS from 32bit context
- Notifications deployed through InTune Win32 packaged installers in a SYSTEM context don't have sufficient folder rights for the unelevated user to run the notification script
- Windows 11 22H2 - Toasts not displayed HOT 2
- Need a solution to limit the number of times snooze can be used. HOT 1
- Start an EXE on local machine
- Notification is displayed even when application is already installed
- Work on Win 11 23H2? Is this script still working?
- Unable to configure parameters for protocol InvokePSScriptAsUser HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toast-notification-script.