SnipeitPS/docs/New-SnipeItAsset.md

333 lines
5.8 KiB
Markdown
Raw Normal View History

---
2017-11-18 19:50:47 +00: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
---
# 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
```
New-SnipeItAsset [-status_id] <Int32> [-model_id] <Int32> [[-name] <String>] [[-asset_tag] <String>]
2021-05-18 05:57:40 +03:00
[[-serial] <String>] [[-company_id] <Int32>] [[-order_number] <String>] [[-notes] <String>]
[[-warranty_months] <Int32>] [[-purchase_cost] <String>] [[-purchase_date] <String>] [[-supplier_id] <Int32>]
[[-rtd_location_id] <Int32>] [-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-05-23 23:22:23 +03:00
New-SnipeItAsset -status_id 1 -model_id 1 -name "Machine1"
2017-11-18 19:50:47 +00:00
```
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-05-18 05:57:40 +03:00
### EXAMPLE 2
2017-11-20 09:07:58 +00:00
```
2021-05-23 23:22:23 +03:00
New-SnipeItAsset -status_id 1 -model_id 1 -name "Machine1" -asset_tag "DEV123"
2017-11-20 09:07:58 +00:00
```
2017-11-18 19:50:47 +00:00
2021-05-19 15:51:49 +03:00
Specifying asset tag when creating asset
### EXAMPLE 3
```
2021-05-23 23:22:23 +03:00
New-SnipeItAsset -status_id 1 -model_id 1 -name "Machine1" -CustomValues = @{ "_snipeit_os_5" = "Windows 10 Pro" }
2021-05-19 15:51:49 +03:00
```
Using customfields when creating asset.
2017-11-18 19:50:47 +00:00
## PARAMETERS
2021-05-23 23:24:44 +03:00
### -apiKey
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-05-23 23:24:44 +03:00
Position: 15
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-05-23 23:24:44 +03:00
Position: 4
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
### -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-05-23 23:24:44 +03:00
Position: 6
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)
Aliases:
Required: False
2021-05-23 23:24:44 +03:00
Position: 16
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
Position: 2
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-05-23 23:24:44 +03:00
Position: 3
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
Position: 8
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-05-23 23:24:44 +03:00
Position: 7
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-05-18 05:57:40 +03:00
Position: 10
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -purchase_date
Optional Purchase cost of the Asset
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 11
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-05-23 23:24:44 +03:00
Position: 13
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-05-23 23:24:44 +03:00
Position: 5
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-05-23 23:24:44 +03:00
Position: 1
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
Position: 12
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -url
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-05-23 23:24:44 +03:00
Position: 14
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-05-23 23:24:44 +03:00
Position: 9
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