Skip to content

Instantly share code, notes, and snippets.

@atilara
Created January 5, 2024 00:55
Show Gist options
  • Save atilara/3eb4880e4d52c8606eaa804c16352fc2 to your computer and use it in GitHub Desktop.
Save atilara/3eb4880e4d52c8606eaa804c16352fc2 to your computer and use it in GitHub Desktop.
quartz-sync
# Verifica se o script está sendo executado como administrador
$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
if (-not $isAdmin) {
# Se não estiver sendo executado como administrador, solicita privilégios de administrador e reinicia o script
Start-Process powershell -ArgumentList "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
Exit
}
# Navega para a pasta C://quartz
Set-Location -Path "C:\quartz"
# Executa o comando npx quartz sync
Invoke-Expression -Command "npx quartz sync"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment