diff --git a/CHANGELOG.md b/CHANGELOG.md index 7333372..91fc4d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,21 @@ 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.6.x] +# [v.1.7.x] - 2021-06-14 + +## Consumables + +## New features +Added support for consumables + +## New functions +- New-SnipeitConsumable +- Get-SnipeitConsumable +- Set-SnipeitConsumable +- Remove-SnipeitConsumable + + +# [v.1.6.x] - 2021-06-14 ## Remove more things ja set some more diff --git a/SnipeitPS/Public/Get-SnipeitConsumable.ps1 b/SnipeitPS/Public/Get-SnipeitConsumable.ps1 new file mode 100644 index 0000000..ae8b2aa --- /dev/null +++ b/SnipeitPS/Public/Get-SnipeitConsumable.ps1 @@ -0,0 +1,156 @@ +<# +.SYNOPSIS +Gets a list of Snipe-it consumables + +.PARAMETER search +A text string to search the consumables + +.PARAMETER id +A id of specific consumable + +.PARAMETER company_id +Id number of company + +.PARAMETER category_id +Id number of category + +.PARAMETER manufacturer_id +Id number of manufacturer + +.PARAMETER sort +Sort results by column + +.PARAMETER order +Specify the order (asc or desc) you wish to order by on your sort column + +.PARAMETER expand +Whether to include detailed information on categories, etc (true) or just the text name (false) + +.PARAMETER limit +Specify the number of results you wish to return. Defaults to 50. Defines batch size for -all + +.PARAMETER offset +Offset to use + +.PARAMETER all +A return all results + +.PARAMETER url +URL of Snipeit system,can be set using Set-SnipeitInfo command + +.PARAMETER apiKey +Users API Key for Snipeit, can be set using Set-SnipeitInfo command + +.EXAMPLE +Get-SnipeitConsumable -all +Returns all consumables + +.EXAMPLE +Get-SnipeitConsumable -search paper +Returns search results containeing string display + +.EXAMPLE +Get-Snipeitconsumable -id +Returns specific consumable + +#> +function Get-SnipeitConsumable() { + [CmdletBinding(DefaultParameterSetName = 'Search')] + Param( + [parameter(ParameterSetName='Search')] + [string]$search, + + [parameter(ParameterSetName='Get with ID')] + [int[]]$id, + + [parameter(ParameterSetName='Search')] + [int]$category_id, + + [parameter(ParameterSetName='Search')] + [int]$company_id, + + [parameter(ParameterSetName='Search')] + [int]$manufacturer_id, + + [parameter(ParameterSetName='Search')] + [int]$location_id, + + [parameter(ParameterSetName='Search')] + [ValidateSet("asc", "desc")] + [string]$order = "desc", + + [parameter(ParameterSetName='Search')] + [ValidateSet('id', 'name', 'min_amt', 'order_number', 'serial', 'purchase_date', 'purchase_cost', 'company', 'category', 'qty', 'location', 'image', 'created_at')] + [string]$sort = "created_at", + + + [Parameter(ParameterSetName='Search')] + [switch]$expand, + + [parameter(ParameterSetName='Search')] + [int]$limit = 50, + + [parameter(ParameterSetName='Search')] + [int]$offset, + + [parameter(ParameterSetName='Search')] + [switch]$all = $false, + + [parameter(mandatory = $true)] + [string]$url, + + [parameter(mandatory = $true)] + [string]$apiKey + ) + begin { + + $SearchParameter = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters + } + + process { + switch ($PSCmdlet.ParameterSetName) { + 'Search' { + $Parameters = @{ + Uri = "$url/api/v1/consumables" + Method = 'Get' + Token = $apiKey + GetParameters = $SearchParameter + } + + if ($all) { + $offstart = $(if($offset){$offset} Else {0}) + $callargs = $SearchParameter + $callargs.Remove('all') + + while ($true) { + $callargs['offset'] = $offstart + $callargs['limit'] = $limit + $res=Get-Snipeitconsumable @callargs + $res + if ($res.count -ne $limit) { + break + } + $offstart = $offstart + $limit + } + } else { + $result = Invoke-SnipeitMethod @Parameters + $result + } + } + + 'Get with ID' { + foreach($consumable_id in $id) { + $Parameters = @{ + Uri = "$url/api/v1/consumables/$consumable_id" + Method = 'Get' + Token = $apiKey + GetParameters = $SearchParameter + } + $result = Invoke-SnipeitMethod @Parameters + $result + } + } + } + } +} + diff --git a/SnipeitPS/Public/New-SnipeitConsumable.ps1 b/SnipeitPS/Public/New-SnipeitConsumable.ps1 new file mode 100644 index 0000000..d89b691 --- /dev/null +++ b/SnipeitPS/Public/New-SnipeitConsumable.ps1 @@ -0,0 +1,139 @@ +<# +.SYNOPSIS +Add a new Consumable to Snipe-it asset system + +.DESCRIPTION +Long description + +.PARAMETER name +Required Name of the Consumable + +.PARAMETER qty +Required Quantity of comsumable + +.PARAMETER category_id +Required Category ID of the Consumable, this can be got using Get-SnipeitCategory + +.PARAMETER min_amt +Optional minimum quantity of comsumable + +.PARAMETER company_id +Optional Company id + +.PARAMETER order_number +Optional Order number + +.PARAMETER manufacturer_id +Manufaturer id number of the consumable + +.PARAMETER location_id +Location id number of the consumable + +.PARAMETER requestable +Is consumable requestable? + +.PARAMETER purchase_date +Optional Purchase cost of the consumable + +.PARAMETER purchase_cost +Optional Purchase cost of the consumable + +.PARAMETER model_number +Model number of the consumable in months + +.PARAMETER item_no +Item number for the consumable + +.PARAMETER url +URL of Snipeit system, can be set using Set-SnipeitInfo command + +.PARAMETER apiKey +Users API Key for Snipeit, can be set using Set-SnipeitInfo command + + +.EXAMPLE +New-Snipeitconsumable -name "Ink pack" -qty 20 -category_id 3 -min_amt 5 +Create consumable with stock count 20 , alert when stock is 5 or lower + +#> + +function New-SnipeitConsumable() +{ + [CmdletBinding( + SupportsShouldProcess = $true, + ConfirmImpact = "Low" + )] + + Param( + [parameter(mandatory = $true)] + [string]$name, + + [parameter(mandatory = $true)] + [int]$qty, + + [parameter(mandatory = $true)] + [int]$category_id, + + [parameter(mandatory = $false)] + [int]$min_amt, + + [parameter(mandatory = $false)] + [int]$company_id, + + [parameter(mandatory = $false)] + [string]$order_number, + + [parameter(mandatory = $false)] + [int]$manufacturer_id, + + [parameter(mandatory = $false)] + [int]$location_id, + + [parameter(mandatory = $false)] + [bool]$requestable, + + [parameter(mandatory = $false)] + [datetime]$purchase_date, + + [parameter(mandatory = $false)] + [string]$purchase_cost, + + [parameter(mandatory = $false)] + [string]$model_number, + + [parameter(mandatory = $false)] + [string]$item_no, + + [parameter(mandatory = $true)] + [string]$url, + + [parameter(mandatory = $true)] + [string]$apiKey + + ) + begin { + $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters + + if ($values['purchase_date']) { + $Values['purchase_date'] = $Values['purchase_date'].ToString("yyyy-MM-dd") + } + + $Body = $Values | ConvertTo-Json; + } + + process { + $Parameters = @{ + Uri = "$url/api/v1/consumables" + Method = 'Post' + Body = $Body + Token = $apiKey + } + + If ($PSCmdlet.ShouldProcess("ShouldProcess?")) + { + $result = Invoke-SnipeitMethod @Parameters + } + + $result + } +} diff --git a/SnipeitPS/Public/Remove-SnipeitConsumable.ps1 b/SnipeitPS/Public/Remove-SnipeitConsumable.ps1 new file mode 100644 index 0000000..0bda660 --- /dev/null +++ b/SnipeitPS/Public/Remove-SnipeitConsumable.ps1 @@ -0,0 +1,56 @@ +<# + .SYNOPSIS + Removes consumable from Snipe-it asset system + .DESCRIPTION + Removes consumable or multiple consumables from Snipe-it asset system + .PARAMETER ID + Unique ID For consumable to be removed + + .PARAMETER url + URL of Snipeit system, can be set using Set-SnipeitInfo command + + .PARAMETER apiKey + User's API Key for Snipeit, can be set using Set-SnipeitInfo command + + .EXAMPLE + Remove-SnipeitConsumable -ID 44 -Verbose + + .EXAMPLE + Get-SnipeitConsumable -search "paper" | Remove-Snipeitconsumable +#> + +function Remove-SnipeitConsumable () +{ + [CmdletBinding( + SupportsShouldProcess = $true, + ConfirmImpact = "Low" + )] + + Param( + [parameter(mandatory = $true,ValueFromPipelineByPropertyName)] + [int[]]$id, + [parameter(mandatory = $true)] + [string]$URL, + [parameter(mandatory = $true)] + [string]$APIKey + + ) + begin { + } + process { + foreach($consumable_id in $id){ + $Parameters = @{ + Uri = "$url/api/v1/consumables/$consumable_id" + Method = 'Delete' + Body = '{}' + Token = $apiKey + } + + If ($PSCmdlet.ShouldProcess("ShouldProcess?")) + { + $result = Invoke-SnipeitMethod @Parameters + } + $result + } + } +} diff --git a/SnipeitPS/Public/Set-SnipeitConsumable.ps1 b/SnipeitPS/Public/Set-SnipeitConsumable.ps1 new file mode 100644 index 0000000..7ea74dc --- /dev/null +++ b/SnipeitPS/Public/Set-SnipeitConsumable.ps1 @@ -0,0 +1,147 @@ +<# +.SYNOPSIS +Add a new Consumable to Snipe-it asset system + +.DESCRIPTION +Long description + +.PARAMETER id +Optional id number of the Consumable + +.PARAMETER name +Optional Name of the Consumable + +.PARAMETER qty +Optional Quantity of comsumable + +.PARAMETER category_id +Required Category ID of the Consumable, this can be got using Get-SnipeitCategory + +.PARAMETER min_amt +Optional minimum quantity of comsumable + +.PARAMETER company_id +Optional Company id + +.PARAMETER order_number +Optional Order number + +.PARAMETER manufacturer_id +Manufaturer id number of the consumable + +.PARAMETER location_id +Location id number of the consumable + +.PARAMETER requestable +Is consumable requestable? + +.PARAMETER purchase_date +Optional Purchase cost of the consumable + +.PARAMETER purchase_cost +Optional Purchase cost of the consumable + +.PARAMETER model_number +Model number of the consumable in months + +.PARAMETER item_no +Item number for the consumable + +.PARAMETER url +URL of Snipeit system, can be set using Set-SnipeitInfo command + +.PARAMETER apiKey +Users API Key for Snipeit, can be set using Set-SnipeitInfo command + + +.EXAMPLE +New-Snipeitconsumable -name "Ink pack" -qty 20 -category_id 3 -min_amt 5 +Create consumable with stock count 20 , alert when stock is 5 or lower + +#> + +function Set-SnipeitConsumable() +{ + [CmdletBinding( + SupportsShouldProcess = $true, + ConfirmImpact = "Low" + )] + + Param( + [parameter(mandatory = $true)] + [int[]]$id, + + [parameter(mandatory = $false)] + [string]$name, + + [parameter(mandatory = $false)] + [int]$qty, + + [parameter(mandatory = $false)] + [int]$category_id, + + [parameter(mandatory = $false)] + [int]$min_amt, + + [parameter(mandatory = $false)] + [int]$company_id, + + [parameter(mandatory = $false)] + [string]$order_number, + + [parameter(mandatory = $false)] + [int]$manufacturer_id, + + [parameter(mandatory = $false)] + [int]$location_id, + + [parameter(mandatory = $false)] + [bool]$requestable, + + [parameter(mandatory = $false)] + [datetime]$purchase_date, + + [parameter(mandatory = $false)] + [string]$purchase_cost, + + [parameter(mandatory = $false)] + [string]$model_number, + + [parameter(mandatory = $false)] + [string]$item_no, + + [parameter(mandatory = $true)] + [string]$url, + + [parameter(mandatory = $true)] + [string]$apiKey + + ) + begin { + $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters + + if ($Values['purchase_date']) { + $Values['purchase_date'] = $Values['purchase_date'].ToString("yyyy-MM-dd") + } + + $Body = $Values | ConvertTo-Json; + } + + process { + foreach($consumable_id in $id ){ + $Parameters = @{ + Uri = "$url/api/v1/consumables/$consumable_id" + Method = 'Put' + Body = $Body + Token = $apiKey + } + + If ($PSCmdlet.ShouldProcess("ShouldProcess?")) + { + $result = Invoke-SnipeitMethod @Parameters + } + + $result + } + } +} diff --git a/SnipeitPS/SnipeitPS.psd1 b/SnipeitPS/SnipeitPS.psd1 index a4828f5..9b5b712 100644 --- a/SnipeitPS/SnipeitPS.psd1 +++ b/SnipeitPS/SnipeitPS.psd1 @@ -12,7 +12,7 @@ RootModule = 'SnipeitPS' # Version number of this module. -ModuleVersion = '1.6' +ModuleVersion = '1.7' # Supported PSEditions # CompatiblePSEditions = @() @@ -78,6 +78,7 @@ FunctionsToExport = @( 'Get-SnipeitCategory', 'Get-SnipeitCompany', 'Get-SnipeitComponent', + 'Get-SnipeitConsumable', 'Get-SnipeitCustomField', 'Get-SnipeitDepartment', 'Get-SnipeitFieldset', @@ -94,7 +95,9 @@ FunctionsToExport = @( 'New-SnipeitAssetMaintenance', 'New-SnipeItAudit', 'New-SnipeitCategory', + 'New-SnipeitCompany', 'New-SnipeitComponent', + 'New-SnipeitConsumable', 'New-SnipeitCustomField', 'New-SnipeitDepartment', 'New-SnipeitLicense', @@ -108,6 +111,7 @@ FunctionsToExport = @( 'Remove-SnipeitCategory', 'Remove-SnipeitCompany', 'Remove-SnipeitComponent', + 'Remove-SnipeitConsumable', 'Remove-SnipeitCustomField', 'Remove-SnipeitDepartment', 'Remove-SnipeitLicense', @@ -124,6 +128,7 @@ FunctionsToExport = @( 'Set-SnipeitCategory' 'Set-SnipeitCompany' 'Set-SnipeitComponent', + 'Set-SnipeitConsumable', 'Set-SnipeitCustomField', 'Set-SnipeitDepartment', 'Set-SnipeitInfo', diff --git a/appveyor.yml b/appveyor.yml index c5a6038..228ef4f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,7 +14,7 @@ environment: PSGalleryAPIKey: secure: UdM6qhf5B0G8liHhUrwWERCZr44iSqmg4jUq0lwlTjZs4KyeoiwnBzdej0phqIAm -version: 1.6.{build} +version: 1.7.{build} # Don't rebuild when I tag a release on GitHub skip_tags: true diff --git a/docs/Get-SnipeitConsumable.md b/docs/Get-SnipeitConsumable.md new file mode 100644 index 0000000..5286b59 --- /dev/null +++ b/docs/Get-SnipeitConsumable.md @@ -0,0 +1,273 @@ +--- +external help file: SnipeitPS-help.xml +Module Name: SnipeitPS +online version: +schema: 2.0.0 +--- + +# Get-SnipeitConsumable + +## SYNOPSIS +Gets a list of Snipe-it consumables + +## SYNTAX + +### Search (Default) +``` +Get-SnipeitConsumable [-search ] [-category_id ] [-company_id ] + [-manufacturer_id ] [-location_id ] [-order ] [-sort ] [-expand] + [-limit ] [-offset ] [-all] -url -apiKey [] +``` + +### Get with ID +``` +Get-SnipeitConsumable [-id ] -url -apiKey [] +``` + +## DESCRIPTION +{{ Fill in the Description }} + +## EXAMPLES + +### EXAMPLE 1 +``` +Get-SnipeitConsumable -all +Returns all consumables +``` + +### EXAMPLE 2 +``` +Get-SnipeitConsumable -search paper +Returns search results containeing string display +``` + +### EXAMPLE 3 +``` +Get-Snipeitconsumable -id +Returns specific consumable +``` + +## PARAMETERS + +### -all +A return all results + +```yaml +Type: SwitchParameter +Parameter Sets: Search +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -apiKey +Users API Key for Snipeit, can be set using Set-SnipeitInfo command + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -category_id +Id number of category + +```yaml +Type: Int32 +Parameter Sets: Search +Aliases: + +Required: False +Position: Named +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -company_id +Id number of company + +```yaml +Type: Int32 +Parameter Sets: Search +Aliases: + +Required: False +Position: Named +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -expand +Whether to include detailed information on categories, etc (true) or just the text name (false) + +```yaml +Type: SwitchParameter +Parameter Sets: Search +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -id +A id of specific consumable + +```yaml +Type: Int32[] +Parameter Sets: Get with ID +Aliases: + +Required: False +Position: Named +Default value: None +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 + +```yaml +Type: Int32 +Parameter Sets: Search +Aliases: + +Required: False +Position: Named +Default value: 50 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -location_id +{{ Fill location_id Description }} + +```yaml +Type: Int32 +Parameter Sets: Search +Aliases: + +Required: False +Position: Named +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -manufacturer_id +Id number of manufacturer + +```yaml +Type: Int32 +Parameter Sets: Search +Aliases: + +Required: False +Position: Named +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -offset +Offset to use + +```yaml +Type: Int32 +Parameter Sets: Search +Aliases: + +Required: False +Position: Named +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -order +Specify the order (asc or desc) you wish to order by on your sort column + +```yaml +Type: String +Parameter Sets: Search +Aliases: + +Required: False +Position: Named +Default value: Desc +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -search +A text string to search the consumables + +```yaml +Type: String +Parameter Sets: Search +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -sort +Sort results by column + +```yaml +Type: String +Parameter Sets: Search +Aliases: + +Required: False +Position: Named +Default value: Created_at +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -url +URL of Snipeit system,can be set using Set-SnipeitInfo command + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +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). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS diff --git a/docs/New-SnipeitCompany.md b/docs/New-SnipeitCompany.md new file mode 100644 index 0000000..3d7a389 --- /dev/null +++ b/docs/New-SnipeitCompany.md @@ -0,0 +1,117 @@ +--- +external help file: SnipeitPS-help.xml +Module Name: SnipeitPS +online version: +schema: 2.0.0 +--- + +# New-SnipeitCompany + +## SYNOPSIS +Creates a new Company + +## SYNTAX + +``` +New-SnipeitCompany [-name] [-url] [-apiKey] [-WhatIf] [-Confirm] + [] +``` + +## DESCRIPTION +Creates new company on Snipe-It system + +## EXAMPLES + +### EXAMPLE 1 +``` +New-SnipeitCompany -name "Acme Company" +``` + +## PARAMETERS + +### -apiKey +User's API Key for Snipeit, can be set using Set-SnipeitInfo command + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -name +Comapany name + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -url +URL of Snipeit system, can be set using Set-SnipeitInfo command + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +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). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS diff --git a/docs/New-SnipeitConsumable.md b/docs/New-SnipeitConsumable.md new file mode 100644 index 0000000..c030a82 --- /dev/null +++ b/docs/New-SnipeitConsumable.md @@ -0,0 +1,301 @@ +--- +external help file: SnipeitPS-help.xml +Module Name: SnipeitPS +online version: +schema: 2.0.0 +--- + +# New-SnipeitConsumable + +## SYNOPSIS +Add a new Consumable to Snipe-it asset system + +## SYNTAX + +``` +New-SnipeitConsumable [-name] [-qty] [-category_id] [[-min_amt] ] + [[-company_id] ] [[-order_number] ] [[-manufacturer_id] ] [[-location_id] ] + [[-requestable] ] [[-purchase_date] ] [[-purchase_cost] ] + [[-model_number] ] [[-item_no] ] [-url] [-apiKey] [-WhatIf] [-Confirm] + [] +``` + +## DESCRIPTION +Long description + +## EXAMPLES + +### EXAMPLE 1 +``` +New-Snipeitconsumable -name "Ink pack" -qty 20 -category_id 3 -min_amt 5 +Create consumable with stock count 20 , alert when stock is 5 or lower +``` + +## PARAMETERS + +### -apiKey +Users API Key for Snipeit, can be set using Set-SnipeitInfo command + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 15 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -category_id +Required Category ID of the Consumable, this can be got using Get-SnipeitCategory + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: True +Position: 3 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -company_id +Optional Company id + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 5 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -item_no +Item number for the consumable + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 13 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -location_id +Location id number of the consumable + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 8 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -manufacturer_id +Manufaturer id number of the consumable + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 7 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -min_amt +Optional minimum quantity of comsumable + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -model_number +Model number of the consumable in months + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 12 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -name +Required Name of the Consumable + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -order_number +Optional Order number + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 6 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -purchase_cost +Optional Purchase cost of the consumable + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 11 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -purchase_date +Optional Purchase cost of the consumable + +```yaml +Type: DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: 10 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -qty +Required Quantity of comsumable + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -requestable +Is consumable requestable? + +```yaml +Type: Boolean +Parameter Sets: (All) +Aliases: + +Required: False +Position: 9 +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -url +URL of Snipeit system, can be set using Set-SnipeitInfo command + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 14 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +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). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS diff --git a/docs/Remove-SnipeitConsumable.md b/docs/Remove-SnipeitConsumable.md new file mode 100644 index 0000000..82a0e2d --- /dev/null +++ b/docs/Remove-SnipeitConsumable.md @@ -0,0 +1,122 @@ +--- +external help file: SnipeitPS-help.xml +Module Name: SnipeitPS +online version: +schema: 2.0.0 +--- + +# Remove-SnipeitConsumable + +## SYNOPSIS +Removes consumable from Snipe-it asset system + +## SYNTAX + +``` +Remove-SnipeitConsumable [-id] [-URL] [-APIKey] [-WhatIf] [-Confirm] + [] +``` + +## DESCRIPTION +Removes consumable or multiple consumables from Snipe-it asset system + +## EXAMPLES + +### EXAMPLE 1 +``` +Remove-SnipeitConsumable -ID 44 -Verbose +``` + +### EXAMPLE 2 +``` +Get-SnipeitConsumable -search "paper" | Remove-Snipeitconsumable +``` + +## PARAMETERS + +### -APIKey +User's API Key for Snipeit, can be set using Set-SnipeitInfo command + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -id +Unique ID For consumable to be removed + +```yaml +Type: Int32[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -URL +URL of Snipeit system, can be set using Set-SnipeitInfo command + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +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). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS diff --git a/docs/Set-SnipeitConsumable.md b/docs/Set-SnipeitConsumable.md new file mode 100644 index 0000000..cded8d2 --- /dev/null +++ b/docs/Set-SnipeitConsumable.md @@ -0,0 +1,316 @@ +--- +external help file: SnipeitPS-help.xml +Module Name: SnipeitPS +online version: +schema: 2.0.0 +--- + +# Set-SnipeitConsumable + +## SYNOPSIS +Add a new Consumable to Snipe-it asset system + +## SYNTAX + +``` +Set-SnipeitConsumable [-id] [[-name] ] [[-qty] ] [[-category_id] ] + [[-min_amt] ] [[-company_id] ] [[-order_number] ] [[-manufacturer_id] ] + [[-location_id] ] [[-requestable] ] [[-purchase_date] ] [[-purchase_cost] ] + [[-model_number] ] [[-item_no] ] [-url] [-apiKey] [-WhatIf] [-Confirm] + [] +``` + +## DESCRIPTION +Long description + +## EXAMPLES + +### EXAMPLE 1 +``` +New-Snipeitconsumable -name "Ink pack" -qty 20 -category_id 3 -min_amt 5 +Create consumable with stock count 20 , alert when stock is 5 or lower +``` + +## PARAMETERS + +### -apiKey +Users API Key for Snipeit, can be set using Set-SnipeitInfo command + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 16 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -category_id +Required Category ID of the Consumable, this can be got using Get-SnipeitCategory + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -company_id +Optional Company id + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 6 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -id +Optional id number of the Consumable + +```yaml +Type: Int32[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -item_no +Item number for the consumable + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 14 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -location_id +Location id number of the consumable + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 9 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -manufacturer_id +Manufaturer id number of the consumable + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 8 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -min_amt +Optional minimum quantity of comsumable + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 5 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -model_number +Model number of the consumable in months + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 13 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -name +Optional Name of the Consumable + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -order_number +Optional Order number + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 7 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -purchase_cost +Optional Purchase cost of the consumable + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 12 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -purchase_date +Optional Purchase cost of the consumable + +```yaml +Type: DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: 11 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -qty +Optional Quantity of comsumable + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -requestable +Is consumable requestable? + +```yaml +Type: Boolean +Parameter Sets: (All) +Aliases: + +Required: False +Position: 10 +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -url +URL of Snipeit system, can be set using Set-SnipeitInfo command + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 15 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +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). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS diff --git a/docs/SnipeitPS.md b/docs/SnipeitPS.md index c9d02b2..aba8a60 100644 --- a/docs/SnipeitPS.md +++ b/docs/SnipeitPS.md @@ -35,6 +35,9 @@ Gets a list of Snipe-it Companies ### [Get-SnipeitComponent](Get-SnipeitComponent.md) Gets a list of Snipe-it Components +### [Get-SnipeitConsumable](Get-SnipeitConsumable.md) +Gets a list of Snipe-it consumables + ### [Get-SnipeitCustomField](Get-SnipeitCustomField.md) Returns specific Snipe-IT custom field or a list of all custom field @@ -74,9 +77,15 @@ Add a new Audit to Snipe-it asset system ### [New-SnipeitCategory](New-SnipeitCategory.md) Create a new Snipe-IT Category +### [New-SnipeitCompany](New-SnipeitCompany.md) +Creates a new Company + ### [New-SnipeitComponent](New-SnipeitComponent.md) Create a new component +### [New-SnipeitConsumable](New-SnipeitConsumable.md) +Add a new Consumable to Snipe-it asset system + ### [New-SnipeitCustomField](New-SnipeitCustomField.md) Add a new Custom Field to Snipe-it asset system @@ -116,6 +125,9 @@ Removes Company from Snipe-it asset system ### [Remove-SnipeitComponent](Remove-SnipeitComponent.md) Removes component from Snipe-it asset system +### [Remove-SnipeitConsumable](Remove-SnipeitConsumable.md) +Removes consumable from Snipe-it asset system + ### [Remove-SnipeitCustomField](Remove-SnipeitCustomField.md) Removes custom field from Snipe-it asset system @@ -164,6 +176,9 @@ Updates company name ### [Set-SnipeitComponent](Set-SnipeitComponent.md) Updates component +### [Set-SnipeitConsumable](Set-SnipeitConsumable.md) +Add a new Consumable to Snipe-it asset system + ### [Set-SnipeitCustomField](Set-SnipeitCustomField.md) Add a new Custom Field to Snipe-it asset system