-
Notifications
You must be signed in to change notification settings - Fork 3
/
PSForge.psm1
58 lines (45 loc) · 1.44 KB
/
PSForge.psm1
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
46
47
48
49
50
51
52
53
54
55
56
57
58
Import-Module Plaster
function Invoke-ExternalCommand {
Param(
[Parameter(Mandatory=$True,Position=1)]
$command,
[Parameter(Mandatory=$False,Position=2)]
$arguments
)
# Reset $result in case it's used somewhere else
$result = $null
# Reset $LASTEXITCODE in case it was tripped somewhere
$Global:LASTEXITCODE = 0
$result = & $command $arguments 2>$null
if ($LASTEXITCODE -ne 0) {
Throw "Something bad happened while executing $command. Details: $($result | Out-String)"
}
return $result
}
function Invoke-ExternalCommandRealtime {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingInvokeExpression", "")]
Param(
[Parameter(Mandatory=$True,Position=1)]
$command,
[Parameter(Mandatory=$False,Position=2)]
$arguments
)
Invoke-Expression "$command $arguments"
}
function GetPSForgeModuleRoot {
return $PSScriptRoot
}
# Private helper functions
. $PSScriptRoot\src\ModuleInfo.ps1
. $PSScriptRoot\src\OSDetection.ps1
. $PSScriptRoot\src\Dependencies.ps1
. $PSScriptRoot\src\PlasterHelpers.ps1
# Public functions
. $PSScriptRoot\src\NewDSCModule.ps1
. $PSScriptRoot\src\NewDSCResource.ps1
. $PSScriptRoot\src\TestDSCModule.ps1
. $PSScriptRoot\src\ExportDSCModule.ps1
. $PSScriptRoot\src\GetDSCModuleGlobalConfig.ps1
. $PSScriptRoot\src\SetDSCModuleGlobalConfig.ps1
. $PSScriptRoot\src\InvokePaket.ps1
Export-ModuleMember -function *-*