SnipeitPS/docs/Get-SnipeitAsset.md

510 lines
9.5 KiB
Markdown
Raw Normal View History

---
2021-06-08 20:20:03 +03:00
external help file: SnipeitPS-help.xml
2021-05-18 05:57:40 +03:00
Module Name: SnipeitPS
online version:
2017-11-18 19:50:47 +00:00
schema: 2.0.0
---
2021-06-08 20:23:32 +03:00
# Get-SnipeitAsset
2017-11-18 19:50:47 +00:00
## SYNOPSIS
2021-05-19 15:51:49 +03:00
Gets a list of Snipe-it Assets or specific asset
2017-11-18 19:50:47 +00:00
## SYNTAX
2021-06-12 12:30:41 +03:00
### Search (Default)
2017-11-18 19:50:47 +00:00
```
2021-06-08 22:04:25 +03:00
Get-SnipeitAsset [-search <String>] [-order_number <String>] [-model_id <Int32>] [-category_id <Int32>]
2021-06-08 16:30:12 +03:00
[-manufacturer_id <Int32>] [-company_id <Int32>] [-location_id <Int32>] [-depreciation_id <Int32>]
[-requestable <Boolean>] [-status <String>] [-status_id <Int32>] [-sort <String>] [-order <String>]
[-limit <Int32>] [-offset <Int32>] [-all] -url <String> -apiKey <String> [<CommonParameters>]
```
### Get with id
```
2021-06-08 22:04:25 +03:00
Get-SnipeitAsset [-id <Int32>] -url <String> -apiKey <String> [<CommonParameters>]
2021-06-08 16:30:12 +03:00
```
### Get with asset tag
```
2021-06-08 22:04:25 +03:00
Get-SnipeitAsset [-asset_tag <String>] -url <String> -apiKey <String> [<CommonParameters>]
2021-06-08 16:30:12 +03:00
```
### Get with serial
```
2021-06-08 22:04:25 +03:00
Get-SnipeitAsset [-serial <String>] -url <String> -apiKey <String> [<CommonParameters>]
2017-11-18 19:50:47 +00:00
```
2021-06-12 12:30:41 +03:00
### Assets due auditing soon
```
Get-SnipeitAsset [-audit_due] [-sort <String>] [-order <String>] [-limit <Int32>] [-offset <Int32>] [-all]
-url <String> -apiKey <String> [<CommonParameters>]
```
### Assets overdue for auditing
```
Get-SnipeitAsset [-audit_overdue] [-sort <String>] [-order <String>] [-limit <Int32>] [-offset <Int32>] [-all]
-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>]
```
2017-11-18 19:50:47 +00:00
## DESCRIPTION
2021-05-18 05:57:40 +03:00
{{ Fill in the Description }}
2017-11-18 19:50:47 +00:00
## EXAMPLES
2021-05-18 05:57:40 +03:00
### EXAMPLE 1
2017-11-18 19:50:47 +00:00
```
Get-SnipeitAsset -all -url "https://assets.example.com"-token "token..."
Returens all assets
2017-11-18 19:50:47 +00:00
```
2021-05-18 05:57:40 +03:00
### EXAMPLE 2
2017-11-18 19:50:47 +00:00
```
Get-SnipeitAsset -search "myMachine"
Search for specific asset
2021-05-18 05:57:40 +03:00
```
### EXAMPLE 3
```
Get-SnipeitAsset -id 3
Get asset with id number 3
2021-05-18 05:57:40 +03:00
```
### EXAMPLE 4
```
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
2017-11-18 19:50:47 +00:00
```
## PARAMETERS
### -all
A return all results, works with -offset and other parameters
2018-04-29 08:58:34 +01:00
```yaml
Type: SwitchParameter
Parameter Sets: Search, Assets due auditing soon, Assets overdue for auditing, Assets checked out to user id, Assets with component id
2021-05-18 05:57:40 +03:00
Aliases:
2018-04-29 08:58:34 +01:00
Required: False
2021-05-23 23:24:44 +03:00
Position: Named
Default value: False
2021-05-18 05:57:40 +03:00
Accept pipeline input: False
Accept wildcard characters: False
```
### -apiKey
Users API Key for Snipeit, can be set using Set-SnipeitInfo command
2021-05-18 05:57:40 +03:00
```yaml
Type: String
Parameter Sets: (All)
2021-05-18 05:57:40 +03:00
Aliases:
Required: True
2021-06-08 16:30:12 +03:00
Position: Named
Default value: None
2018-04-29 08:58:34 +01:00
Accept pipeline input: False
Accept wildcard characters: False
```
2021-05-23 23:24:44 +03:00
### -asset_tag
Exact asset tag to query
2018-04-29 08:58:34 +01:00
```yaml
2021-05-18 05:57:40 +03:00
Type: String
2021-06-08 16:30:12 +03:00
Parameter Sets: Get with asset tag
2021-05-18 05:57:40 +03:00
Aliases:
2018-04-29 08:58:34 +01:00
Required: False
2021-06-08 16:30:12 +03:00
Position: Named
2021-05-18 05:57:40 +03:00
Default value: None
2018-04-29 08:58:34 +01:00
Accept pipeline input: False
Accept wildcard characters: False
```
### -audit_due
Retrieve a list of assets that are due for auditing soon.
```yaml
Type: SwitchParameter
Parameter Sets: Assets due auditing soon
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -audit_overdue
Retrieve a list of assets that are overdue for auditing.
2021-06-12 12:30:41 +03:00
```yaml
Type: SwitchParameter
Parameter Sets: Assets overdue for auditing
2021-06-12 12:30:41 +03:00
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -category_id
Optionally restrict asset results to this category ID
2021-06-12 12:30:41 +03:00
```yaml
Type: Int32
Parameter Sets: Search
2021-06-12 12:30:41 +03:00
Aliases:
Required: False
Position: Named
Default value: 0
2021-06-12 12:30:41 +03:00
Accept pipeline input: False
Accept wildcard characters: False
```
### -company_id
Optionally restrict asset results to this company ID
2018-04-29 08:58:34 +01:00
```yaml
Type: Int32
Parameter Sets: Search
2021-05-18 05:57:40 +03:00
Aliases:
2018-04-29 08:58:34 +01:00
Required: False
2021-06-08 16:30:12 +03:00
Position: Named
2018-04-29 08:58:34 +01:00
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -component_id
{{ Fill component_id Description }}
2018-04-29 08:58:34 +01:00
```yaml
Type: Int32
Parameter Sets: Assets with component id
2021-05-18 05:57:40 +03:00
Aliases:
2018-04-29 08:58:34 +01:00
Required: False
2021-06-08 16:30:12 +03:00
Position: Named
2018-04-29 08:58:34 +01:00
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -depreciation_id
{{ Fill depreciation_id Description }}
2018-04-29 08:58:34 +01:00
```yaml
Type: Int32
2021-06-08 16:30:12 +03:00
Parameter Sets: Search
2021-05-18 05:57:40 +03:00
Aliases:
2018-04-29 08:58:34 +01:00
Required: False
2021-06-08 16:30:12 +03:00
Position: Named
Default value: 0
2018-04-29 08:58:34 +01:00
Accept pipeline input: False
Accept wildcard characters: False
```
### -id
ID number of excact snipeit asset
2021-05-18 05:57:40 +03:00
```yaml
Type: Int32
Parameter Sets: Get with id
2021-05-18 05:57:40 +03:00
Aliases:
Required: False
2021-06-08 16:30:12 +03:00
Position: Named
Default value: 0
2021-05-18 05:57:40 +03:00
Accept pipeline input: False
Accept wildcard characters: False
```
### -limit
Specify the number of results you wish to return.
Defaults to 50.
Defines batch size for -all
2021-05-18 05:57:40 +03:00
```yaml
Type: Int32
Parameter Sets: Search, Assets due auditing soon, Assets overdue for auditing, Assets checked out to user id, Assets with component id
2021-05-18 05:57:40 +03:00
Aliases:
Required: False
2021-06-08 16:30:12 +03:00
Position: Named
Default value: 50
2021-05-18 05:57:40 +03:00
Accept pipeline input: False
Accept wildcard characters: False
```
### -location_id
Optionally restrict asset results to this location ID
2018-04-29 08:58:34 +01:00
```yaml
Type: Int32
2021-06-08 16:30:12 +03:00
Parameter Sets: Search
2021-05-18 05:57:40 +03:00
Aliases:
2018-04-29 08:58:34 +01:00
Required: False
2021-06-08 16:30:12 +03:00
Position: Named
2018-04-29 08:58:34 +01:00
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -manufacturer_id
Optionally restrict asset results to this manufacturer ID
2018-04-29 08:58:34 +01:00
```yaml
2021-05-18 05:57:40 +03:00
Type: Int32
2021-06-08 16:30:12 +03:00
Parameter Sets: Search
2021-05-18 05:57:40 +03:00
Aliases:
2018-04-29 08:58:34 +01:00
Required: False
2021-06-08 16:30:12 +03:00
Position: Named
2021-05-18 05:57:40 +03:00
Default value: 0
2018-04-29 08:58:34 +01:00
Accept pipeline input: False
Accept wildcard characters: False
```
### -model_id
Optionally restrict asset results to this asset model ID
2018-04-29 08:58:34 +01:00
```yaml
2021-05-23 23:24:44 +03:00
Type: Int32
2021-06-08 16:30:12 +03:00
Parameter Sets: Search
2021-05-18 05:57:40 +03:00
Aliases:
2018-04-29 08:58:34 +01:00
Required: False
2021-06-08 16:30:12 +03:00
Position: Named
2021-05-23 23:24:44 +03:00
Default value: 0
2018-04-29 08:58:34 +01:00
Accept pipeline input: False
Accept wildcard characters: False
```
### -offset
Offset to use
2018-04-29 08:58:34 +01:00
```yaml
2021-05-23 23:24:44 +03:00
Type: Int32
Parameter Sets: Search, Assets due auditing soon, Assets overdue for auditing, Assets checked out to user id, Assets with component id
2021-05-18 05:57:40 +03:00
Aliases:
2018-04-29 08:58:34 +01:00
Required: False
2021-06-08 16:30:12 +03:00
Position: Named
2021-05-23 23:24:44 +03:00
Default value: 0
2018-04-29 08:58:34 +01:00
Accept pipeline input: False
Accept wildcard characters: False
```
### -order
Specify the order (asc or desc) you wish to order by on your sort column
2018-04-29 08:58:34 +01:00
```yaml
Type: String
Parameter Sets: Search, Assets due auditing soon, Assets overdue for auditing, Assets checked out to user id, Assets with component id
2021-05-18 05:57:40 +03:00
Aliases:
2018-04-29 08:58:34 +01:00
Required: False
2021-06-08 16:30:12 +03:00
Position: Named
Default value: None
2018-04-29 08:58:34 +01:00
Accept pipeline input: False
Accept wildcard characters: False
```
### -order_number
Optionally restrict asset results to this order number
2018-04-29 08:58:34 +01:00
```yaml
2021-06-06 06:22:08 +03:00
Type: String
2021-06-08 16:30:12 +03:00
Parameter Sets: Search
2021-05-18 05:57:40 +03:00
Aliases:
Required: False
2021-06-08 16:30:12 +03:00
Position: Named
2021-06-08 22:04:25 +03:00
Default value: None
2021-05-18 05:57:40 +03:00
Accept pipeline input: False
Accept wildcard characters: False
```
### -requestable
{{ Fill requestable Description }}
2021-05-18 05:57:40 +03:00
```yaml
Type: Boolean
2021-06-08 16:30:12 +03:00
Parameter Sets: Search
2021-05-18 05:57:40 +03:00
Aliases:
2018-04-29 08:58:34 +01:00
Required: False
2021-06-08 16:30:12 +03:00
Position: Named
Default value: False
2018-04-29 08:58:34 +01:00
Accept pipeline input: False
Accept wildcard characters: False
```
### -search
A text string to search the assets data
2018-04-29 08:58:34 +01:00
```yaml
2021-05-23 23:24:44 +03:00
Type: String
Parameter Sets: Search
2021-05-18 05:57:40 +03:00
Aliases:
2018-04-29 08:58:34 +01:00
Required: False
2021-06-08 16:30:12 +03:00
Position: Named
2021-05-23 23:24:44 +03:00
Default value: None
2018-04-29 08:58:34 +01:00
Accept pipeline input: False
Accept wildcard characters: False
```
### -serial
{{ Fill serial Description }}
2021-06-06 06:22:08 +03:00
```yaml
Type: String
Parameter Sets: Get with serial
Aliases: asset_serial
2021-06-06 06:22:08 +03:00
Required: False
2021-06-08 16:30:12 +03:00
Position: Named
2021-06-06 06:22:08 +03:00
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -sort
Specify the column name you wish to sort by
2017-11-18 19:50:47 +00:00
```yaml
Type: String
Parameter Sets: Search, Assets due auditing soon, Assets overdue for auditing, Assets checked out to user id, Assets with component id
2021-05-18 05:57:40 +03:00
Aliases:
2017-11-18 19:50:47 +00:00
2021-05-18 05:57:40 +03:00
Required: False
2021-06-08 16:30:12 +03:00
Position: Named
Default value: None
2021-05-18 05:57:40 +03:00
Accept pipeline input: False
Accept wildcard characters: False
```
### -status
Optionally restrict asset results to one of these status types: RTD, Deployed, Undeployable, Deleted, Archived, Requestable
2021-05-18 05:57:40 +03:00
```yaml
Type: String
Parameter Sets: Search
2021-05-18 05:57:40 +03:00
Aliases:
Required: False
2021-06-08 16:30:12 +03:00
Position: Named
Default value: None
2017-11-18 19:50:47 +00:00
Accept pipeline input: False
Accept wildcard characters: False
```
### -status_id
Optionally restrict asset results to this status label ID
2021-05-18 05:57:40 +03:00
```yaml
Type: Int32
Parameter Sets: Search
2021-05-18 05:57:40 +03:00
Aliases:
2021-05-23 23:24:44 +03:00
Required: False
2021-06-08 16:30:12 +03:00
Position: Named
Default value: 0
2021-05-18 05:57:40 +03:00
Accept pipeline input: False
Accept wildcard characters: False
```
2021-05-23 23:24:44 +03:00
### -url
2021-06-08 20:23:32 +03:00
URL of Snipeit system, can be set using Set-SnipeitInfo command
2017-11-18 19:50:47 +00:00
```yaml
Type: String
Parameter Sets: (All)
2021-05-18 05:57:40 +03:00
Aliases:
2017-11-18 19:50:47 +00:00
Required: True
2021-06-08 16:30:12 +03:00
Position: Named
2017-11-18 19:50:47 +00:00
Default value: None
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
```
2021-05-18 05:57:40 +03:00
### 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).
2017-11-18 19:50:47 +00:00
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS