merged upstream/develop

This commit is contained in:
Petri Asikainen 2021-06-17 20:02:00 +03:00
commit 95839398e9
36 changed files with 542 additions and 160 deletions

32
.github/ISSUE_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1,32 @@
## Context
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->
* SnipitPS Module version used:
* Operating System and PowerShell version:
* Snipe It version:
## Expected Behavior
<!--- If you're describing a bug, tell us what should happen -->
<!--- If you're suggesting a change/improvement, tell us how it should work -->
## Current Behavior
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
<!--- Please add command output with -Verbose and if possible -Debug switches -->
## Possible Solution
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
<!--- or ideas how to implement the addition or change -->
## Steps to Reproduce (for bugs)
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->
1.
2.
3.
4.

View file

@ -5,6 +5,31 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/),
and this project adheres to [Semantic Versioning](http://semver.org/).
# [v.1.8.x] - 2021-06-17
## Support for new Snipe it endpoints
## New features
Get-SnipeitAccessories -user_id
returns accessories checked out to user id
Get-SnipeitAsset -user_id
Return Assets checked out to user id
Get-SnipeitAsset -component_id
Returns assets with specific component id
Get-SnipeitLicense -user_id
Get licenses checked out to user ID
Get-SnipeitLicense -asset_id
Get licenses checked out to asset ID
Get-SnipeitUser -accessory_id
Get users that have specific accessory id checked out
# [v.1.7.x] - 2021-06-14
## Consumables

View file

@ -32,6 +32,10 @@ Get-SnipeitAccessory -search Keyboard
.EXAMPLE
Get-SnipeitAccessory -id 1
.EXAMPLE
Get-SnipeitAccessory -user_id 1
Get accessories checked out to user ID 1
#>
function Get-SnipeitAccessory() {
@ -43,6 +47,9 @@ function Get-SnipeitAccessory() {
[parameter(ParameterSetName='Get by ID')]
[int]$id,
[parameter(ParameterSetName='Accessories checked out to user id')]
[int]$user_id,
[parameter(ParameterSetName='Search')]
[int]$company_id,
@ -69,6 +76,7 @@ function Get-SnipeitAccessory() {
[int]$offset,
[parameter(ParameterSetName='Search')]
[parameter(ParameterSetName='Accessories checked out to user id')]
[switch]$all = $false,
[parameter(mandatory = $true)]
@ -79,23 +87,21 @@ function Get-SnipeitAccessory() {
)
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
if ($id -and $search){
throw "Please specify only one of -id or -search parameter"
switch($PsCmdlet.ParameterSetName) {
'Search' {$apiurl = "$url/api/v1/accessories"}
'Get by ID' {$apiurl= "$url/api/v1/accessories/$id"}
'Accessories checked out to user id' {$apiurl = "$url/api/v1/users/$user_id/accessories"}
}
$SearchParameter = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
$Parameters = @{
Uri = "$url/api/v1/accessories"
Uri = $apiurl
Method = 'Get'
GetParameters = $SearchParameter
Token = $apiKey
}
if($id){
$Parameters.Uri ="$url/api/v1/accessories/$id"
}
if ($all) {
$offstart = $(if($offset){$offset} Else {0})
$callargs = $SearchParameter

View file

@ -66,16 +66,42 @@ URL of Snipeit system, can be set using Set-SnipeitInfo command
Users API Key for Snipeit, can be set using Set-SnipeitInfo command
.EXAMPLE
Get-SnipeitAsset -url "https://assets.example.com"-token "token..."
Get-SnipeitAsset -all -url "https://assets.example.com"-token "token..."
Returens all assets
.EXAMPLE
Get-SnipeitAsset -search "myMachine"-url "https://assets.example.com"-token "token..."
Get-SnipeitAsset -search "myMachine"
Search for specific asset
.EXAMPLE
Get-SnipeitAsset -search "myMachine"-url "https://assets.example.com"-token "token..."
Get-SnipeitAsset -id 3
Get asset with id number 3
.EXAMPLE
Get-SnipeitAsset -asset_tag "myAssetTag"-url "https://assets.example.com"-token "token..."
Get-SnipeitAsset -asset_tag snipe0003
Get asset with asset tag snipe00033
.EXAMPLE
Get-SnipeitAsset -serial 1234
Get asset with searial number 1234
.EXAMPLE
Get-SnipeitAsser -audit_due
Get Assets due auditing soon
.EXAMPLE
Get-SnipeitAsser -audit_overdue
Get Assets overdue for auditing
.EXAMPLE
Get-AnipeitAsset -user_id 4
Get Assets checked out to user id 4
.EXAMPLE
Get-SnipeitAsset -component_id 5
Get Assets with component id 5
#>
function Get-SnipeitAsset() {
@ -100,6 +126,12 @@ function Get-SnipeitAsset() {
[parameter(ParameterSetName='Assets overdue for auditing')]
[switch]$audit_overdue,
[parameter(ParameterSetName='Assets checked out to user id')]
[int]$user_id,
[parameter(ParameterSetName='Assets with component id')]
[int]$component_id,
[parameter(ParameterSetName='Search')]
[string]$order_number,
@ -133,28 +165,38 @@ function Get-SnipeitAsset() {
[parameter(ParameterSetName='Search')]
[parameter(ParameterSetName='Assets due auditing soon')]
[parameter(ParameterSetName='Assets overdue for auditing')]
[parameter(ParameterSetName='Assets checked out to user id')]
[parameter(ParameterSetName='Assets with component id')]
[ValidateSet('id','created_at','asset_tag','serial','order_number','model_id','category_id','manufacturer_id','company_id','location_id','status','status_id')]
[string]$sort,
[parameter(ParameterSetName='Search')]
[parameter(ParameterSetName='Assets due auditing soon')]
[parameter(ParameterSetName='Assets overdue for auditing')]
[parameter(ParameterSetName='Assets checked out to user id')]
[parameter(ParameterSetName='Assets with component id')]
[ValidateSet("asc", "desc")]
[string]$order,
[parameter(ParameterSetName='Search')]
[parameter(ParameterSetName='Assets due auditing soon')]
[parameter(ParameterSetName='Assets overdue for auditing')]
[parameter(ParameterSetName='Assets checked out to user id')]
[parameter(ParameterSetName='Assets with component id')]
[int]$limit = 50,
[parameter(ParameterSetName='Search')]
[parameter(ParameterSetName='Assets due auditing soon')]
[parameter(ParameterSetName='Assets overdue for auditing')]
[parameter(ParameterSetName='Assets checked out to user id')]
[parameter(ParameterSetName='Assets with component id')]
[int]$offset,
[parameter(ParameterSetName='Search')]
[parameter(ParameterSetName='Assets due auditing soon')]
[parameter(ParameterSetName='Assets overdue for auditing')]
[parameter(ParameterSetName='Assets checked out to user id')]
[parameter(ParameterSetName='Assets with component id')]
[switch]$all = $false,
[parameter(mandatory = $true)]
@ -172,9 +214,11 @@ function Get-SnipeitAsset() {
'Search' { $apiurl = "$url/api/v1/hardware" }
'Get with id' {$apiurl= "$url/api/v1/hardware/$id"}
'Get with asset tag' {$apiurl= "$url/api/v1/hardware/bytag/$asset_tag"}
'Get with serial' { $apiurl= "$url/api/v1/hardware/byserial/$asset_serial"}
'Get with serial' { $apiurl= "$url/api/v1/hardware/byserial/$serial"}
'Assets due auditing soon' {$apiurl = "$url/api/v1/hardware/audit/due"}
'Assets overdue for auditing' {$apiurl = "$url/api/v1/hardware/audit/overdue"}
'Assets checked out to user id'{$apiurl = "$url/api/v1/users/$user_id/assets"}
'Assets with component id' {$apiurl = "$url/api/v1/components/$component_id/assets"}
}
$Parameters = @{

View file

@ -41,6 +41,12 @@ function Get-SnipeitLicense() {
[parameter(ParameterSetName='Get with ID')]
[int]$id,
[parameter(ParameterSetName='Get licenses checked out to user ID')]
[int]$user_id,
[parameter(ParameterSetName='Get licenses checked out to asset ID')]
[int]$asset_id,
[parameter(ParameterSetName='Search')]
[string]$name,
@ -87,7 +93,8 @@ function Get-SnipeitLicense() {
[parameter(ParameterSetName='Search')]
[int]$offset,
[parameter(ParameterSetName='Get licenses checked out to user ID')]
[parameter(ParameterSetName='Get licenses checked out to asset ID')]
[parameter(ParameterSetName='Search')]
[switch]$all = $false,
@ -102,14 +109,11 @@ function Get-SnipeitLicense() {
$SearchParameter = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
$apiurl = "$url/api/v1/licenses"
if ($search -and $id ) {
Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both "
}
if ($id) {
$apiurl= "$url/api/v1/licenses/$id"
switch($PsCmdlet.ParameterSetName) {
'Search' {$apiurl = "$url/api/v1/licenses"}
'Get with ID' {$apiurl= "$url/api/v1/licenses/$id"}
'Get licenses checked out to user ID' {$apiurl= "$url/api/v1/users/$user_id/licenses"}
'Get licenses checked out to asset ID' {$apiurl= "$url/api/v1/hardware/$asset_id/licenses"}
}
$Parameters = @{

View file

@ -40,6 +40,10 @@ Get-SnipeitUser -username someuser
.EXAMPLE
Get-SnipeitUser -email user@somedomain.com
.EXAMPLE
Get-SnipeitUser -accessory_id 3
Get users with accessory id 3 has been checked out to
#>
function Get-SnipeitUser() {
@ -51,6 +55,9 @@ function Get-SnipeitUser() {
[parameter(ParameterSetName='Get with ID')]
[string]$id,
[parameter(ParameterSetName='Get users a specific accessory id has been checked out to')]
[string]$accessory_id,
[parameter(ParameterSetName='Search')]
[int]$company_id,
@ -80,6 +87,7 @@ function Get-SnipeitUser() {
[int]$offset,
[parameter(ParameterSetName='Search')]
[parameter(ParameterSetName='Get users a specific accessory id has been checked out to')]
[switch]$all = $false,
[parameter(mandatory = $true)]
@ -92,16 +100,12 @@ function Get-SnipeitUser() {
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$SearchParameter = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
$apiurl = "$url/api/v1/users"
if ($search -and $id ) {
Throw "[$($MyInvocation.MyCommand.Name)] Please specify only -search or -id parameter , not both "
switch ($PsCmdlet.ParameterSetName) {
'Search' { $apiurl = "$url/api/v1/users"}
'Get with id' {$apiurl= "$url/api/v1/users/$id"}
'Get users a specific accessory id has been checked out to' {$apiurl= "$url/api/v1/accessories/$accessory_id/checkedout"}
}
if ($id) {
$apiurl= "$url/api/v1/users/$id"
}
$Parameters = @{
Uri = $apiurl
Method = 'Get'

View file

@ -23,6 +23,9 @@ ID Number of the company the accessory is assigned to
.PARAMETER manufacturer_id
ID number of the manufacturer for this accessory.
.PARAMETER model_number
Model number for this accessory
.PARAMETER order_number
Order number for this accessory.
@ -47,7 +50,7 @@ ID number of the supplier for this accessory
.PARAMETER location_id
ID number of the location the accessory is assigned to
.PARAMETER min_qty
.PARAMETER min_amt
Min quantity of the accessory before alert is triggered
.PARAMETER url
@ -86,11 +89,13 @@ function New-SnipeitAccessory() {
[string]$order_number,
[string]$model_number,
[float]$purchase_cost,
[datetime]$purchase_date,
[int]$min_qty,
[int]$min_amt,
[ValidateRange(1, [int]::MaxValue)]
[int]$supplier_id,

View file

@ -17,6 +17,9 @@
.PARAMETER active
Can user log in to snipe-it?
.PARAMETER password
Password for user
.PARAMETER notes
User Notes

View file

@ -14,6 +14,9 @@ Notes about the accessory
.PARAMETER qty
Quantity of the accessory you have
.PARAMETER min_amt
Minimum amount of the accessory, before alert is triggered
.PARAMETER category_id
ID number of the category the accessory belongs to
@ -23,6 +26,9 @@ ID Number of the company the accessory is assigned to
.PARAMETER manufacturer_id
ID number of the manufacturer for this accessory.
.PARAMETER model_number
Model number for this accessory
.PARAMETER order_number
Order number for this accessory.
@ -78,12 +84,11 @@ function Set-SnipeitAccessory() {
[ValidateRange(1, [int]::MaxValue)]
[int]$category_id,
[ValidateRange(1, [int]::MaxValue)]
[int]$company_id,
[Nullable[System.Int32]]$company_id,
[ValidateRange(1, [int]::MaxValue)]
[int]$manufacturer_id,
[Nullable[System.Int32]]$manufacturer_id,
[string]$model_number,
[string]$order_number,
@ -91,10 +96,9 @@ function Set-SnipeitAccessory() {
[datetime]$purchase_date,
[bool]$min_qty,
[Nullable[System.Int32]]$min_amt,
[ValidateRange(1, [int]::MaxValue)]
[int]$supplier_id,
[Nullable[System.Int32]]$supplier_id,
[parameter(mandatory = $true)]
[string]$url,

View file

@ -89,21 +89,23 @@ function Set-SnipeitAsset()
[string]$name,
[ValidateRange(1, [int]::MaxValue)]
[int]$status_id,
[ValidateRange(1, [int]::MaxValue)]
[int]$model_id,
[DateTime]$last_checkout,
[int]$assigned_to,
[Nullable[System.Int32]]$assigned_to,
[int]$company_id,
[Nullable[System.Int32]]$company_id,
[string]$serial,
[string]$order_number,
[int]$warranty_months,
[Nullable[System.Int32]]$warranty_months,
[double]$purchase_cost,
@ -113,7 +115,7 @@ function Set-SnipeitAsset()
[bool]$archived,
[int]$rtd_location_id,
[Nullable[System.Int32]]$rtd_location_id,
[string]$notes,

View file

@ -17,6 +17,9 @@ ID number of category
.PARAMETER qty
Quantity of the components you have
.PARAMETER min_amt
Minimum Quantity of the components before alert is triggered
.PARAMETER location_id
ID number of the location the accessory is assigned to
@ -55,11 +58,13 @@ function Set-SnipeitComponent()
[parameter(mandatory = $true)]
[int]$qty,
[Nullable[System.Int32]]$min_amt,
[string]$name,
[int]$company_id,
[Nullable[System.Int32]]$company_id,
[int]$location_id,
[Nullable[System.Int32]]$location_id,
[string]$order_number,

View file

@ -75,25 +75,27 @@ function Set-SnipeitConsumable()
[string]$name,
[parameter(mandatory = $false)]
[ValidateRange(1, [int]::MaxValue)]
[int]$qty,
[parameter(mandatory = $false)]
[ValidateRange(1, [int]::MaxValue)]
[int]$category_id,
[parameter(mandatory = $false)]
[int]$min_amt,
[Nullable[System.Int32]]$min_amt,
[parameter(mandatory = $false)]
[int]$company_id,
[Nullable[System.Int32]]$company_id,
[parameter(mandatory = $false)]
[string]$order_number,
[parameter(mandatory = $false)]
[int]$manufacturer_id,
[Nullable[System.Int32]]$manufacturer_id,
[parameter(mandatory = $false)]
[int]$location_id,
[Nullable[System.Int32]]$location_id,
[parameter(mandatory = $false)]
[bool]$requestable,

View file

@ -43,11 +43,11 @@ function Set-SnipeitDepartment() {
[string]$name,
[int]$company_id,
[Nullable[System.Int32]]$company_id,
[int]$location_id,
[Nullable[System.Int32]]$location_id,
[int]$manager_id,
[Nullable[System.Int32]]$manager_id,
[string]$notes,

View file

@ -89,12 +89,11 @@ function Set-SnipeitLicense() {
[ValidateRange(1, [int]::MaxValue)]
[int]$category_id,
[ValidateRange(1, [int]::MaxValue)]
[int]$company_id,
[Nullable[System.Int32]]$company_id,
[datetime]$expiration_date,
[ValidateLength(1, 120)]
[mailaddress]$license_email,
[ValidateLength(1, 100)]
@ -118,8 +117,7 @@ function Set-SnipeitLicense() {
[string]$serial,
[ValidateRange(1, [int]::MaxValue)]
[int]$supplier_id,
[Nullable[System.Int32]]$supplier_id,
[datetime]$termination_date,

View file

@ -23,13 +23,17 @@
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
.EXAMPLE
Set-SnipeitLicenceSeat -ID 1 -seat_id 1 -assigned_id 3 -Verbose
Set-SnipeitLicenceSeat -ID 1 -seat_id 1 -assigned_id 3
Checkout licence to user id 3
.EXAMPLE
Set-SnipeitLicenceSeat -ID 1 -seat_id 1 -asset_id 3 -Verbose
Set-SnipeitLicenceSeat -ID 1 -seat_id 1 -asset_id 3
Checkout licence to asset id 3
.EXAMPLE
Set-SnipeitLicenceSeat -ID 1 -seat_id 1 -asset_id $null -assigned_id $null
Checkin licence seat id 1 of licence id 1
#>
function Set-SnipeitLicenseSeat()
{

View file

@ -82,11 +82,11 @@ function Set-SnipeitLocation() {
[string]$currency,
[int]$manager_id,
[Nullable[System.Int32]]$manager_id,
[string]$ldap_ou,
[int]$parent_id,
[Nullable[System.Int32]]$parent_id,
[parameter(mandatory = $true)]
[string]$url,

View file

@ -52,11 +52,10 @@ function Set-SnipeitModel() {
[int]$manufacturer_id,
[ValidateRange(1, 240)]
[int]$eol,
[Nullable[System.Int32]]$eol,
[Alias("fieldset_id")]
[int]$custom_fieldset_id,
[Nullable[System.Int32]]$custom_fieldset_id,
[parameter(mandatory = $true)]
[string]$url,

View file

@ -20,6 +20,9 @@
.PARAMETER activated
Can user log in to snipe-it?
.PARAMETER password
Password for user
.PARAMETER notes
User Notes
@ -74,10 +77,12 @@ function Set-SnipeitUser() {
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]]$id,
[ValidateLength(1,256)]
[string]$first_name,
[string]$last_name,
[ValidateLength(1,256)]
[string]$userName,
[string]$jobtitle,
@ -86,13 +91,15 @@ function Set-SnipeitUser() {
[string]$phone,
[int]$company_id,
[string]$password,
[int]$location_id,
[Nullable[System.Int32]]$company_id,
[int]$department_id,
[Nullable[System.Int32]]$location_id,
[int]$manager_id,
[Nullable[System.Int32]]$department_id,
[Nullable[System.Int32]]$manager_id,
[string]$employee_num,
@ -111,6 +118,10 @@ function Set-SnipeitUser() {
$Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
if ($password) {
$Values['password_confirmation'] = $password
}
}
process{

View file

@ -12,7 +12,7 @@
RootModule = 'SnipeitPS'
# Version number of this module.
ModuleVersion = '1.7'
ModuleVersion = '1.8'
# Supported PSEditions
# CompatiblePSEditions = @()

View file

@ -17,7 +17,7 @@ environment:
secure: UdM6qhf5B0G8liHhUrwWERCZr44iSqmg4jUq0lwlTjZs4KyeoiwnBzdej0phqIAm
PShell: '5'
version: 1.7.{build}
version: 1.8.{build}
# Don't rebuild when I tag a release on GitHub
skip_tags: true

View file

@ -24,6 +24,11 @@ Get-SnipeitAccessory [-search <String>] [-company_id <Int32>] [-category_id <Int
Get-SnipeitAccessory [-id <Int32>] -url <String> -apiKey <String> [<CommonParameters>]
```
### Accessories checked out to user id
```
Get-SnipeitAccessory [-user_id <Int32>] [-all] -url <String> -apiKey <String> [<CommonParameters>]
```
## DESCRIPTION
Gets a list of Snipe-it Accessories
@ -39,6 +44,12 @@ Get-SnipeitAccessory -search Keyboard
Get-SnipeitAccessory -id 1
```
### EXAMPLE 3
```
Get-SnipeitAccessory -user_id 1
Get accessories checked out to user ID 1
```
## PARAMETERS
### -all
@ -46,7 +57,7 @@ A return all results, works with -offset and other parameters
```yaml
Type: SwitchParameter
Parameter Sets: Search
Parameter Sets: Search, Accessories checked out to user id
Aliases:
Required: False
@ -238,6 +249,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -user_id
{{ Fill user_id Description }}
```yaml
Type: Int32
Parameter Sets: Accessories checked out to user id
Aliases:
Required: False
Position: Named
Default value: 0
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).

View file

@ -47,6 +47,18 @@ Get-SnipeitAsset [-audit_overdue] [-sort <String>] [-order <String>] [-limit <In
-url <String> -apiKey <String> [<CommonParameters>]
```
### Assets checked out to user id
```
Get-SnipeitAsset [-user_id <Int32>] [-sort <String>] [-order <String>] [-limit <Int32>] [-offset <Int32>]
[-all] -url <String> -apiKey <String> [<CommonParameters>]
```
### Assets with component id
```
Get-SnipeitAsset [-component_id <Int32>] [-sort <String>] [-order <String>] [-limit <Int32>] [-offset <Int32>]
[-all] -url <String> -apiKey <String> [<CommonParameters>]
```
## DESCRIPTION
{{ Fill in the Description }}
@ -54,22 +66,56 @@ Get-SnipeitAsset [-audit_overdue] [-sort <String>] [-order <String>] [-limit <In
### EXAMPLE 1
```
Get-SnipeitAsset -url "https://assets.example.com"-token "token..."
Get-SnipeitAsset -all -url "https://assets.example.com"-token "token..."
Returens all assets
```
### EXAMPLE 2
```
Get-SnipeitAsset -search "myMachine"-url "https://assets.example.com"-token "token..."
Get-SnipeitAsset -search "myMachine"
Search for specific asset
```
### EXAMPLE 3
```
Get-SnipeitAsset -search "myMachine"-url "https://assets.example.com"-token "token..."
Get-SnipeitAsset -id 3
Get asset with id number 3
```
### EXAMPLE 4
```
Get-SnipeitAsset -asset_tag "myAssetTag"-url "https://assets.example.com"-token "token..."
Get-SnipeitAsset -asset_tag snipe0003
Get asset with asset tag snipe00033
```
### EXAMPLE 5
```
Get-SnipeitAsset -serial 1234
Get asset with searial number 1234
```
### EXAMPLE 6
```
Get-SnipeitAsser -audit_due
Get Assets due auditing soon
```
### EXAMPLE 7
```
Get-SnipeitAsser -audit_overdue
Get Assets overdue for auditing
```
### EXAMPLE 8
```
Get-AnipeitAsset -user_id 4
Get Assets checked out to user id 4
```
### EXAMPLE 9
```
Get-SnipeitAsset -component_id 5
Get Assets with component id 5
```
## PARAMETERS
@ -79,7 +125,7 @@ A return all results, works with -offset and other parameters
```yaml
Type: SwitchParameter
Parameter Sets: Search, Assets due auditing soon, Assets overdue for auditing
Parameter Sets: Search, Assets due auditing soon, Assets overdue for auditing, Assets checked out to user id, Assets with component id
Aliases:
Required: False
@ -179,6 +225,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -component_id
{{ Fill component_id Description }}
```yaml
Type: Int32
Parameter Sets: Assets with component id
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -depreciation_id
{{ Fill depreciation_id Description }}
@ -216,7 +277,7 @@ Defines batch size for -all
```yaml
Type: Int32
Parameter Sets: Search, Assets due auditing soon, Assets overdue for auditing
Parameter Sets: Search, Assets due auditing soon, Assets overdue for auditing, Assets checked out to user id, Assets with component id
Aliases:
Required: False
@ -276,7 +337,7 @@ Offset to use
```yaml
Type: Int32
Parameter Sets: Search, Assets due auditing soon, Assets overdue for auditing
Parameter Sets: Search, Assets due auditing soon, Assets overdue for auditing, Assets checked out to user id, Assets with component id
Aliases:
Required: False
@ -291,7 +352,7 @@ Specify the order (asc or desc) you wish to order by on your sort column
```yaml
Type: String
Parameter Sets: Search, Assets due auditing soon, Assets overdue for auditing
Parameter Sets: Search, Assets due auditing soon, Assets overdue for auditing, Assets checked out to user id, Assets with component id
Aliases:
Required: False
@ -366,7 +427,7 @@ Specify the column name you wish to sort by
```yaml
Type: String
Parameter Sets: Search, Assets due auditing soon, Assets overdue for auditing
Parameter Sets: Search, Assets due auditing soon, Assets overdue for auditing, Assets checked out to user id, Assets with component id
Aliases:
Required: False
@ -421,6 +482,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -user_id
{{ Fill user_id Description }}
```yaml
Type: Int32
Parameter Sets: Assets checked out to user id
Aliases:
Required: False
Position: Named
Default value: 0
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).

View file

@ -26,6 +26,16 @@ Get-SnipeitLicense [-search <String>] [-name <String>] [-company_id <Int32>] [-p
Get-SnipeitLicense [-id <Int32>] -url <String> -apiKey <String> [<CommonParameters>]
```
### Get licenses checked out to user ID
```
Get-SnipeitLicense [-user_id <Int32>] [-all] -url <String> -apiKey <String> [<CommonParameters>]
```
### Get licenses checked out to asset ID
```
Get-SnipeitLicense [-asset_id <Int32>] [-all] -url <String> -apiKey <String> [<CommonParameters>]
```
## DESCRIPTION
{{ Fill in the Description }}
@ -48,7 +58,7 @@ A return all results, works with -offset and other parameters
```yaml
Type: SwitchParameter
Parameter Sets: Search
Parameter Sets: Search, Get licenses checked out to user ID, Get licenses checked out to asset ID
Aliases:
Required: False
@ -73,6 +83,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -asset_id
{{ Fill asset_id Description }}
```yaml
Type: Int32
Parameter Sets: Get licenses checked out to asset ID
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -category_id
{{ Fill category_id Description }}
@ -345,6 +370,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -user_id
{{ Fill user_id Description }}
```yaml
Type: Int32
Parameter Sets: Get licenses checked out to user ID
Aliases:
Required: False
Position: Named
Default value: 0
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).

View file

@ -24,6 +24,11 @@ Get-SnipeitUser [-search <String>] [-company_id <Int32>] [-location_id <Int32>]
Get-SnipeitUser [-id <String>] -url <String> -apiKey <String> [<CommonParameters>]
```
### Get users a specific accessory id has been checked out to
```
Get-SnipeitUser [-accessory_id <String>] [-all] -url <String> -apiKey <String> [<CommonParameters>]
```
## DESCRIPTION
{{ Fill in the Description }}
@ -49,14 +54,35 @@ Get-SnipeitUser -username someuser
Get-SnipeitUser -email user@somedomain.com
```
### EXAMPLE 5
```
Get-SnipeitUser -accessory_id 3
Get users with accessory id 3 has been checked out to
```
## PARAMETERS
### -accessory_id
{{ Fill accessory_id Description }}
```yaml
Type: String
Parameter Sets: Get users a specific accessory id has been checked out to
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -all
A return all results, works with -offset and other parameters
```yaml
Type: SwitchParameter
Parameter Sets: Search
Parameter Sets: Search, Get users a specific accessory id has been checked out to
Aliases:
Required: False

View file

@ -14,8 +14,8 @@ Creates new accessory on Snipe-It system
```
New-SnipeitAccessory [-name] <String> [-qty] <Int32> [-category_id] <Int32> [[-company_id] <Int32>]
[[-manufacturer_id] <Int32>] [[-order_number] <String>] [[-purchase_cost] <Single>]
[[-purchase_date] <DateTime>] [[-min_qty] <Int32>] [[-supplier_id] <Int32>] [[-location_id] <Int32>]
[[-manufacturer_id] <Int32>] [[-order_number] <String>] [[-model_number] <String>] [[-purchase_cost] <Single>]
[[-purchase_date] <DateTime>] [[-min_amt] <Int32>] [[-supplier_id] <Int32>] [[-location_id] <Int32>]
[-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
```
@ -40,7 +40,7 @@ Parameter Sets: (All)
Aliases:
Required: True
Position: 13
Position: 14
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
@ -85,7 +85,7 @@ Parameter Sets: (All)
Aliases:
Required: False
Position: 11
Position: 12
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
@ -106,7 +106,7 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -min_qty
### -min_amt
Min quantity of the accessory before alert is triggered
```yaml
@ -115,12 +115,27 @@ Parameter Sets: (All)
Aliases:
Required: False
Position: 9
Position: 10
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -model_number
Model number for this accessory
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 7
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -name
Accessory name
@ -160,7 +175,7 @@ Parameter Sets: (All)
Aliases:
Required: False
Position: 7
Position: 8
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
@ -175,7 +190,7 @@ Parameter Sets: (All)
Aliases:
Required: False
Position: 8
Position: 9
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
@ -205,7 +220,7 @@ Parameter Sets: (All)
Aliases:
Required: False
Position: 10
Position: 11
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
@ -220,7 +235,7 @@ Parameter Sets: (All)
Aliases:
Required: True
Position: 12
Position: 13
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

View file

@ -229,7 +229,7 @@ Accept wildcard characters: False
```
### -password
{{ Fill password Description }}
Password for user
```yaml
Type: String

View file

@ -14,9 +14,9 @@ Updates accessory on Snipe-It system
```
Set-SnipeitAccessory [-id] <Int32[]> [[-name] <String>] [[-qty] <Int32>] [[-category_id] <Int32>]
[[-company_id] <Int32>] [[-manufacturer_id] <Int32>] [[-order_number] <String>] [[-purchase_cost] <Single>]
[[-purchase_date] <DateTime>] [[-min_qty] <Boolean>] [[-supplier_id] <Int32>] [-url] <String>
[-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
[[-company_id] <Int32>] [[-manufacturer_id] <Int32>] [[-model_number] <String>] [[-order_number] <String>]
[[-purchase_cost] <Single>] [[-purchase_date] <DateTime>] [[-min_amt] <Int32>] [[-supplier_id] <Int32>]
[-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
```
## DESCRIPTION
@ -40,7 +40,7 @@ Parameter Sets: (All)
Aliases:
Required: True
Position: 13
Position: 14
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
@ -71,7 +71,7 @@ Aliases:
Required: False
Position: 5
Default value: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
@ -101,22 +101,37 @@ Aliases:
Required: False
Position: 6
Default value: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -min_qty
Min quantity of the accessory before alert is triggered
### -min_amt
Minimum amount of the accessory, before alert is triggered
```yaml
Type: Boolean
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 10
Default value: False
Position: 11
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -model_number
Model number for this accessory
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 7
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
@ -145,7 +160,7 @@ Parameter Sets: (All)
Aliases:
Required: False
Position: 7
Position: 8
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
@ -160,7 +175,7 @@ Parameter Sets: (All)
Aliases:
Required: False
Position: 8
Position: 9
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
@ -175,7 +190,7 @@ Parameter Sets: (All)
Aliases:
Required: False
Position: 9
Position: 10
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
@ -205,8 +220,8 @@ Parameter Sets: (All)
Aliases:
Required: False
Position: 11
Default value: 0
Position: 12
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
@ -220,7 +235,7 @@ Parameter Sets: (All)
Aliases:
Required: True
Position: 12
Position: 13
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

View file

@ -84,7 +84,7 @@ Aliases:
Required: False
Position: 6
Default value: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
@ -99,7 +99,7 @@ Aliases:
Required: False
Position: 7
Default value: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
@ -280,7 +280,7 @@ Aliases:
Required: False
Position: 15
Default value: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
@ -340,7 +340,7 @@ Aliases:
Required: False
Position: 10
Default value: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

View file

@ -13,9 +13,9 @@ Updates component
## SYNTAX
```
Set-SnipeitComponent [-id] <Int32> [-qty] <Int32> [[-name] <String>] [[-company_id] <Int32>]
[[-location_id] <Int32>] [[-order_number] <String>] [[-purchase_date] <DateTime>] [[-purchase_cost] <Single>]
[-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
Set-SnipeitComponent [-id] <Int32[]> [-qty] <Int32> [[-min_amt] <Int32>] [[-name] <String>]
[[-company_id] <Int32>] [[-location_id] <Int32>] [[-order_number] <String>] [[-purchase_date] <DateTime>]
[[-purchase_cost] <Single>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
```
## DESCRIPTION
@ -39,7 +39,7 @@ Parameter Sets: (All)
Aliases:
Required: True
Position: 10
Position: 11
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
@ -54,8 +54,8 @@ Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: 0
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
@ -64,14 +64,14 @@ Accept wildcard characters: False
ID number of name
```yaml
Type: Int32
Type: Int32[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: 0
Accept pipeline input: False
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
@ -84,8 +84,23 @@ Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: 0
Position: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -min_amt
Minimum Quantity of the components before alert is triggered
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
@ -99,7 +114,7 @@ Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
@ -114,7 +129,7 @@ Parameter Sets: (All)
Aliases:
Required: False
Position: 6
Position: 7
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
@ -129,7 +144,7 @@ Parameter Sets: (All)
Aliases:
Required: False
Position: 8
Position: 9
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
@ -144,7 +159,7 @@ Parameter Sets: (All)
Aliases:
Required: False
Position: 7
Position: 8
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
@ -174,7 +189,7 @@ Parameter Sets: (All)
Aliases:
Required: True
Position: 9
Position: 10
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

View file

@ -73,7 +73,7 @@ Aliases:
Required: False
Position: 6
Default value: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
@ -118,7 +118,7 @@ Aliases:
Required: False
Position: 9
Default value: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
@ -133,7 +133,7 @@ Aliases:
Required: False
Position: 8
Default value: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
@ -148,7 +148,7 @@ Aliases:
Required: False
Position: 5
Default value: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

View file

@ -55,7 +55,7 @@ Aliases:
Required: False
Position: 3
Default value: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
@ -85,7 +85,7 @@ Aliases:
Required: False
Position: 4
Default value: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
@ -100,7 +100,7 @@ Aliases:
Required: False
Position: 5
Default value: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

View file

@ -73,7 +73,7 @@ Aliases:
Required: False
Position: 5
Default value: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
@ -298,7 +298,7 @@ Aliases:
Required: False
Position: 17
Default value: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

View file

@ -24,16 +24,22 @@ Checkout specific license seat to user, asset or both
### EXAMPLE 1
```
Set-SnipeitLicenceSeat -ID 1 -seat_id 1 -assigned_id 3 -Verbose
Set-SnipeitLicenceSeat -ID 1 -seat_id 1 -assigned_id 3
Checkout licence to user id 3
```
### EXAMPLE 2
```
Set-SnipeitLicenceSeat -ID 1 -seat_id 1 -asset_id 3 -Verbose
Set-SnipeitLicenceSeat -ID 1 -seat_id 1 -asset_id 3
Checkout licence to asset id 3
```
### EXAMPLE 3
```
Set-SnipeitLicenceSeat -ID 1 -seat_id 1 -asset_id $null -assigned_id $null
Checkin licence seat id 1 of licence id 1
```
## PARAMETERS
### -apiKey
@ -61,7 +67,7 @@ Aliases:
Required: False
Position: 4
Default value: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
@ -76,7 +82,7 @@ Aliases: assigned_id
Required: False
Position: 3
Default value: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

View file

@ -161,7 +161,7 @@ Aliases:
Required: False
Position: 10
Default value: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
@ -191,7 +191,7 @@ Aliases:
Required: False
Position: 12
Default value: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

View file

@ -70,7 +70,7 @@ Aliases: fieldset_id
Required: False
Position: 7
Default value: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
@ -85,7 +85,7 @@ Aliases:
Required: False
Position: 6
Default value: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

View file

@ -14,7 +14,7 @@ Creates a new user
```
Set-SnipeitUser [-id] <Int32[]> [[-first_name] <String>] [[-last_name] <String>] [[-userName] <String>]
[[-jobtitle] <String>] [[-email] <String>] [[-phone] <String>] [[-company_id] <Int32>]
[[-jobtitle] <String>] [[-email] <String>] [[-phone] <String>] [[-password] <String>] [[-company_id] <Int32>]
[[-location_id] <Int32>] [[-department_id] <Int32>] [[-manager_id] <Int32>] [[-employee_num] <String>]
[[-activated] <Boolean>] [[-notes] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm]
[<CommonParameters>]
@ -42,7 +42,7 @@ Parameter Sets: (All)
Aliases:
Required: False
Position: 13
Position: 14
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
@ -57,7 +57,7 @@ Parameter Sets: (All)
Aliases:
Required: True
Position: 16
Position: 17
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
@ -72,8 +72,8 @@ Parameter Sets: (All)
Aliases:
Required: False
Position: 8
Default value: 0
Position: 9
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
@ -87,8 +87,8 @@ Parameter Sets: (All)
Aliases:
Required: False
Position: 10
Default value: 0
Position: 11
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
@ -117,7 +117,7 @@ Parameter Sets: (All)
Aliases:
Required: False
Position: 12
Position: 13
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
@ -192,8 +192,8 @@ Parameter Sets: (All)
Aliases:
Required: False
Position: 9
Default value: 0
Position: 10
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
@ -207,8 +207,8 @@ Parameter Sets: (All)
Aliases:
Required: False
Position: 11
Default value: 0
Position: 12
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
@ -222,7 +222,22 @@ Parameter Sets: (All)
Aliases:
Required: False
Position: 14
Position: 15
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -password
Password for user
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 8
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
@ -252,7 +267,7 @@ Parameter Sets: (All)
Aliases:
Required: True
Position: 15
Position: 16
Default value: None
Accept pipeline input: False
Accept wildcard characters: False