added admin stipulation to on prem set up

This commit is contained in:
Bob White 2018-03-02 14:08:47 -08:00
Родитель ebeb900e4f
Коммит 7a2a6faa1f
1 изменённых файлов: 25 добавлений и 3 удалений

Просмотреть файл

@ -6,11 +6,11 @@ param(
[ValidateNotNullOrEmpty()]
[string]$serverName,
[parameter(Mandatory=$True, Position=2)]
[parameter(Mandatory=$false, Position=2)]
[ValidateNotNullOrEmpty()]
[string]$username,
[parameter(Mandatory=$True, Position=3)]
[parameter(Mandatory=$false, Position=3)]
[ValidateNotNullOrEmpty()]
[string]$password,
@ -20,6 +20,14 @@ param(
)
###Check to see if user is Admin
$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(`
[Security.Principal.WindowsBuiltInRole] "Administrator")
if ($isAdmin -eq 'True') {
#################################################################
##DSVM Does not have SQLServer Powershell Module Install or Update
#################################################################
@ -280,9 +288,23 @@ Stop-Transcript
##Launch HelpURL
Start-Process "https://microsoft.github.io/$SolutionFullName/Typical.html"
##Launch HelpURL
Start-Process "https://microsoft.github.io/$SolutionFullName/Typical.html"
## Close Powershell if not run on
## if ($baseurl)
Exit-PSHostProcess
EXIT
}
ELSE
{
Write-Host "To install this Solution you need to run Powershell as an Administrator. This program will close automatically in 20 seconds"
Start-Sleep -s 20
## Close Powershell
Exit-PSHostProcess
EXIT
EXIT }