Skip to content

Commit

Permalink
new file: src/Diagnostica/CorrezioneProblemi.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
gpicchiarelli committed Mar 21, 2024
1 parent 555de73 commit 6198327
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Diagnostica/CorrezioneProblemi.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Verifica se lo script viene eseguito come amministratore
if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Host "Lo script deve essere eseguito con privilegi di amministratore." -ForegroundColor Red
# Esci dallo script se non è stato eseguito come amministratore
exit
}

# Comando DISM per pulire e ripristinare l'immagine di distribuzione
$command = "SFC.EXE /SCANNOW"

# Esegui il comando
Invoke-Expression -Command $command

0 comments on commit 6198327

Please sign in to comment.