SnipeitPS/docs/New-SnipeitAsset.md

385 lines
7.1 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
2021-05-19 15:51:49 +03:00
online version:
2017-11-18 19:50:47 +00:00
schema: 2.0.0
---
2021-06-08 20:23:32 +03:00
# New-SnipeitAsset
2017-11-18 19:50:47 +00:00
## SYNOPSIS
2017-11-20 09:07:58 +00:00
Add a new Asset to Snipe-it asset system
2017-11-18 19:50:47 +00:00
## SYNTAX
2021-07-29 12:49:16 +03:00
### Create asset (Default)
2017-11-18 19:50:47 +00:00
```
2021-07-29 12:49:16 +03:00
New-SnipeitAsset -status_id <Int32> -model_id <Int32> [-name <String>] [-asset_tag <String>] [-serial <String>]
[-company_id <Int32>] [-order_number <String>] [-notes <String>] [-warranty_months <Int32>]
[-purchase_cost <String>] [-purchase_date <DateTime>] [-supplier_id <Int32>] [-rtd_location_id <Int32>]
[-image <String>] -url <String> -apiKey <String> [-customfields <Hashtable>] [-WhatIf] [-Confirm]
[<CommonParameters>]
```
### Checkout asset when creating
```
New-SnipeitAsset -status_id <Int32> -model_id <Int32> [-name <String>] [-asset_tag <String>] [-serial <String>]
[-company_id <Int32>] [-order_number <String>] [-notes <String>] [-warranty_months <Int32>]
[-purchase_cost <String>] [-purchase_date <DateTime>] [-supplier_id <Int32>] [-rtd_location_id <Int32>]
[-image <String>] -assigned_id <Int32> -checkout_to_type <String> -url <String> -apiKey <String>
[-customfields <Hashtable>] [-WhatIf] [-Confirm] [<CommonParameters>]
2017-11-18 19:50:47 +00:00
```
## DESCRIPTION
2017-11-20 09:07:58 +00:00
Long 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
```
2021-06-08 20:23:32 +03:00
New-SnipeitAsset -status_id 1 -model_id 1 -name "Machine1"
2021-05-19 15:51:49 +03:00
Create asset with automatic tag if tag genaration is enabled on snipe-it, other wise without tag
2021-06-05 08:10:45 +03:00
```
2021-05-19 15:51:49 +03:00
2021-05-18 05:57:40 +03:00
### EXAMPLE 2
2017-11-20 09:07:58 +00:00
```
2021-06-08 20:23:32 +03:00
New-SnipeitAsset -status_id 1 -model_id 1 -name "Machine1" -asset_tag "DEV123"
2021-05-19 15:51:49 +03:00
Specifying asset tag when creating asset
2021-06-05 08:10:45 +03:00
```
2021-05-19 15:51:49 +03:00
### EXAMPLE 3
```
2021-06-12 12:30:41 +03:00
New-SnipeitAsset -status_id 1 -model_id 1 -name "Machine1" -customfields = @{ "_snipeit_os_5" = "Windows 10 Pro" }
2021-05-19 15:51:49 +03:00
Using customfields when creating asset.
2021-06-05 08:10:45 +03:00
```
2021-05-19 15:51:49 +03:00
2017-11-18 19:50:47 +00:00
## PARAMETERS
2021-05-23 23:24:44 +03:00
### -apiKey
2021-06-08 20:23:32 +03:00
Users API Key for Snipeit, can be set using Set-SnipeitInfo command
2021-05-23 23:22:23 +03:00
```yaml
2021-05-23 23:24:44 +03:00
Type: String
2021-05-23 23:22:23 +03:00
Parameter Sets: (All)
Aliases:
Required: True
2021-07-29 12:49:16 +03:00
Position: Named
2021-05-23 23:24:44 +03:00
Default value: None
2021-05-23 23:22:23 +03:00
Accept pipeline input: False
Accept wildcard characters: False
```
2021-05-23 23:24:44 +03:00
### -asset_tag
Asset Tag for the Asset, not required when snipe asset_tag autogeneration is on.
2017-11-18 19:50:47 +00:00
```yaml
Type: String
Parameter Sets: (All)
2021-05-23 23:24:44 +03:00
Aliases: tag
2017-11-18 19:50:47 +00:00
2021-05-18 05:57:40 +03:00
Required: False
2021-07-29 12:49:16 +03:00
Position: Named
2017-11-18 19:50:47 +00:00
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
2021-07-29 12:49:16 +03:00
### -assigned_id
Id of target user , location or asset
```yaml
Type: Int32
Parameter Sets: Checkout asset when creating
Aliases:
Required: True
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -checkout_to_type
Checkout asset when creating to one of following types user, location or asset.
```yaml
Type: String
Parameter Sets: Checkout asset when creating
Aliases:
Required: True
Position: Named
Default value: User
Accept pipeline input: False
Accept wildcard characters: False
```
2021-05-23 23:24:44 +03:00
### -company_id
Optional Company id
2017-11-18 19:50:47 +00:00
```yaml
2021-05-23 23:24:44 +03:00
Type: Int32
2017-11-18 19:50:47 +00:00
Parameter Sets: (All)
2021-05-23 23:24:44 +03:00
Aliases:
2017-11-18 19:50:47 +00:00
2021-05-18 05:57:40 +03:00
Required: False
2021-07-29 12:49:16 +03:00
Position: Named
2021-05-23 23:24:44 +03:00
Default value: 0
2017-11-18 19:50:47 +00:00
Accept pipeline input: False
Accept wildcard characters: False
```
2021-05-23 23:24:44 +03:00
### -customfields
Hastable of custom fields and extra fields that need passing through to Snipeit.
Use internal field names from snipeit .You can use Get-CustomField to get internal field names.
2021-05-18 05:57:40 +03:00
```yaml
2021-05-23 23:24:44 +03:00
Type: Hashtable
2021-05-18 05:57:40 +03:00
Parameter Sets: (All)
2021-06-10 19:02:16 +03:00
Aliases: CustomValues
2021-05-18 05:57:40 +03:00
Required: False
2021-07-29 12:49:16 +03:00
Position: Named
2021-07-08 23:59:31 +03:00
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -image
2021-07-14 11:16:55 +03:00
Asset image filename and path
2021-07-08 23:59:31 +03:00
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
2021-07-29 12:49:16 +03:00
Position: Named
2021-05-18 05:57:40 +03:00
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
2021-05-23 23:24:44 +03:00
### -model_id
Required Model ID of the asset, this can be got using Get-Model
2017-11-18 19:50:47 +00:00
```yaml
2018-04-29 08:58:34 +01:00
Type: Int32
2017-11-18 19:50:47 +00:00
Parameter Sets: (All)
2021-05-18 05:57:40 +03:00
Aliases:
2017-11-18 19:50:47 +00:00
2021-05-23 23:24:44 +03:00
Required: True
2021-07-29 12:49:16 +03:00
Position: Named
2018-04-29 08:58:34 +01:00
Default value: 0
2017-11-18 19:50:47 +00:00
Accept pipeline input: False
Accept wildcard characters: False
```
2021-05-23 23:24:44 +03:00
### -name
Optional Name of the Asset
2017-11-18 21:41:35 +00:00
```yaml
2017-11-20 09:07:58 +00:00
Type: String
2017-11-18 21:41:35 +00:00
Parameter Sets: (All)
2021-05-18 05:57:40 +03:00
Aliases:
2017-11-18 21:41:35 +00:00
2021-05-18 05:57:40 +03:00
Required: False
2021-07-29 12:49:16 +03:00
Position: Named
2017-11-18 21:41:35 +00:00
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
2021-05-18 05:57:40 +03:00
### -notes
Optional Notes
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
2021-05-18 05:57:40 +03:00
Required: False
2021-07-29 12:49:16 +03:00
Position: Named
2017-11-18 19:50:47 +00:00
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
2021-05-23 23:24:44 +03:00
### -order_number
Optional Order number
2017-11-18 19:50:47 +00:00
```yaml
2021-05-23 23:24:44 +03:00
Type: String
2017-11-18 19:50:47 +00:00
Parameter Sets: (All)
2021-05-18 05:57:40 +03:00
Aliases:
2017-11-18 19:50:47 +00:00
Required: False
2021-07-29 12:49:16 +03:00
Position: Named
2021-05-23 23:24:44 +03:00
Default value: None
2017-11-18 19:50:47 +00:00
Accept pipeline input: False
Accept wildcard characters: False
```
2021-05-18 05:57:40 +03:00
### -purchase_cost
Optional Purchase cost of the Asset
2017-11-18 19:50:47 +00:00
```yaml
2021-05-18 05:57:40 +03:00
Type: String
2017-11-18 19:50:47 +00:00
Parameter Sets: (All)
2021-05-18 05:57:40 +03:00
Aliases:
2017-11-18 19:50:47 +00:00
2017-11-20 09:07:58 +00:00
Required: False
2021-07-29 12:49:16 +03:00
Position: Named
2021-05-18 05:57:40 +03:00
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -purchase_date
Optional Purchase cost of the Asset
```yaml
2021-05-25 11:17:22 +03:00
Type: DateTime
2021-05-18 05:57:40 +03:00
Parameter Sets: (All)
Aliases:
Required: False
2021-07-29 12:49:16 +03:00
Position: Named
2017-11-18 19:50:47 +00:00
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
2021-05-23 23:24:44 +03:00
### -rtd_location_id
Optional Default location id for the asset
2021-05-18 05:57:40 +03:00
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
2021-07-29 12:49:16 +03:00
Position: Named
2021-05-18 05:57:40 +03:00
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
2021-05-23 23:24:44 +03:00
### -serial
Optional Serial number of the Asset
2021-05-18 05:57:40 +03:00
```yaml
2021-05-23 23:24:44 +03:00
Type: String
2021-05-18 05:57:40 +03:00
Parameter Sets: (All)
Aliases:
2021-05-23 23:22:23 +03:00
Required: False
2021-07-29 12:49:16 +03:00
Position: Named
2021-05-23 23:24:44 +03:00
Default value: None
2021-05-18 05:57:40 +03:00
Accept pipeline input: False
Accept wildcard characters: False
```
2021-05-23 23:24:44 +03:00
### -status_id
Required Status ID of the asset, this can be got using Get-Status
2021-05-18 05:57:40 +03:00
```yaml
2021-05-23 23:24:44 +03:00
Type: Int32
2021-05-18 05:57:40 +03:00
Parameter Sets: (All)
Aliases:
2021-05-23 23:22:23 +03:00
Required: True
2021-07-29 12:49:16 +03:00
Position: Named
2021-05-23 23:24:44 +03:00
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
### -supplier_id
{{ Fill supplier_id Description }}
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
2021-07-29 12:49:16 +03:00
Position: Named
2021-05-23 23:24:44 +03:00
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -url
2021-06-08 20:23:32 +03:00
URL of Snipeit system, can be set using Set-SnipeitInfo command
2021-05-18 05:57:40 +03:00
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
2021-07-29 12:49:16 +03:00
Position: Named
2021-05-18 05:57:40 +03:00
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
2021-05-23 23:24:44 +03:00
### -warranty_months
{{ Fill warranty_months Description }}
2021-05-18 05:57:40 +03:00
```yaml
2021-05-23 23:24:44 +03:00
Type: Int32
2021-05-18 05:57:40 +03:00
Parameter Sets: (All)
Aliases:
Required: False
2021-07-29 12:49:16 +03:00
Position: Named
2021-05-23 23:24:44 +03:00
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
### -Confirm
Prompts you for confirmation before running the cmdlet.
2017-11-18 19:50:47 +00:00
2017-11-20 09:07:58 +00:00
```yaml
Type: SwitchParameter
Parameter Sets: (All)
2021-05-23 23:24:44 +03:00
Aliases: cf
2017-11-18 19:50:47 +00:00
2017-11-20 09:07:58 +00:00
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
2017-11-18 19:50:47 +00:00
2021-05-23 23:24:44 +03:00
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
2021-05-18 05:57:40 +03:00
```yaml
Type: SwitchParameter
Parameter Sets: (All)
2021-05-23 23:24:44 +03:00
Aliases: wi
2021-05-18 05:57:40 +03:00
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
2018-04-29 08:58:34 +01:00
### CommonParameters
2021-05-18 05:57:40 +03:00
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).
2018-04-29 08:58:34 +01:00
2017-11-20 09:07:58 +00:00
## INPUTS
2017-11-18 19:50:47 +00:00
2017-11-20 09:07:58 +00:00
## OUTPUTS
2017-11-18 19:50:47 +00:00
## NOTES
## RELATED LINKS