scloud icon indicating copy to clipboard operation
scloud copied to clipboard

procative-remediation-creation.ps1

Open saqib-s opened this issue 1 year ago • 1 comments

Another minor typo, the file name is procative-remediation-creation.ps1

it should be:

proactive-remediation-creation.ps1

saqib-s avatar Nov 21 '23 23:11 saqib-s

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
}

saqib-s avatar Nov 22 '23 00:11 saqib-s