Skip to content

Commit

Permalink
Update setup.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
tejasholla committed Jun 20, 2024
1 parent ec31c2f commit 62ab4a1
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion setup.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Ensure the script can run with elevated privileges
if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
#if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
# Write-Warning "Please run this script as an Administrator!"
# break
#}
$isadmin =
if ($IsWindows) {
([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
}
elseif (Get-Command touch -ErrorAction Ignore) {
touch /tmp *> $null
Remove-Item /tmp -ErrorAction Ignore
$LASTEXITCODE -eq 0
}
if (!$isadmin) {
Write-Warning "Please run this script as an Administrator!"
break
}
Expand Down

0 comments on commit 62ab4a1

Please sign in to comment.