if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit } Stop-service DataSyncService $date = (Get-Date).ToString("dd_MM_yyyy") Rename-Item -Path "C:\Users\$env:USERNAME\AppData\Local\GEM Software\Panda Cub" -NewName "Panda Cub_$date" Start-service DataSyncService