asjimene / patch-my-pc-prescript-notification Goto Github PK
View Code? Open in Web Editor NEWScript to notify a user to close an application during an update.
License: MIT License
Script to notify a user to close an application during an update.
License: MIT License
Hi, I tested your scripts with patch my PC , but it does nothing, after some research and after sign all the products Prescripts still doing nothing.
Then I realized those PoSH scripts create another scripts on the fly. AppUpdateClosePS.ps1, CancelUpdatePS.ps1 and Update-ToastNotification.ps1 , and probably in our environment those should be signed too.
So I'm trying to face this in a different way, I'm building those scripts apart from the main script, sign them and distribute to clients on that programdata path. Then the Product-prescript.ps1 script will only create the .vbs the .cmd adn the .xml files.
For the CancelUpdatePS.ps1 nothing really to do
For the AppUpdateClosePS.ps1 I modified the creation of the AppUpdateClose.cmd in the script:
$procstring = ("
"$($processes -join '","')"").Replace('""','"') $appupdateclose = @" powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -WindowStyle Hidden -File "$env:ProgramData\PMPC\AppUpdateClosePS.ps1" -Processes $procstring "@
So Now it passes the processes to kill as an array to the AppUpdateClosePS.ps1 (and this has ben modified accordingly)
param([string] $Processes) $ProcArray = ($Processes.ToString()).Split(",") $ProcArray | ForEach-Object { Get-Process | Where-Object Path -Like "*
$_" | Stop-Process -Force}
New-Item -ItemType File -Path "$env:ProgramData\PMPC\ButtonClicked" -force`
And NOW, the question before following the work, in this sentence:
$ToastNotificationScript.Replace("%CloseAppVariable%", "$CloseAppVariable") | Out-File -FilePath "$env:Programdata\PMPC\Update-ToastNotification.ps1" -Encoding oem -Force
What this exactly do ??
$CloseAppVariable is a boolean
It means it will ouput nothing to the out-file ??
there is no that %CloseAppVariable% at $ToastNotificationScript array....
Is that something I should pass to the Update-ToastNotification.ps1
Please if you could guide me so we can test these modifications and use you nice scripts ?? please
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.