Skip to content
This repository has been archived by the owner on Aug 25, 2024. It is now read-only.

Commit

Permalink
Merge 2.0 to Master (#28)
Browse files Browse the repository at this point in the history
* added new connect-smaserver cmdlet

* new auth method for New-APIGetRequest

* [WIP-v2.0] Get-SmaMachineInventory

* [WIPv2.0] GET /machines updated

* [WIP-v2.0] version bump in manifest

* [WIP-v2.0]better err handling during auth #23

* remove declaration for get-smaarchiveasset  #9

* [WIPv2.0] GET /assets updated

* updated readme

* [WIP-v2.0] /ManagedInstall and /Reporting updated

* [WIP-v2.0] /PUT cmdlets updated

* removed non-working /api/script endpoint #11

* [WIP-v2.0] /POST requests

* [WIP-v2.0] last group of /GET requests

* [WIP-v2.0] added /DELETE cmdlets

* formatting

* formatting

* convert to external markdown help

* external help xml created

* docs update

* fix external help file?

* get-help -full should resolve now

* get-help -online should open to docs, once merged

* added positional parameters where appropriate #25

* pester tests refactor for new authentication

* azuredevops pipeline stuffs

* Update azure-pipelines.yml for Azure Pipelines

* build fixes

* build fixes

* Update azure-pipelines.yml for Azure Pipelines

* test

* nore fixes

* more build fixes

* Update azure-pipelines.yml for Azure Pipelines

* Update azure-pipelines.yml for Azure Pipelines

* Update azure-pipelines.yml for Azure Pipelines

* Update azure-pipelines.yml for Azure Pipelines

* Update azure-pipelines.yml for Azure Pipelines

* build fixes

* anyone reading these, i'm sorry

* fix psake

* more fix

* psake

* try to get newest v of pester

* fix build output file

* moar fix much hope

* .

* try fix

* Add pwsh (Core) test env

* Update azure-pipelines.yml for Azure Pipelines

* remove unnecessary property from connect-server

* readme updated

* WIP-pipeline-part-1

* clean up readme

* final pipeline refactor

* docs update for new parameters

* Final commit to WIP for v2.0
  • Loading branch information
ArtisanByteCrafter authored Nov 13, 2019
1 parent 3abca1f commit 26b46b0
Show file tree
Hide file tree
Showing 117 changed files with 10,162 additions and 4,122 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BuildOutput
22 changes: 22 additions & 0 deletions Build/build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
param(
[string[]]
$Task = 'Default'
)

Get-PackageProvider -Name NuGet -ForceBootstrap > $null

$ModuleRoot = (Split-Path $PSScriptRoot -Parent)

Install-Module Psake,Pester -Scope CurrentUser -Force


Import-Module -Name Psake, (Join-Path $ModuleRoot KaceSma.psd1)

$invokePsakeSplat = @{
TaskList = $Task
NoLogo = $true
BuildFile = "$PSScriptRoot/Psake.ps1"
}
Invoke-Psake @invokePsakeSplat

exit [int](-not $Psake.Build_Success)
31 changes: 31 additions & 0 deletions Build/psake.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Task 'Default' -Depends 'Pester'

Task 'Init' {
$ModuleRoot = (Split-Path $PSScriptRoot -Parent)

Import-Module -Name Psake, (Join-Path $ModuleRoot KaceSma.psd1)

}


task 'Pester' -depends 'Init' {
$Timestamp = Get-Date -Format "yyyyMMdd-hhmmss"
$PSVersion = $PSVersionTable.PSVersion.Major
$ModuleRoot = (Split-Path $PSScriptRoot -Parent)

$TestFile = "PSv${PSVersion}_${TimeStamp}_KaceSMA.TestResults.xml"

$PesterParams = @{
Path = (Join-Path (Split-Path $PSScriptRoot -Parent) 'tests')
PassThru = $true
OutputFormat = 'NUnitXml'
OutputFile = (Join-Path $ModuleRoot $TestFile)
Show = "Header", "Failed", "Summary"
}

$TestResults = Invoke-Pester @PesterParams

if ($TestResults.FailedCount -gt 0) {
Write-Error "Failed $($TestResults.FailedCount) tests; build failed!"
}
}
Binary file modified KaceSMA.psd1
Binary file not shown.
51 changes: 35 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,46 @@
# KaceSMA
[![](https://img.shields.io/powershellgallery/v/KaceSMA.svg?logo=powershell&colorA=1C8FDB&logoColor=ffffff&colorB=145C8B)](https://www.powershellgallery.com/packages/KaceSMA)
![](https://img.shields.io/powershellgallery/dt/KaceSMA.svg?logo=powershell&colorA=1C8FDB&logoColor=ffffff&colorB=145C8B)
[![GitHub issues](https://img.shields.io/github/issues/ArtisanByteCrafter/KaceSMA.svg?style=flat&colorA=1C8FDB)](https://github.com/ArtisanByteCrafter/KaceSMA/issues)
---

A module for interacting with a Quest Kace Systems Management Appliance via Powershell.
[![Build Status](https://artisanbytecrafter.visualstudio.com/KaceSMA/_apis/build/status/ArtisanByteCrafter.KaceSMA?branchName=WIP-v2.0)](https://artisanbytecrafter.visualstudio.com/KaceSMA/_build/latest?definitionId=3&branchName=WIP-v2.0) [![](https://img.shields.io/powershellgallery/v/KaceSMA.svg?logo=powershell&colorA=1C8FDB&logoColor=ffffff&colorB=145C8B)](https://www.powershellgallery.com/packages/KaceSMA)
![](https://img.shields.io/powershellgallery/dt/KaceSMA.svg?logo=powershell&colorA=1C8FDB&logoColor=ffffff&colorB=145C8B)

This module utilizes the Kace SMA API via Powershell and returns PS Objects that can be used in innumerable automation tasks.

This module is [available on the Powershell Gallery](https://www.powershellgallery.com/packages/KaceSMA/)

To Install:
---
A Powershell module for administering and interacting with a Quest Systems Management Appliance (SMA) via it's API interface.



### To Install

````powershell
Install-Module KaceSMA
````

Questions or comments?
---
Join the community Slack channel (#API) at https://kacecommunity.slack.com/

Wiki
---
* [Home](https://github.com/ArtisanByteCrafter/KaceSMA/wiki)
* [Frequently Asked Questions](https://github.com/ArtisanByteCrafter/KaceSMA/wiki/FAQ)
### Quickstart

- Import the module
- Authenticate to the appliance
- Perform a request

```powershell
PS> Import-Module KaceSma
PS> Connect-SmaServer -Server 'https://kace.example.com' -Org 'Default' -Credential (Get-Credential)
PS> Get-SmaServiceDeskTicket -Id 1
title : I want to reset my password
created : 2019-06-13 09:01:13
modified : 2019-06-13 09:31:02
id : 1
hd_queue_id : 10
sla_dates : {}
```

## FAQ

[Visit the FAQ on the wiki](https://github.com/ArtisanByteCrafter/KaceSMA/wiki/FAQ)

## Questions or comments?

---
Join the community [Slack channel]((https://kacecommunity.slack.com/)) (`#Api`)
24 changes: 24 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
pool:
vmImage: windows-latest

steps:
- task: PowerShell@2
displayName: 'Pester Tests - Windows Powershell'
inputs:
filePath: '.\Build\build.ps1'
failOnStderr: true

- task: PowerShell@2
displayName: 'Pester Tests - Powershell Core'
inputs:
filePath: './Build/build.ps1'
failOnStderr: true
pwsh: true

- task: PublishTestResults@2
inputs:
testResultsFormat: 'NUnit'
testResultsFiles: '**/*.TestResults.xml'
mergeTestResults: true
failTaskOnFailedTests: true
testRunTitle: 'Test Run'
93 changes: 93 additions & 0 deletions docs/Connect-SmaServer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
external help file: KaceSMA-help.xml
Module Name: KaceSMA
online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Connect-SmaServer.md
schema: 2.0.0
---

# Connect-SmaServer

## SYNOPSIS

## SYNTAX

```
Connect-SmaServer [-Server] <String> [-Org] <String> [-Credential] <PSCredential> [<CommonParameters>]
```

## DESCRIPTION
Connect to a SMA server. This command generates an access token to be used during the same session. This token has an expiration of 1 hour, after which you must authenticate again.

## EXAMPLES

### Example 1
```powershell
PS C:\> Connect-SmaServer -Server 'https://kace.example.com' -Org 'Default' -Credential (Get-Credential)
Server Org Status Protocol User
------ ---- ------ -------- ----
kace.example.com Default Connected HTTPS my_user
```

Connects to the default org of a Kace SMA Server.

## PARAMETERS

### -Credential
The credentials of the user authenticating to the SMA Server

```yaml
Type: PSCredential
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Org
The SMA org to connect to.
```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Server
The FQDN of the appliance. Must begin with `https://`

```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

### None

## OUTPUTS

### System.PSCustomObject
## NOTES

## RELATED LINKS
111 changes: 111 additions & 0 deletions docs/Get-SmaAgentlessInventory.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
---
external help file: KaceSMA-help.xml
Module Name: KaceSMA
online version: https://github.com/ArtisanByteCrafter/KaceSMA/blob/master/docs/Get-SmaAgentlessInventory.md
schema: 2.0.0
---

# Get-SmaAgentlessInventory

## SYNOPSIS

## SYNTAX

```
Get-SmaAgentlessInventory [-Id <Int32>] [[-QueryParameters] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Returns information about the SMA agentless inventory, or a specific node.

## EXAMPLES

### EXAMPLE 1
```
Get-SmaAgentlessInventory
```

Retrieves information about all agentless inventory nodes

### EXAMPLE 2
```
Get-SmaAgentlessInventory -NodeID 1234
```

Retrieves node information about an agentless node with with ID 1234.

## PARAMETERS

### -Confirm
Prompts you for confirmation before running the cmdlet.

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

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -QueryParameters
Any additional query parameters to be included.
String must begin with a '?' character.
```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Id
Specifies the id of the node to query.
```yaml
Type: Int32
Parameter Sets: (All)
Aliases: NodesId

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
### PSCustomObject
## NOTES
## RELATED LINKS
Loading

0 comments on commit 26b46b0

Please sign in to comment.