Intune Initial Scripts Backup

This commit is contained in:
2025-04-21 14:21:38 -04:00
commit 71764cd10f
241 changed files with 28218 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Install-Module pswindowsupdate
Import-Module pswindowsupdate
$scheduledTaskState = (Get-ScheduledTask -TaskName "PSWindowsUpdate").state
try {
if (((Get-WindowsUpdate -Title "Windows 11, version 23H2").status -eq "-D-----") -and ($scheduledTaskState.value -ne "Ready")) {
Write-Host "Update Downloaded but not scheduled"
Exit 1
}
elseif ($scheduledTaskState.value -eq "Ready") {
Write-Host "Update Downloaded and Scheduled"
Exit 0
}
Write-Host "Not Compliant"
Exit 1
}
catch {
Write-Host "Not Compliant - Catch"
Exit 1
}