aboutsummaryrefslogtreecommitdiffstats
path: root/coin/provisioning/common/windows/disable-windows-update-assessment.ps1
blob: 8cf6d6fe832ac97232f33df6ebbef9d5d6103c78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# The Windows as a Service (WaaS) Update Assessment Platform provides information on a device's Windows updates.

$limit = (Get-Date).AddMinutes(20)
$path = "C:\Windows\System32\WaaSAssessment.dll"

DO {
    takeown /F $path
    icacls  $path /grant Administrators:f
    Write-host "Deleting $path"

    Try {
        del $path
    }
    Catch [System.UnauthorizedAccessException] {
        Write-host "Access to the path '$path' is denied."
        Continue
    }

    if ((Get-Date) -gt $limit) {
        exit 1
    }

}while (Test-Path -Path "$path")