]> insang Git - newton-cn_pos.git/blob
16457be6ec3ded4c3458943d49750e153824dc60
[newton-cn_pos.git] /
1 #
2 # WaitForAny 
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     Import-Module $PSScriptRoot\..\..\PSDSCxMachine.psm1 -Verbose:$false
29
30     return PSDSCxMachine\Get-_InternalPSDscXMachineTR `
31                -RemoteResourceId $ResourceName `
32                -RemoteMachine $NodeName `
33                -MinimalNumberOfMachineInState 1 `
34                -RetryIntervalSec $RetryIntervalSec `
35                -RetryCount $RetryCount `
36                -ThrottleLimit $ThrottleLimit
37 }
38
39 #
40 # The Set-TargetResource cmdlet.
41 #
42 function Set-TargetResource
43 {
44     param
45     (
46         [parameter(Mandatory)]
47         [ValidateNotNullOrEmpty()]
48         [string] $ResourceName,
49
50         [parameter(Mandatory)]
51         [ValidateNotNullOrEmpty()]
52         [string[]] $NodeName,
53
54         [ValidateRange(1,[Uint64]::MaxValue)]
55         [Uint64] $RetryIntervalSec = 1, 
56
57         [Uint32] $RetryCount = 0,
58
59         [Uint32] $ThrottleLimit = 32 #Powershell New-CimSession default throttle value
60     )
61
62     Import-Module $PSScriptRoot\..\..\PSDSCxMachine.psm1 -Verbose:$false
63
64     
65     PSDSCxMachine\Set-_InternalPSDscXMachineTR `
66                -RemoteResourceId $ResourceName `
67                -RemoteMachine $NodeName `
68                -MinimalNumberOfMachineInState 1 `
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 1 `
105                -RetryIntervalSec $RetryIntervalSec `
106                -RetryCount $RetryCount `
107                -ThrottleLimit $ThrottleLimit `
108                -Verbose:$($PSBoundParameters["Verbose"] -eq $true)
109 }
110
111
112
113 Export-ModuleMember -Function *-TargetResource