Skip to content

Commit

Permalink
Merge pull request #133 from lipkau/fix/132-CompilePSM1
Browse files Browse the repository at this point in the history
Added regions in psm1 file for compilation
  • Loading branch information
lipkau authored Mar 26, 2018
2 parents a524399 + 694c077 commit 807af25
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions ConfluencePS.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ task CompileModule {
}
if (($capture -eq $true) -and ($line -match "^#endregion")) {
$capture = $false
$compiled += "$line`n`n"
}

if ($capture) {
Expand Down
5 changes: 4 additions & 1 deletion ConfluencePS/ConfluencePS.psm1
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#region Dependencies
# Load the ConfluencePS namespace from C#
if (!("ConfluencePS.Space" -as [Type])) {
Add-Type -Path (Join-Path $PSScriptRoot ConfluencePS.Types.cs) -ReferencedAssemblies Microsoft.CSharp, Microsoft.PowerShell.Commands.Utility, System.Management.Automation
Expand All @@ -8,8 +9,9 @@ if (!("ConfluencePS.Space" -as [Type])) {
if (!("System.Web.HttpUtility" -as [Type])) {
Add-Type -Assembly System.Web
}
#endregion Dependencies

# Gather all files
#region LoadFunctions
$PublicFunctions = @( Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 -ErrorAction SilentlyContinue )
$PrivateFunctions = @( Get-ChildItem -Path $PSScriptRoot\Private\*.ps1 -ErrorAction SilentlyContinue )

Expand All @@ -29,3 +31,4 @@ ForEach ($File in @($PublicFunctions + $PrivateFunctions)) {
$PSCmdlet.ThrowTerminatingError($errorItem)
}
}
#endregion LoadFunctions

0 comments on commit 807af25

Please sign in to comment.