MicrosoftGraphSecurity.psm1

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
#----------------------------Include functions---------------------------
# KUDOS to the chocolatey project for the basis of this code

# get the path of where the module is saved (if module is at c:\myscripts\module.psm1, then c:\myscripts\)
$mypath = (Split-Path -Parent -Path $MyInvocation.MyCommand.Definition)

#find all the ps1 files in the Functions subfolder
Resolve-Path -Path $mypath\Functions\*.ps1 | ForEach-Object -Process {
    . $_.ProviderPath
}

#----------------------------Exports---------------------------
# Cmdlets to export (must be exported as functions, not cmdlets) - This array format can be copied directly to the manifest as the 'FunctionsToExport' value
$ExportedCommands = @(
    'Get-GraphSecurityAlert',
    'Get-GraphSecurityCredential',
    'Get-GraphSecuritySecureScore',
    'Set-GraphSecurityAlert')
$ExportedCommands | ForEach-Object {Export-ModuleMember -Function $_}

# Vars to export (must be exported here, even if also included in the module manifest in 'VariablesToExport'
Export-ModuleMember -Variable GraphSecurityCredential
Export-ModuleMember -Variable GraphSecurityAuthToken

# Aliases to export
Export-ModuleMember -Alias *