interanl flag detection

This commit is contained in:
poslop
2026-01-14 10:48:35 -06:00
parent b6d8005c96
commit 337b2a9c86

View File

@@ -1,3 +1,10 @@
$flagFile = "C:\ProgramData\PrinterHKeyClean\v1.flag"
if (Test-Path $flagFile) {
Write-Host "Script has already run. Exiting."
exit
}
$profileListKey = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'
$sids = Get-ChildItem $profileListKey
@@ -48,4 +55,4 @@ net start spooler
gpupdate /force
New-Item -Path "C:\ProgramData\PrinterHKeyClean\v1.flag" -ItemType File -Force
New-Item -Path $flagFile -ItemType File -Force