Skip to content

Commit

Permalink
Merge branch 'TestAndStuff'
Browse files Browse the repository at this point in the history
  • Loading branch information
gavsto committed Feb 21, 2019
2 parents 1b8258b + b0365c8 commit d22ddbd
Show file tree
Hide file tree
Showing 23 changed files with 1,006 additions and 421 deletions.
Binary file modified AutomateAPI.psd1
Binary file not shown.
2 changes: 2 additions & 0 deletions AutomateAPI.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ $Private = @( Get-ChildItem -Recurse -Path "$PSScriptRoot\Private\" -filter *.ps
}
}

$Script:LTPoShURI='http://bit.ly/LTPoSh'

Export-ModuleMember -Function $Public.BaseName
49 changes: 27 additions & 22 deletions Docs/Compare-AutomateControlStatus.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ schema: 2.0.0
# Compare-AutomateControlStatus

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

## SYNTAX

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

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

## EXAMPLES

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

{{ Add example description here }}
### EXAMPLE 2
```
Get-AutomateComputer -Online $False | Compare-AutomateControlStatus
```

## PARAMETERS

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

```yaml
Type: SwitchParameter
Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Position: 1
Default value: None
Accept pipeline input: False
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```
### -ComputerObject
{{Fill ComputerObject Description}}
### -AllResults
Instead of outputting a comparison it outputs everything, which include two columns indicating online status
```yaml
Type: Object
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -Quiet
{{Fill Quiet Description}}
Doesn't output any log messages
```yaml
Type: SwitchParameter
Expand All @@ -70,7 +73,7 @@ Aliases:

Required: False
Position: Named
Default value: None
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
Expand All @@ -81,11 +84,13 @@ For more information, see about_CommonParameters (http://go.microsoft.com/fwlink
## INPUTS
### System.Object
## OUTPUTS
### System.Object
### An object containing Online status for Control and Automate
## NOTES
Version: 1.1
Author: Gavin Stone
Creation Date: 20/01/2019
Purpose/Change: Initial script development
## RELATED LINKS
39 changes: 30 additions & 9 deletions Docs/Connect-AutomateAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,23 @@ Connect-AutomateAPI [-Server <String>] [-AuthorizationToken <String>] [-SkipChec

### credential
```
Connect-AutomateAPI [-AutomateCredentials <PSCredential>] [-Server <String>] [-TwoFactorToken <String>]
Connect-AutomateAPI [-Credential <PSCredential>] [-Server <String>] [-SkipCheck] [-TwoFactorToken <String>]
[-Force] [-Quiet] [<CommonParameters>]
```

### verify
```
Connect-AutomateAPI [-Server <String>] [-AuthorizationToken <String>] [-Verify] [-Quiet] [<CommonParameters>]
```

## DESCRIPTION
Connects to the Automate API and returns a bearer token which when passed with each requests grants up to an hours worth of access.

## EXAMPLES

### EXAMPLE 1
```
Connect-AutomateAPI -Server "rancor.hostedrmm.com" -AutomateCredentials $CredentialObject -TwoFactorToken "999999"
Connect-AutomateAPI -Server "rancor.hostedrmm.com" -Credentials $CredentialObject -TwoFactorToken "999999"
```

### EXAMPLE 2
Expand All @@ -41,8 +46,8 @@ Connect-AutomateAPI -Quiet

## PARAMETERS

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

```yaml
Type: PSCredential
Expand Down Expand Up @@ -73,26 +78,42 @@ Accept wildcard characters: False
```
### -AuthorizationToken
{{Fill AuthorizationToken Description}}
Used internally when quietly refreshing the Token
```yaml
Type: String
Parameter Sets: refresh
Parameter Sets: refresh, verify
Aliases:

Required: False
Position: Named
Default value: ($Script:CWACredentials.Authorization -replace 'Bearer ','')
Default value: ($Script:CWAToken.Authorization -replace 'Bearer ','')
Accept pipeline input: False
Accept wildcard characters: False
```
### -SkipCheck
{{Fill SkipCheck Description}}
Used internally when quietly refreshing the Token
```yaml
Type: SwitchParameter
Parameter Sets: refresh, credential
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -Verify
Specifies to test the current token, and if it is not valid attempt to obtain a new one using the current credentials.
Does not refresh (re-issue) the current token.
```yaml
Type: SwitchParameter
Parameter Sets: refresh
Parameter Sets: verify
Aliases:

Required: False
Expand Down
53 changes: 47 additions & 6 deletions Docs/Connect-ControlAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,22 @@ Adds credentials required to connect to the Control API
Connect-ControlAPI [-Server <String>] [-Quiet] [<CommonParameters>]
```

### verify
```
Connect-ControlAPI [-Credential <PSCredential>] [-Server <String>] [-Verify] [-Quiet] [<CommonParameters>]
```

### credential
```
Connect-ControlAPI [-ControlCredentials <PSCredential>] [-Server <String>] [-Force] [-SkipCheck] [-Quiet]
Connect-ControlAPI [-Credential <PSCredential>] [-Server <String>] [-Force] [-SkipCheck] [-Quiet]
[<CommonParameters>]
```

### apikey
```
Connect-ControlAPI [-Server <String>] [-APIKey <Object>] [-SkipCheck] [-Quiet] [<CommonParameters>]
```

## DESCRIPTION
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.
Unfortunately the Control API does not support 2FA.
Expand All @@ -36,16 +46,16 @@ All values will be prompted for one by one:

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

## PARAMETERS

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

```yaml
Type: PSCredential
Parameter Sets: credential
Parameter Sets: verify, credential
Aliases:

Required: False
Expand All @@ -71,6 +81,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -APIKey
Automate APIKey for Control Extension
```yaml
Type: Object
Parameter Sets: apikey
Aliases:

Required: False
Position: Named
Default value: ([SecureString]$Script:ControlAPIKey)
Accept pipeline input: False
Accept wildcard characters: False
```
### -Force
\[Parameter(ParameterSetName = 'credential', Mandatory = $False)\]
\[String\]$TwoFactorToken,
Expand All @@ -87,12 +112,28 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -Verify
Attempt to verify Cached API key or Credentials.
Invalid results will be removed.
```yaml
Type: SwitchParameter
Parameter Sets: verify
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -SkipCheck
{{Fill SkipCheck Description}}
Used internally when quietly refreshing the Token
```yaml
Type: SwitchParameter
Parameter Sets: credential
Parameter Sets: credential, apikey
Aliases:

Required: False
Expand Down
56 changes: 52 additions & 4 deletions Docs/Get-AutomateComputer.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,20 @@ Get-AutomateComputer [[-ComputerID] <Int32[]>] [<CommonParameters>]

### AllResults
```
Get-AutomateComputer [-AllComputers] [<CommonParameters>]
Get-AutomateComputer [-AllComputers] [-IncludeFields <String>] [-ExcludeFields <String>] [-OrderBy <String>]
[<CommonParameters>]
```

### ByCondition
```
Get-AutomateComputer [[-Condition] <String>] [<CommonParameters>]
Get-AutomateComputer [-Condition <String>] [-IncludeFields <String>] [-ExcludeFields <String>]
[-OrderBy <String>] [<CommonParameters>]
```

### CustomBuiltCondition
```
Get-AutomateComputer [-ClientName <String>] [-ClientId <Int32>] [-LocationId <Int32>] [-LocationName <String>]
Get-AutomateComputer [-IncludeFields <String>] [-ExcludeFields <String>] [-OrderBy <String>]
[-ClientName <String>] [-ClientId <Int32>] [-LocationId <Int32>] [-LocationName <String>]
[-ComputerName <String>] [-OpenPort <String>] [-OperatingSystem <String>] [-DomainName <String>]
[-NotSeenInDays <Int32>] [-Comment <String>] [-LastWindowsUpdateInDays <Int32>]
[-AntiVirusDefinitionInDays <String>] [-LocalIPAddress <String>] [-GatewayIPAddress <String>]
Expand Down Expand Up @@ -114,7 +117,52 @@ Parameter Sets: ByCondition
Aliases:

Required: False
Position: 1
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -IncludeFields
A comma separated list of fields that you want including in the returned computer object.
```yaml
Type: String
Parameter Sets: AllResults, ByCondition, CustomBuiltCondition
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -ExcludeFields
A comma separated list of fields that you want excluding in the returned computer object.
```yaml
Type: String
Parameter Sets: AllResults, ByCondition, CustomBuiltCondition
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -OrderBy
A comma separated list of fields that you want to order by finishing with either an asc or desc.
```yaml
Type: String
Parameter Sets: AllResults, ByCondition, CustomBuiltCondition
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Expand Down
4 changes: 2 additions & 2 deletions Docs/Get-AutomateControlInfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Accept wildcard characters: False
```
### -ID
{{Fill ID Description}}
Taken from the Pipeline, IE Get-AutomateComputer -ComputerID 5 | Get-AutomateControlInfo
```yaml
Type: Int16[]
Expand All @@ -65,7 +65,7 @@ Accept wildcard characters: False
```
### -ComputerObjects
{{Fill ComputerObjects Description}}
Used for Pipeline input from Get-AutomateComputer
```yaml
Type: Object
Expand Down
Loading

0 comments on commit d22ddbd

Please sign in to comment.