mirror of
https://github.com/snazy2000/SnipeitPS.git
synced 2025-12-13 18:02:30 +00:00
Merge pull request #187 from PetriAsi/feature/get-assigned-licenses
Feature/get assigned items
This commit is contained in:
commit
041c3da73b
9 changed files with 274 additions and 42 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)]
|
||||
|
|
@ -175,6 +217,8 @@ function Get-SnipeitAsset() {
|
|||
'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"}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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 = @{
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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).
|
||||
|
||||
|
|
|
|||
|
|
@ -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).
|
||||
|
||||
|
|
|
|||
|
|
@ -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).
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue