Cohesity.PowerShell.psm1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
$scripts  = @( Get-ChildItem -Recurse -Path $PSScriptRoot\Scripts\*.ps1 -ErrorAction SilentlyContinue )

#Dot source the files
Foreach($script in @($scripts))
{
    Try
    {
        . $script.fullname
        Export-ModuleMember -Function $script.BaseName
    }
    Catch
    {
        Write-Error -Message "Failed to import function $($script.fullname): $_"
    }
}
# Post module installation initialize the cmdlet configuration
$config = Get-CohesityCmdletConfig
if($null -eq $config) {
    $resp = Set-CohesityCmdletConfig -LogSeverity 3 -Confirm:$false
} else {
    $resp = Update-CohesityCmdletConfig -CurrentConfig $config -Confirm:$false
}