Powershell/Start-JCADMU.ps1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# Check runningaslocaladmin if (([bool](([System.Security.Principal.WindowsIdentity]::GetCurrent()).groups -match "S-1-5-32-544")) -eq $false) { Write-Host 'ADMU must be ran as a local administrator..please correct & try again' Read-Host -Prompt "Press Enter to exit" exit } # Get script path $scriptPath = (Split-Path -Path:($MyInvocation.MyCommand.Path)) # Load functions . ($scriptPath + '\Start-Migration.ps1') # Load form $formResults = Invoke-Expression -Command:('. "' + $scriptPath + '\Form.ps1"') # exit if form is null/ false If ($formResults) { Start-Migration -inputObject:($formResults) } Else { Write-Output ('Exiting ADMU process') } |