mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Add explaining comments for powershell scritps
This commit is contained in:
parent
641bfe9835
commit
09130c3294
1 changed files with 4 additions and 0 deletions
|
|
@ -59,6 +59,8 @@ export async function installOnWindows() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function isRunningAsAdmin() {
|
async function isRunningAsAdmin() {
|
||||||
|
// Uses Windows Security API to check if current process has admin privileges.
|
||||||
|
// Returns "True" or "False" as a string.
|
||||||
const result = await safeSpawn(
|
const result = await safeSpawn(
|
||||||
"powershell",
|
"powershell",
|
||||||
[
|
[
|
||||||
|
|
@ -79,6 +81,8 @@ function getWindowsArchitecture() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function uninstallIfInstalled() {
|
async function uninstallIfInstalled() {
|
||||||
|
// Query Win32_Product via WMI to find the installed SafeChain Agent.
|
||||||
|
// If found, outputs the product GUID (e.g., "{12345678-1234-...}") needed for msiexec uninstall.
|
||||||
ui.writeVerbose(`Finding product code with PowerShell`);
|
ui.writeVerbose(`Finding product code with PowerShell`);
|
||||||
|
|
||||||
let productCode;
|
let productCode;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue