79519655

Date: 2025-03-19 09:08:16
Score: 1
Natty:
Report link

With the help of ChatGPT, after numerous attempts, I have managed to write the shortest code for self-elevating PowerShell permissions:

if (-not (net session)) { Start-Process powershell -WorkingDirectory $PSScriptRoot -ArgumentList "-File `"$PSCommandPath`"" -Verb RunAs; exit }
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: CongAn-王从安