Created
January 5, 2024 00:55
-
-
Save atilara/3eb4880e4d52c8606eaa804c16352fc2 to your computer and use it in GitHub Desktop.
quartz-sync
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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