]> insang Git - wevape-lu1_pos.git/blob
f16256d824bac215ba3defeb09dc3b07436cf2ae
[wevape-lu1_pos.git] /
1 #
2 # WaitForAll
3 #
4
5 #
6 # The Get-TargetResource cmdlet.
7 #
8 function Get-TargetResource
9 {
10     param
11     (
12         [parameter(Mandatory)]
13         [ValidateNotNullOrEmpty()]
14         [string] $ResourceName,
15
16         [parameter(Mandatory)]
17         [ValidateNotNullOrEmpty()]
18         [string[]] $NodeName,
19
20         [ValidateRange(1,[Uint64]::MaxValue)]
21         [Uint64] $RetryIntervalSec = 1, 
22
23         [Uint32] $RetryCount = 0,
24
25         [Uint32] $ThrottleLimit = 32 #Powershell New-CimSession default throttle value
26     )
27
28
29     Import-Module $PSScriptRoot\..\..\PSDSCxMachine.psm1 -Verbose:$false
30
31     return PSDSCxMachine\Get-_InternalPSDscXMachineTR `
32                -RemoteResourceId $ResourceName `
33                -RemoteMachine $NodeName `
34                -MinimalNumberOfMachineInState $NodeName.Count `
35                -RetryIntervalSec $RetryIntervalSec `
36                -RetryCount $RetryCount `
37                -ThrottleLimit $ThrottleLimit
38 }
39
40 #
41 # The Set-TargetResource cmdlet.
42 #
43 function Set-TargetResource
44 {
45     param
46     (
47         [parameter(Mandatory)]
48         [ValidateNotNullOrEmpty()]
49         [string] $ResourceName,
50
51         [parameter(Mandatory)]
52         [ValidateNotNullOrEmpty()]
53         [string[]] $NodeName,
54
55         [ValidateRange(1,[Uint64]::MaxValue)]
56         [Uint64] $RetryIntervalSec = 1, 
57
58         [Uint32] $RetryCount = 0,
59
60         [Uint32] $ThrottleLimit = 32 #Powershell New-CimSession default throttle value
61     )
62
63     Import-Module $PSScriptRoot\..\..\PSDSCxMachine.psm1 -Verbose:$false
64
65     PSDSCxMachine\Set-_InternalPSDscXMachineTR `
66                -RemoteResourceId $ResourceName `
67                -RemoteMachine $NodeName `
68                -MinimalNumberOfMachineInState $NodeName.Count `
69                -RetryIntervalSec $RetryIntervalSec `
70                -RetryCount $RetryCount `
71                -ThrottleLimit $ThrottleLimit `
72                -Verbose:$($PSBoundParameters["Verbose"] -eq $true)
73 }
74
75
76 # Test-TargetResource
77 #
78
79 function Test-TargetResource  
80 {
81     param
82     (
83         [parameter(Mandatory)]
84         [ValidateNotNullOrEmpty()]
85         [string] $ResourceName,
86
87         [parameter(Mandatory)]
88         [ValidateNotNullOrEmpty()]
89         [string[]] $NodeName,
90
91         [ValidateRange(1,[Uint64]::MaxValue)]
92         [Uint64] $RetryIntervalSec = 1, 
93
94         [Uint32] $RetryCount = 0,
95
96         [Uint32] $ThrottleLimit = 32 #Powershell New-CimSession default throttle value
97     )
98
99     Import-Module $PSScriptRoot\..\..\PSDSCxMachine.psm1 -Verbose:$false
100
101     return PSDSCxMachine\Test-_InternalPSDscXMachineTR `
102              -RemoteResourceId $ResourceName `
103              -RemoteMachine $NodeName `
104              -MinimalNumberOfMachineInState $NodeName.Count `
105              -RetryIntervalSec $RetryIntervalSec `
106              -RetryCount $RetryCount `
107              -ThrottleLimit $ThrottleLimit `
108              -Verbose:$($PSBoundParameters["Verbose"] -eq $true)
109 }
110
111
112
113 Export-ModuleMember -Function *-TargetResource