List the pending/missing Windows updates.
$UpdateSession = New-Object -ComObject Microsoft.Update.Session
$UpdateSearcher = $UpdateSession.CreateupdateSearcher()
$Updates = @($UpdateSearcher.Search("IsHidden=0 and IsInstalled=0").Updates)
$Updates | ConvertTo-Json -Depth 1
Copy NTFS permissions
get-acl C:\path_with_desired_permissions | set-acl C:\path_lacking_desired_permissions
# set recursively
$perm = Get-Acl C:\path_with_desired_permissions
Get-ChildItem C:\path_lacking_desired_permissions -Recurse | Set-Acl -AclObject $perm -WhatIf
Set-Acl
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-acl?view=powershell-7.3
Example 1: Copy a security descriptor from one file to another
$DogACL = Get-Acl -Path "C:\Dog.txt"
Set-Acl -Path "C:\Cat.txt" -AclObject $DogACL
Example 2: Use the pipeline operator to pass a descriptor
Get-Acl -Path "C:\Dog.txt" | Set-Acl -Path "C:\Cat.txt"
Example 3: Apply a security descriptor to multiple files
$NewAcl = Get-Acl File0.txt
Get-ChildItem -Path "C:\temp" -Recurse -Include "*.txt" -Force | Set-Acl -AclObject $NewAcl
Get stopped services with Automatic startup
Get-WmiObject -Class Win32_Service | Select-Object Name,State,StartMode | Where-Object {$_.State -ne
"Running" -and $_.StartMode -eq "Auto"}