sample-scripts/readme.md
This folder contains sample scripts demonstrating how to use gsudo to elevate privileges on a Windows machine. The provided scripts include:
Script Self-Elevation: A technique to ensure that the current script is running elevated, by detecting when it is not, and elevating itself. More details can be found in the gsudo documentation on script self-elevation.
self-elevate.cmd: Batch script versionself-elevate-one-liner.cmd: A one-liner version of the batch script.self-elevate.ps1: PowerShell version.self-elevate-without-gsudo.cmd: Example without using gsudo.Many Elevations Using gsudo Cache:
many-elevations-using-gsudo-cache.cmd: Batch script versionmany-elevations-using-gsudo-cache.ps1: PowerShell versionDon't show an UAC pop-up: Perform an elevated admin task if and only if it can be done without an interactive UAC pop-up. (i.e. when already elevated or gsudo cache is active)
silent-elevation-one-liner.cmd: A one-liner version.silent-elevation.cmd: Verbose version .These scripts are examples and should be used with caution. Always review and understand the code you are executing on your system.