-
Notifications
You must be signed in to change notification settings - Fork 337
Expand file tree
/
Copy pathMicroBurst.psm1
More file actions
51 lines (40 loc) · 1.61 KB
/
MicroBurst.psm1
File metadata and controls
51 lines (40 loc) · 1.61 KB
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
43
44
45
46
47
48
49
50
51
# Test to see if each module is installed, load scripts as applicable
$prefBackup = $WarningPreference
$global:WarningPreference = 'SilentlyContinue'
# Az
try{
Get-InstalledModule -ErrorAction Stop -Name Az | Out-Null
Import-Module Az -ErrorAction Stop
Import-Module $PSScriptRoot\Az\MicroBurst-Az.psm1
$azStatus = "1"
}
catch{Write-Host -ForegroundColor DarkRed "Az module not installed, checking other modules"}
# AzureAD
try{
Get-InstalledModule -ErrorAction Stop -Name AzureAD | Out-Null
Import-Module AzureAD -ErrorAction Stop
Import-Module $PSScriptRoot\AzureAD\MicroBurst-AzureAD.psm1
}
catch{Write-Host -ForegroundColor DarkRed "AzureAD module not installed, checking other modules"}
<# AzureRm - Uncomment this section if you want to import the functions
try{
Get-InstalledModule -ErrorAction Stop -Name AzureRM | Out-Null
Import-Module AzureRM -ErrorAction Stop
Import-Module $PSScriptRoot\AzureRM\MicroBurst-AzureRM.psm1
}
catch{
# If Az is already installed, no need to warn on no AzureRM
if($azStatus -ne "1"){Write-Host -ForegroundColor DarkRed "AzureRM module not installed, checking other modules"}
}
#>
# MSOL
try{
Get-InstalledModule -ErrorAction Stop -Name msonline | Out-Null
Import-Module msonline -ErrorAction Stop
Import-Module $PSScriptRoot\MSOL\MicroBurst-MSOL.psm1
}
catch{Write-Host -ForegroundColor DarkRed "MSOnline module not installed, checking other modules"}
# Import Additional Functions
Import-Module $PSScriptRoot\Misc\MicroBurst-Misc.psm1
Import-Module $PSScriptRoot\REST\MicroBurst-AzureREST.psm1
$global:WarningPreference = $prefBackup