scloud
scloud copied to clipboard
procative-remediation-creation.ps1
Another minor typo, the file name is procative-remediation-creation.ps1
it should be:
proactive-remediation-creation.ps1
and one more, should the winget upgrade command run in the detection script include the "--accept-source-agreements" argument. I noticed that when initially checking on a new machine I had to accept the source agreements before it would tell me if updates were available, and I see you include it in the remediation script not the detection script.
just tested this and the detection script hung on a new machine, when I added the "--accept-source-agreements" it detected correctly.
So I think the detection script should be like so?
if ($(&$winget upgrade --accept-source-agreements) -like "* $app_2upgrade *") {
Write-Host "Upgrade available for: $app_2upgrade"
exit 1 # upgrade available, remediation needed
}