Skip to content

Commit d22ddbd

Browse files
committed
Merge branch 'TestAndStuff'
2 parents 1b8258b + b0365c8 commit d22ddbd

23 files changed

Lines changed: 1006 additions & 421 deletions

AutomateAPI.psd1

0 Bytes
Binary file not shown.

AutomateAPI.psm1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ $Private = @( Get-ChildItem -Recurse -Path "$PSScriptRoot\Private\" -filter *.ps
99
}
1010
}
1111

12+
$Script:LTPoShURI='http://bit.ly/LTPoSh'
13+
1214
Export-ModuleMember -Function $Public.BaseName

Docs/Compare-AutomateControlStatus.md

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ schema: 2.0.0
88
# Compare-AutomateControlStatus
99

1010
## SYNOPSIS
11-
{{Fill in the Synopsis}}
11+
Compares Automate Online Status with Control, and outputs all machines online in Control and not in Automate
1212

1313
## SYNTAX
1414

@@ -17,51 +17,54 @@ Compare-AutomateControlStatus [[-ComputerObject] <Object>] [-AllResults] [-Quiet
1717
```
1818

1919
## DESCRIPTION
20-
{{Fill in the Description}}
20+
Compares Automate Online Status with Control, and outputs all machines online in Control and not in Automate
2121

2222
## EXAMPLES
2323

24-
### Example 1
25-
```powershell
26-
PS C:\> {{ Add example code here }}
24+
### EXAMPLE 1
25+
```
26+
Get-AutomateComputer -ComputerID 5 | Compare-AutomateControlStatus
2727
```
2828

29-
{{ Add example description here }}
29+
### EXAMPLE 2
30+
```
31+
Get-AutomateComputer -Online $False | Compare-AutomateControlStatus
32+
```
3033

3134
## PARAMETERS
3235

33-
### -AllResults
34-
{{Fill AllResults Description}}
36+
### -ComputerObject
37+
Can be taken from the pipeline in the form of Get-AutomateComputer -ComputerID 5 | Compare-AutomateControlStatus
3538

3639
```yaml
37-
Type: SwitchParameter
40+
Type: Object
3841
Parameter Sets: (All)
3942
Aliases:
4043

4144
Required: False
42-
Position: Named
45+
Position: 1
4346
Default value: None
44-
Accept pipeline input: False
47+
Accept pipeline input: True (ByValue)
4548
Accept wildcard characters: False
4649
```
4750
48-
### -ComputerObject
49-
{{Fill ComputerObject Description}}
51+
### -AllResults
52+
Instead of outputting a comparison it outputs everything, which include two columns indicating online status
5053
5154
```yaml
52-
Type: Object
55+
Type: SwitchParameter
5356
Parameter Sets: (All)
5457
Aliases:
5558

5659
Required: False
57-
Position: 0
58-
Default value: None
59-
Accept pipeline input: True (ByValue)
60+
Position: Named
61+
Default value: False
62+
Accept pipeline input: False
6063
Accept wildcard characters: False
6164
```
6265
6366
### -Quiet
64-
{{Fill Quiet Description}}
67+
Doesn't output any log messages
6568
6669
```yaml
6770
Type: SwitchParameter
@@ -70,7 +73,7 @@ Aliases:
7073

7174
Required: False
7275
Position: Named
73-
Default value: None
76+
Default value: False
7477
Accept pipeline input: False
7578
Accept wildcard characters: False
7679
```
@@ -81,11 +84,13 @@ For more information, see about_CommonParameters (http://go.microsoft.com/fwlink
8184
8285
## INPUTS
8386
84-
### System.Object
85-
8687
## OUTPUTS
8788
88-
### System.Object
89+
### An object containing Online status for Control and Automate
8990
## NOTES
91+
Version: 1.1
92+
Author: Gavin Stone
93+
Creation Date: 20/01/2019
94+
Purpose/Change: Initial script development
9095
9196
## RELATED LINKS

Docs/Connect-AutomateAPI.md

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,23 @@ Connect-AutomateAPI [-Server <String>] [-AuthorizationToken <String>] [-SkipChec
2020

2121
### credential
2222
```
23-
Connect-AutomateAPI [-AutomateCredentials <PSCredential>] [-Server <String>] [-TwoFactorToken <String>]
23+
Connect-AutomateAPI [-Credential <PSCredential>] [-Server <String>] [-SkipCheck] [-TwoFactorToken <String>]
2424
[-Force] [-Quiet] [<CommonParameters>]
2525
```
2626

27+
### verify
28+
```
29+
Connect-AutomateAPI [-Server <String>] [-AuthorizationToken <String>] [-Verify] [-Quiet] [<CommonParameters>]
30+
```
31+
2732
## DESCRIPTION
2833
Connects to the Automate API and returns a bearer token which when passed with each requests grants up to an hours worth of access.
2934

3035
## EXAMPLES
3136

3237
### EXAMPLE 1
3338
```
34-
Connect-AutomateAPI -Server "rancor.hostedrmm.com" -AutomateCredentials $CredentialObject -TwoFactorToken "999999"
39+
Connect-AutomateAPI -Server "rancor.hostedrmm.com" -Credentials $CredentialObject -TwoFactorToken "999999"
3540
```
3641

3742
### EXAMPLE 2
@@ -41,8 +46,8 @@ Connect-AutomateAPI -Quiet
4146

4247
## PARAMETERS
4348

44-
### -AutomateCredentials
45-
Takes a standard powershell credential object, this can be built with $CredentialsToPass = Get-Credential, then pass $CredentialsToPass
49+
### -Credential
50+
{{Fill Credential Description}}
4651

4752
```yaml
4853
Type: PSCredential
@@ -73,26 +78,42 @@ Accept wildcard characters: False
7378
```
7479
7580
### -AuthorizationToken
76-
{{Fill AuthorizationToken Description}}
81+
Used internally when quietly refreshing the Token
7782
7883
```yaml
7984
Type: String
80-
Parameter Sets: refresh
85+
Parameter Sets: refresh, verify
8186
Aliases:
8287

8388
Required: False
8489
Position: Named
85-
Default value: ($Script:CWACredentials.Authorization -replace 'Bearer ','')
90+
Default value: ($Script:CWAToken.Authorization -replace 'Bearer ','')
8691
Accept pipeline input: False
8792
Accept wildcard characters: False
8893
```
8994
9095
### -SkipCheck
91-
{{Fill SkipCheck Description}}
96+
Used internally when quietly refreshing the Token
97+
98+
```yaml
99+
Type: SwitchParameter
100+
Parameter Sets: refresh, credential
101+
Aliases:
102+
103+
Required: False
104+
Position: Named
105+
Default value: False
106+
Accept pipeline input: False
107+
Accept wildcard characters: False
108+
```
109+
110+
### -Verify
111+
Specifies to test the current token, and if it is not valid attempt to obtain a new one using the current credentials.
112+
Does not refresh (re-issue) the current token.
92113
93114
```yaml
94115
Type: SwitchParameter
95-
Parameter Sets: refresh
116+
Parameter Sets: verify
96117
Aliases:
97118

98119
Required: False

Docs/Connect-ControlAPI.md

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,22 @@ Adds credentials required to connect to the Control API
1717
Connect-ControlAPI [-Server <String>] [-Quiet] [<CommonParameters>]
1818
```
1919

20+
### verify
21+
```
22+
Connect-ControlAPI [-Credential <PSCredential>] [-Server <String>] [-Verify] [-Quiet] [<CommonParameters>]
23+
```
24+
2025
### credential
2126
```
22-
Connect-ControlAPI [-ControlCredentials <PSCredential>] [-Server <String>] [-Force] [-SkipCheck] [-Quiet]
27+
Connect-ControlAPI [-Credential <PSCredential>] [-Server <String>] [-Force] [-SkipCheck] [-Quiet]
2328
[<CommonParameters>]
2429
```
2530

31+
### apikey
32+
```
33+
Connect-ControlAPI [-Server <String>] [-APIKey <Object>] [-SkipCheck] [-Quiet] [<CommonParameters>]
34+
```
35+
2636
## DESCRIPTION
2737
Creates a Control hashtable in memory containing the server and username/password so that it can be used in other functions that connect to ConnectWise Control.
2838
Unfortunately the Control API does not support 2FA.
@@ -36,16 +46,16 @@ All values will be prompted for one by one:
3646

3747
Connect-ControlAPI
3848
All values needed to Automatically create appropriate output
39-
Connect-ControlAPI -Server "https://control.rancorthebeast.com:8040" -ControlCredentials $CredentialsToPass
49+
Connect-ControlAPI -Server "https://control.rancorthebeast.com:8040" -Credentials $CredentialsToPass
4050

4151
## PARAMETERS
4252

43-
### -ControlCredentials
53+
### -Credential
4454
Takes a standard powershell credential object, this can be built with $CredentialsToPass = Get-Credential, then pass $CredentialsToPass
4555

4656
```yaml
4757
Type: PSCredential
48-
Parameter Sets: credential
58+
Parameter Sets: verify, credential
4959
Aliases:
5060

5161
Required: False
@@ -71,6 +81,21 @@ Accept pipeline input: False
7181
Accept wildcard characters: False
7282
```
7383
84+
### -APIKey
85+
Automate APIKey for Control Extension
86+
87+
```yaml
88+
Type: Object
89+
Parameter Sets: apikey
90+
Aliases:
91+
92+
Required: False
93+
Position: Named
94+
Default value: ([SecureString]$Script:ControlAPIKey)
95+
Accept pipeline input: False
96+
Accept wildcard characters: False
97+
```
98+
7499
### -Force
75100
\[Parameter(ParameterSetName = 'credential', Mandatory = $False)\]
76101
\[String\]$TwoFactorToken,
@@ -87,12 +112,28 @@ Accept pipeline input: False
87112
Accept wildcard characters: False
88113
```
89114
115+
### -Verify
116+
Attempt to verify Cached API key or Credentials.
117+
Invalid results will be removed.
118+
119+
```yaml
120+
Type: SwitchParameter
121+
Parameter Sets: verify
122+
Aliases:
123+
124+
Required: False
125+
Position: Named
126+
Default value: False
127+
Accept pipeline input: False
128+
Accept wildcard characters: False
129+
```
130+
90131
### -SkipCheck
91-
{{Fill SkipCheck Description}}
132+
Used internally when quietly refreshing the Token
92133
93134
```yaml
94135
Type: SwitchParameter
95-
Parameter Sets: credential
136+
Parameter Sets: credential, apikey
96137
Aliases:
97138

98139
Required: False

Docs/Get-AutomateComputer.md

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,20 @@ Get-AutomateComputer [[-ComputerID] <Int32[]>] [<CommonParameters>]
1919

2020
### AllResults
2121
```
22-
Get-AutomateComputer [-AllComputers] [<CommonParameters>]
22+
Get-AutomateComputer [-AllComputers] [-IncludeFields <String>] [-ExcludeFields <String>] [-OrderBy <String>]
23+
[<CommonParameters>]
2324
```
2425

2526
### ByCondition
2627
```
27-
Get-AutomateComputer [[-Condition] <String>] [<CommonParameters>]
28+
Get-AutomateComputer [-Condition <String>] [-IncludeFields <String>] [-ExcludeFields <String>]
29+
[-OrderBy <String>] [<CommonParameters>]
2830
```
2931

3032
### CustomBuiltCondition
3133
```
32-
Get-AutomateComputer [-ClientName <String>] [-ClientId <Int32>] [-LocationId <Int32>] [-LocationName <String>]
34+
Get-AutomateComputer [-IncludeFields <String>] [-ExcludeFields <String>] [-OrderBy <String>]
35+
[-ClientName <String>] [-ClientId <Int32>] [-LocationId <Int32>] [-LocationName <String>]
3336
[-ComputerName <String>] [-OpenPort <String>] [-OperatingSystem <String>] [-DomainName <String>]
3437
[-NotSeenInDays <Int32>] [-Comment <String>] [-LastWindowsUpdateInDays <Int32>]
3538
[-AntiVirusDefinitionInDays <String>] [-LocalIPAddress <String>] [-GatewayIPAddress <String>]
@@ -114,7 +117,52 @@ Parameter Sets: ByCondition
114117
Aliases:
115118

116119
Required: False
117-
Position: 1
120+
Position: Named
121+
Default value: None
122+
Accept pipeline input: False
123+
Accept wildcard characters: False
124+
```
125+
126+
### -IncludeFields
127+
A comma separated list of fields that you want including in the returned computer object.
128+
129+
```yaml
130+
Type: String
131+
Parameter Sets: AllResults, ByCondition, CustomBuiltCondition
132+
Aliases:
133+
134+
Required: False
135+
Position: Named
136+
Default value: None
137+
Accept pipeline input: False
138+
Accept wildcard characters: False
139+
```
140+
141+
### -ExcludeFields
142+
A comma separated list of fields that you want excluding in the returned computer object.
143+
144+
```yaml
145+
Type: String
146+
Parameter Sets: AllResults, ByCondition, CustomBuiltCondition
147+
Aliases:
148+
149+
Required: False
150+
Position: Named
151+
Default value: None
152+
Accept pipeline input: False
153+
Accept wildcard characters: False
154+
```
155+
156+
### -OrderBy
157+
A comma separated list of fields that you want to order by finishing with either an asc or desc.
158+
159+
```yaml
160+
Type: String
161+
Parameter Sets: AllResults, ByCondition, CustomBuiltCondition
162+
Aliases:
163+
164+
Required: False
165+
Position: Named
118166
Default value: None
119167
Accept pipeline input: False
120168
Accept wildcard characters: False

Docs/Get-AutomateControlInfo.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Accept wildcard characters: False
5050
```
5151
5252
### -ID
53-
{{Fill ID Description}}
53+
Taken from the Pipeline, IE Get-AutomateComputer -ComputerID 5 | Get-AutomateControlInfo
5454
5555
```yaml
5656
Type: Int16[]
@@ -65,7 +65,7 @@ Accept wildcard characters: False
6565
```
6666
6767
### -ComputerObjects
68-
{{Fill ComputerObjects Description}}
68+
Used for Pipeline input from Get-AutomateComputer
6969
7070
```yaml
7171
Type: Object

0 commit comments

Comments
 (0)