generic/Build.ps1

#
# SailPoint Identity Security API - Generic
# Generic client for the SailPoint Identity Security versioned APIs. Use it to call any endpoint, in any version, by its path, for example `sources/v1` or `sources/v2/{sourceId}/provisioning-policies`, including endpoints that do not have a resource-specific client or documentation yet. The version is part of the path, so this client is not tied to one API version and the base URL has no version segment.
# Version: any (set in the path)
# Generated by OpenAPI Generator: https://openapi-generator.tech
#

function Get-FunctionsToExport {
    [CmdletBinding()]
    Param (
        [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
        [ValidateNotNullOrEmpty()]
        [Alias('FullName')]
        $Path
    )

    Process {
        $Token = $null
        $ParserErr = $null

        $Ast = [System.Management.Automation.Language.Parser]::ParseFile(
            $Path,
            [ref]$Token,
            [ref]$ParserErr
        )

        if ($ParserErr) {
            throw $ParserErr
        } else {
            foreach ($name in 'Begin', 'Process', 'End') {
                foreach ($Statement in $Ast."${name}Block".Statements) {
                    if (
                        [String]::IsNullOrWhiteSpace($Statement.Name) -or
                        $Statement.Extent.ToString() -notmatch
                        ('function\W+{0}' -f $Statement.Name)
                    ) {
                        continue
                    }

                    $Statement.Name
                }
            }
        }
    }
}

$ScriptDir = Split-Path $script:MyInvocation.MyCommand.Path
$FunctionPath = "$PSScriptRoot/src/PSSailpoint.Generic/Api", "$PSScriptRoot/src/PSSailpoint.Generic/Client","$PSScriptRoot/src/PSSailpoint.Generic/Model" | ForEach-Object { $_ }


$Manifest = @{
    Path = "$ScriptDir\src\PSSailpoint.Generic\PSSailpoint.Generic.psd1"

    Author = 'OpenAPI Generator Team'
    CompanyName = 'SailPoint Technologies'
    Description = 'PSSailpoint.Generic - the PowerShell module for SailPoint Identity Security API - Generic'

    ModuleVersion = '2.1.75'

    RootModule = 'PSSailpoint.Generic.psm1'
    Guid = '07984E19-CF77-6C51-76AE-78607FC5F30B' # Has to be static, otherwise each new build will be considered different module

    PowerShellVersion = '6.2'

    FunctionsToExport = $FunctionPath | Get-ChildItem -Filter *.ps1 | Get-FunctionsToExport

    VariablesToExport = @()
    AliasesToExport = @()
    CmdletsToExport = @()

}

New-ModuleManifest @Manifest