-
Notifications
You must be signed in to change notification settings - Fork 4
/
Install.ps1
42 lines (38 loc) · 2.21 KB
/
Install.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<#
Copyright (C) 2016 by IS4U (info@is4u.be)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 3.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
A full copy of the GNU General Public License can be found
here: http://opensource.org/licenses/gpl-3.0.
#>
Set-StrictMode -Version Latest
$currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())
$admin = $currentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
if($admin -eq $false) {
Start-Process powershell.exe -Verb RunAs -ArgumentList ('-noprofile -file "{0}" -elevated' -f ($myinvocation.MyCommand.Definition)) -WindowStyle Hidden
} else {
$dir = Split-Path -Parent $MyInvocation.MyCommand.Path
Copy-Item (Join-Path $dir ".\FimPowerShellModule") "$Env:ProgramFiles\WindowsPowerShell\Modules" -Recurse -Force
Copy-Item (Join-Path $dir ".\IS4U") "$Env:ProgramFiles\WindowsPowerShell\Modules" -Recurse -Force
Copy-Item (Join-Path $dir ".\IS4U.Fim") "$Env:ProgramFiles\WindowsPowerShell\Modules" -Recurse -Force
Copy-Item (Join-Path $dir ".\IS4U.FimPortal") "$Env:ProgramFiles\WindowsPowerShell\Modules" -Recurse -Force
Copy-Item (Join-Path $dir ".\IS4U.FimPortal.Rcdc") "$Env:ProgramFiles\WindowsPowerShell\Modules" -Recurse -Force
Copy-Item (Join-Path $dir ".\IS4U.FimPortal.Schema") "$Env:ProgramFiles\WindowsPowerShell\Modules" -Recurse -Force
Copy-Item (Join-Path $dir ".\IS4U.FimPortal.Sspr") "$Env:ProgramFiles\WindowsPowerShell\Modules" -Recurse -Force
Copy-Item (Join-Path $dir ".\IS4U.FimPortal.Migrate") "$Env:ProgramFiles\WindowsPowerShell\Modules" -Recurse -Force
if(Get-Module -ListAvailable | Where-Object{$_.Name -eq "LithnetRMA"}){
if(!(Get-Module -Name LithnetRMA)) {
Import-Module LithnetRMA
}
} else {
$ExePath = $PSScriptRoot
Start-Process -FilePath "$ExePath\Lithnet.ResourceManagement.Automation.msi"
Import-Module LithnetRMA
}
}
Write-Host "Modules successfully deployed."