forked from microsoft/ARI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAzureResourceInventory.psm1
More file actions
45 lines (33 loc) · 1.13 KB
/
AzureResourceInventory.psm1
File metadata and controls
45 lines (33 loc) · 1.13 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
<#
.SYNOPSIS
Azure Resource Inventory - A powerful tool to create an Excel inventory from Azure resources with minimal effort.
.DESCRIPTION
This module orchestrates the process of dot sourcing the modules (and functions) that will be triggered by the Invoke-ARI cmdlet.
.AUTHOR
Claudio Merola
.COMPANYNAME
Claudio Merola
.COPYRIGHT
(c) Claudio Merola. All rights reserved.
.VERSION
3.6.2
#>
foreach ($directory in @('modules\Private', '.\modules\Public\PublicFunctions')) {
Get-ChildItem -Path "$PSScriptRoot\$directory\*.ps1" -Recurse | ForEach-Object { . $_.FullName }
}
<#
$PrivateFiles = @( Get-ChildItem -Path (Join-Path $PSScriptRoot "Modules" "Private" "*.ps1") -Recurse -ErrorAction SilentlyContinue )
$PublicFiles = @( Get-ChildItem -Path (Join-Path $PSScriptRoot "Modules" "Public" "PublicFunctions" "*.ps1") -Recurse -ErrorAction SilentlyContinue )
Foreach($import in @($PrivateFiles + $PublicFiles))
{
Try
{
. $import.fullname
}
Catch
{
Write-Error -Message "Failed to import function $($import.fullname): $_"
}
}
Export-ModuleMember -Function $PublicFiles.Basename
#>