Created
May 28, 2018 20:42
-
-
Save bgelens/00ccebd350e0e8e94a25f0ce75e1bd83 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$enums = Get-ChildItem -Path $PSScriptRoot\enums\*.ps1 -ErrorAction SilentlyContinue | ForEach-Object -Process { | |
Get-Content $_.FullName | |
} | |
if (Test-Path "$PSScriptRoot\Classes\classes.psd1") { | |
$ClassLoadOrder = Import-PowerShellDataFile -Path "$PSScriptRoot\classes\classes.psd1" -ErrorAction SilentlyContinue | |
} | |
$classes = foreach ($class in $ClassLoadOrder.order) { | |
$path = '{0}\classes\{1}.ps1' -f $PSScriptRoot, $class | |
if (Test-Path $path) { | |
Get-Content $path | |
} | |
} | |
$public = Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 -Exclude WIP* -ErrorAction SilentlyContinue | ForEach-Object -Process { | |
Get-Content $_ | |
"Export-ModuleMember -Function $($_.Basename)" | |
} | |
$private = Get-ChildItem -Path $PSScriptRoot\Private\*.ps1 -Exclude WIP* -ErrorAction SilentlyContinue | ForEach-Object -Process { | |
Get-Content $_ | |
} | |
$moduleContent = @' | |
Add-Type -Path 'C:\Windows\Microsoft.NET\assembly\GAC_MSIL\microsoft.isam.esent.interop\*\Microsoft.Isam.Esent.Interop.dll' | |
$DSCPullServerConnections = [System.Collections.ArrayList]::new() | |
{0} | |
{1} | |
{2} | |
{3} | |
'@ -f ($enums -join "`n"), ($classes -join "`n"), ($private -join "`n"), ($public -join "`n") | |
$scriptBlock = [scriptblock]::Create($moduleContent) | |
New-Module -Name DSCPullServerAdmin -ScriptBlock $scriptBlock |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment