Commit a705b6f4 by Rinat K. Nugaev

Added checking admin rights when run the script

parent d63798bc
...@@ -9,6 +9,19 @@ ...@@ -9,6 +9,19 @@
# CHANGELOG # CHANGELOG
# Version 0.3: # Version 0.3:
#Checking that script run with admin privilegies
If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(`
[Security.Principal.WindowsBuiltInRole] "Administrator"))
{
Write-Warning "You do not have Administrator rights to run this script!`nPlease re-run this script as an Administrator!"
Break
}
#Importing module BitsTransfer #Importing module BitsTransfer
Try Try
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment