diff --git a/CHANGELOG.md b/CHANGELOG.md index b27a3c4..e2abdaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,27 @@ 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.9.x] - 2021-07-14 + +## Image uploads + +## New features +Support for image upload and removes. Just specify filename for -image para- +meter when creating or updating item on snipe. +Remove image use -image_delete parameter. + +*Snipe It version greater than 5.1.8 is needed to support image parameters.* + +Most of set-commands have new -RequestType parameter that defaults to Patch. +If needed request method can be changed from default. + +## New Functions +Following new commands have been added to SnipeitPS: +- New-Supplier +- Set-Supplier +- Remove-Supplier +- Set-Manufacturer + # [v.1.8.x] - 2021-06-17 diff --git a/SnipeitPS/Private/Get-ParameterValue.ps1 b/SnipeitPS/Private/Get-ParameterValue.ps1 index afb4039..e2d702b 100644 --- a/SnipeitPS/Private/Get-ParameterValue.ps1 +++ b/SnipeitPS/Private/Get-ParameterValue.ps1 @@ -57,5 +57,13 @@ function Get-ParameterValue { } finally {} } + + #Convert switch parameters to booleans so it converts nicely to json + foreach ( $key in @($ParameterValues.Keys)) { + if ($true -eq $ParameterValues[$key].IsPresent){ + $ParameterValues[$key]=$true; + } + } + return $ParameterValues } diff --git a/SnipeitPS/Private/Invoke-SnipeitMethod.ps1 b/SnipeitPS/Private/Invoke-SnipeitMethod.ps1 index 2e3779d..4f8f26d 100644 --- a/SnipeitPS/Private/Invoke-SnipeitMethod.ps1 +++ b/SnipeitPS/Private/Invoke-SnipeitMethod.ps1 @@ -17,7 +17,7 @@ # Body of the request [ValidateNotNullOrEmpty()] - [string]$Body, + [Hashtable]$Body, [string] $Token, @@ -34,6 +34,8 @@ Throw $exception } + #To support images "image" property have be handled before this + $_headers = @{ "Authorization" = "Bearer $($token)" 'Content-Type' = 'application/json; charset=utf-8' @@ -59,17 +61,37 @@ ErrorAction = 'SilentlyContinue' } - if ($Body) {$splatParameters["Body"] = [System.Text.Encoding]::UTF8.GetBytes($Body)} + # Place holder for intended image manipulation + # if and when snipe it API gets support for images + if($null -ne $body -and $Body.Keys -contains 'image' ){ + if($PSVersionTable.PSVersion -ge '7.0'){ + $Body['image'] = get-item $body['image'] + # As multipart/form-data is always POST we need add + # requested method for laravel named as '_method' + $Body['_method'] = $Method + $splatParameters["Method"] = 'POST' + $splatParameters["Form"] = $Body + } else { + # use base64 encoded images for powershell version < 7 + Add-Type -AssemblyName "System.Web" + $mimetype = [System.Web.MimeMapping]::GetMimeMapping($body['image']) + $Body['image'] = 'data:@'+$mimetype+';base64,'+[Convert]::ToBase64String([IO.File]::ReadAllBytes($Body['image'])) + } + } + + if ($Body -and $splatParameters.Keys -notcontains 'Form') { + $splatParameters["Body"] = $Body | Convertto-Json + } $script:PSDefaultParameterValues = $global:PSDefaultParameterValues - Write-Debug $Body + Write-Debug "$($Body | ConvertTo-Json)" # Invoke the API try { Write-Verbose "[$($MyInvocation.MyCommand.Name)] Invoking method $Method to URI $URi" Write-Debug "[$($MyInvocation.MyCommand.Name)] Invoke-WebRequest with: $($splatParameters | Out-String)" - $webResponse = Invoke-WebRequest @splatParameters + $webResponse = Invoke-RestMethod @splatParameters } catch { Write-Verbose "[$($MyInvocation.MyCommand.Name)] Failed to get an answer from the server" @@ -81,30 +103,43 @@ if ($webResponse) { Write-Verbose "[$($MyInvocation.MyCommand.Name)] Status code: $($webResponse.StatusCode)" - if ($webResponse.Content) { - Write-Verbose $webResponse.Content + if ($webResponse) { + Write-Verbose $webResponse # API returned a Content: lets work wit it try{ - $response = ConvertFrom-Json -InputObject $webResponse.Content - if ($response.status -eq "error") { + if ($webResponse.status -eq "error") { Write-Verbose "[$($MyInvocation.MyCommand.Name)] An error response was received from; resolving" # This could be handled nicely in an function such as: # ResolveError $response -WriteError - Write-Error $($response.messages | Out-String) + Write-Error $($webResponse.messages | Out-String) } else { - $result = $response - if (($response) -and ($response | Get-Member -Name payload)) - { - $result = $response.payload + #update operations return payload + if ($webResponse.payload){ + $result = $webResponse.payload } - elseif (($response) -and ($response | Get-Member -Name rows)) { - $result = $response.rows + #Search operations return rows + elseif ($webResponse.rows) { + $result = $webResponse.rows + } + #Remove operations returns status and message + elseif ($webResponse.status -eq 'success'){ + $result = $webResponse.payload + } + #get operations with id returns just one object + else { + $result = $webResponse } + Write-Verbose "Status: $($webResponse.status)" + Write-Verbose "Messages: $($webResponse.messages)" + $result + + + } } catch { diff --git a/SnipeitPS/Public/Get-SnipeitAsset.ps1 b/SnipeitPS/Public/Get-SnipeitAsset.ps1 index fe3c8f6..ac38bcb 100644 --- a/SnipeitPS/Public/Get-SnipeitAsset.ps1 +++ b/SnipeitPS/Public/Get-SnipeitAsset.ps1 @@ -221,7 +221,6 @@ function Get-SnipeitAsset() { 'Assets with component id' {$apiurl = "$url/api/v1/components/$component_id/assets"} } - $Parameters = @{ Uri = $apiurl Method = 'Get' diff --git a/SnipeitPS/Public/New-SnipeitAccessory.ps1 b/SnipeitPS/Public/New-SnipeitAccessory.ps1 index 6b97a92..fa3616c 100644 --- a/SnipeitPS/Public/New-SnipeitAccessory.ps1 +++ b/SnipeitPS/Public/New-SnipeitAccessory.ps1 @@ -53,6 +53,9 @@ ID number of the location the accessory is assigned to .PARAMETER min_amt Min quantity of the accessory before alert is triggered +.PARAMETER image +Accessory image fileame and path + .PARAMETER url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -103,6 +106,9 @@ function New-SnipeitAccessory() { [ValidateRange(1, [int]::MaxValue)] [int]$location_id, + [ValidateScript({Test-Path $_})] + [string]$image, + [parameter(mandatory = $true)] [string]$url, @@ -118,12 +124,10 @@ function New-SnipeitAccessory() { $values['purchase_date'] = $values['purchase_date'].ToString("yyyy-MM-dd") } - $Body = $Values | ConvertTo-Json; - $Parameters = @{ Uri = "$url/api/v1/accessories" Method = 'POST' - Body = $Body + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/New-SnipeitAsset.ps1 b/SnipeitPS/Public/New-SnipeitAsset.ps1 index 8ca47fb..89c6ca9 100644 --- a/SnipeitPS/Public/New-SnipeitAsset.ps1 +++ b/SnipeitPS/Public/New-SnipeitAsset.ps1 @@ -42,6 +42,9 @@ Optional Purchase cost of the Asset .PARAMETER rtd_location_id Optional Default location id for the asset +.PARAMETER image +Asset image filename and path + .PARAMETER url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -114,6 +117,9 @@ function New-SnipeitAsset() [parameter(mandatory = $false)] [int]$rtd_location_id, + [ValidateScript({Test-Path $_})] + [string]$image, + [parameter(mandatory = $true)] [string]$url, @@ -137,12 +143,10 @@ function New-SnipeitAsset() $Values += $customfields } - $Body = $Values | ConvertTo-Json; - $Parameters = @{ Uri = "$url/api/v1/hardware" Method = 'Post' - Body = $Body + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/New-SnipeitAssetMaintenance.ps1 b/SnipeitPS/Public/New-SnipeitAssetMaintenance.ps1 index 2115539..a62f690 100644 --- a/SnipeitPS/Public/New-SnipeitAssetMaintenance.ps1 +++ b/SnipeitPS/Public/New-SnipeitAssetMaintenance.ps1 @@ -81,20 +81,19 @@ function New-SnipeitAssetMaintenance() { $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters - if ($values['start_date']) { - $values['start_date'] = $values['start_date'].ToString("yyyy-MM-dd") + if ($Values['start_date']) { + $Values['start_date'] = $Values['start_date'].ToString("yyyy-MM-dd") } - if ($values['completion_date']) { - $values['completion_date'] = $values['completion_date'].ToString("yyyy-MM-dd") + if ($Values['completion_date']) { + $Values['completion_date'] = $Values['completion_date'].ToString("yyyy-MM-dd") } - $Body = $Values | ConvertTo-Json; $Parameters = @{ Uri = "$url/api/v1/maintenances" Method = 'Post' - Body = $Body + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/New-SnipeitAudit.ps1 b/SnipeitPS/Public/New-SnipeitAudit.ps1 index b01faab..883491b 100644 --- a/SnipeitPS/Public/New-SnipeitAudit.ps1 +++ b/SnipeitPS/Public/New-SnipeitAudit.ps1 @@ -48,12 +48,10 @@ function New-SnipeitAudit() $Values += @{"asset_tag" = $tag} } - $Body = $Values | ConvertTo-Json; - $Parameters = @{ Uri = "$url/api/v1/hardware/audit" Method = 'Post' - Body = $Body + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/New-SnipeitCategory.ps1 b/SnipeitPS/Public/New-SnipeitCategory.ps1 index 62ca0e9..f9e3741 100644 --- a/SnipeitPS/Public/New-SnipeitCategory.ps1 +++ b/SnipeitPS/Public/New-SnipeitCategory.ps1 @@ -20,6 +20,9 @@ If switch is present, require users to confirm acceptance of assets in this cate .PARAMETER checkin_email If switch is present, send email to user on checkin/checkout +.PARAMETER image +Category image filename and path + .PARAMETER url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -47,12 +50,15 @@ function New-SnipeitCategory() [string]$eula_text, - [switch]$use_default_eula, [switch]$require_acceptance, [switch]$checkin_email, + + [ValidateScript({Test-Path $_})] + [string]$image, + [parameter(mandatory = $true)] [string]$url, @@ -68,8 +74,6 @@ function New-SnipeitCategory() } $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters - - $Body = $Values | ConvertTo-Json; } process { @@ -77,7 +81,7 @@ function New-SnipeitCategory() $Parameters = @{ Uri = "$url/api/v1/categories" Method = 'POST' - Body = $Body + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/New-SnipeitCompany.ps1 b/SnipeitPS/Public/New-SnipeitCompany.ps1 index 5c541a4..2f25c34 100644 --- a/SnipeitPS/Public/New-SnipeitCompany.ps1 +++ b/SnipeitPS/Public/New-SnipeitCompany.ps1 @@ -8,6 +8,9 @@ Creates new company on Snipe-It system .PARAMETER name Comapany name +.PARAMETER image +Company image filename and path + .PARAMETER url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -30,6 +33,9 @@ function New-SnipeitCompany() [parameter(mandatory = $true)] [string]$name, + [ValidateScript({Test-Path $_})] + [string]$image, + [parameter(mandatory = $true)] [string]$url, @@ -41,12 +47,10 @@ function New-SnipeitCompany() $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters - $Body = $Values | ConvertTo-Json; - $Parameters = @{ Uri = "$url/api/v1/companies" Method = 'POST' - Body = $Body + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/New-SnipeitComponent.ps1 b/SnipeitPS/Public/New-SnipeitComponent.ps1 index 7880b76..194b46e 100644 --- a/SnipeitPS/Public/New-SnipeitComponent.ps1 +++ b/SnipeitPS/Public/New-SnipeitComponent.ps1 @@ -26,6 +26,9 @@ Date accessory was purchased .PARAMETER purchase_cost Cost of item being purchased. +.PARAMETER image +Component image filename and path + .PARAMETER url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -65,6 +68,9 @@ function New-SnipeitComponent() { [float]$purchase_cost, + [ValidateScript({Test-Path $_})] + [string]$image, + [parameter(mandatory = $true)] [string]$url, @@ -76,16 +82,14 @@ function New-SnipeitComponent() { $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters - if ($values['purchase_date']) { - $values['purchase_date'] = $values['purchase_date'].ToString("yyyy-MM-dd") + if ($Values['purchase_date']) { + $Values['purchase_date'] = $Values['purchase_date'].ToString("yyyy-MM-dd") } - $Body = $Values | ConvertTo-Json; - $Parameters = @{ Uri = "$url/api/v1/components" Method = 'POST' - Body = $Body + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/New-SnipeitConsumable.ps1 b/SnipeitPS/Public/New-SnipeitConsumable.ps1 index d89b691..df2b594 100644 --- a/SnipeitPS/Public/New-SnipeitConsumable.ps1 +++ b/SnipeitPS/Public/New-SnipeitConsumable.ps1 @@ -44,6 +44,9 @@ Model number of the consumable in months .PARAMETER item_no Item number for the consumable +.PARAMETER image +Consumable Image filename and path + .PARAMETER url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -104,6 +107,9 @@ function New-SnipeitConsumable() [parameter(mandatory = $false)] [string]$item_no, + [ValidateScript({Test-Path $_})] + [string]$image, + [parameter(mandatory = $true)] [string]$url, @@ -114,18 +120,16 @@ function New-SnipeitConsumable() begin { $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters - if ($values['purchase_date']) { + 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 + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/New-SnipeitCustomField.ps1 b/SnipeitPS/Public/New-SnipeitCustomField.ps1 index 454394c..2b1efbe 100644 --- a/SnipeitPS/Public/New-SnipeitCustomField.ps1 +++ b/SnipeitPS/Public/New-SnipeitCustomField.ps1 @@ -83,12 +83,10 @@ function New-SnipeitCustomField() $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters - $Body = $Values | ConvertTo-Json; - $Parameters = @{ Uri = "$url/api/v1/fields" Method = 'post' - Body = $Body + Body = $Values Token = $apiKey } } diff --git a/SnipeitPS/Public/New-SnipeitDepartment.ps1 b/SnipeitPS/Public/New-SnipeitDepartment.ps1 index 73dbedb..185a165 100644 --- a/SnipeitPS/Public/New-SnipeitDepartment.ps1 +++ b/SnipeitPS/Public/New-SnipeitDepartment.ps1 @@ -17,6 +17,9 @@ .PARAMETER manager_id ID number of manager + .PARAMETER image + Department Image filename and path + .PARAMETER url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -46,6 +49,11 @@ function New-SnipeitDepartment() { [string]$notes, + [ValidateScript({Test-Path $_})] + [string]$image, + + [switch]$image_delete=$false, + [parameter(mandatory = $true)] [string]$url, @@ -57,12 +65,10 @@ function New-SnipeitDepartment() { $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters - $Body = $Values | ConvertTo-Json; - $Parameters = @{ Uri = "$url/api/v1/departments" Method = 'POST' - Body = $Body + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/New-SnipeitLicense.ps1 b/SnipeitPS/Public/New-SnipeitLicense.ps1 index baac560..11a49fb 100644 --- a/SnipeitPS/Public/New-SnipeitLicense.ps1 +++ b/SnipeitPS/Public/New-SnipeitLicense.ps1 @@ -128,24 +128,22 @@ function New-SnipeitLicense() { $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters - if ($values['expiration_date']) { - $values['expiration_date'] = $values['expiration_date'].ToString("yyyy-MM-dd") + if ($Values['expiration_date']) { + $Values['expiration_date'] = $Values['expiration_date'].ToString("yyyy-MM-dd") } - if ($values['purchase_date']) { - $values['purchase_date'] = $values['purchase_date'].ToString("yyyy-MM-dd") + if ($Values['purchase_date']) { + $Values['purchase_date'] = $Values['purchase_date'].ToString("yyyy-MM-dd") } - if ($values['termination_date']) { - $values['termination_date'] = $values['termination_date'].ToString("yyyy-MM-dd") + if ($Values['termination_date']) { + $Values['termination_date'] = $Values['termination_date'].ToString("yyyy-MM-dd") } - $Body = $Values | ConvertTo-Json; - $Parameters = @{ Uri = "$url/api/v1/licenses" Method = 'POST' - Body = $Body + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/New-SnipeitLocation.ps1 b/SnipeitPS/Public/New-SnipeitLocation.ps1 index e2751f6..b34eaa3 100644 --- a/SnipeitPS/Public/New-SnipeitLocation.ps1 +++ b/SnipeitPS/Public/New-SnipeitLocation.ps1 @@ -38,6 +38,9 @@ .PARAMETER manager_id The manager ID of the location + .PARAMETER image + Location Image filename and path + .PARAMETER url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -78,6 +81,11 @@ function New-SnipeitLocation() { [string]$ldap_ou, + [ValidateScript({Test-Path $_})] + [string]$image, + + [switch]$image_delete=$false, + [parameter(mandatory = $true)] [string]$url, @@ -89,12 +97,10 @@ function New-SnipeitLocation() { $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters - $Body = $Values | ConvertTo-Json; - $Parameters = @{ Uri = "$url/api/v1/locations" Method = 'post' - Body = $Body + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/New-SnipeitManufacturer.ps1 b/SnipeitPS/Public/New-SnipeitManufacturer.ps1 index f7abf31..67b5604 100644 --- a/SnipeitPS/Public/New-SnipeitManufacturer.ps1 +++ b/SnipeitPS/Public/New-SnipeitManufacturer.ps1 @@ -8,6 +8,12 @@ .PARAMETER Name Name of the Manufacturer + .PARAMETER image + Manufacturer Image filename and path + + .PARAMETER image_delete + Remove current image + .PARAMETER url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -29,6 +35,11 @@ function New-SnipeitManufacturer() [parameter(mandatory = $true)] [string]$Name, + [ValidateScript({Test-Path $_})] + [string]$image, + + [switch]$image_delete=$false, + [parameter(mandatory = $true)] [string]$url, @@ -42,13 +53,10 @@ function New-SnipeitManufacturer() "name" = $Name } - #Convert Values to JSON format - $Body = $Values | ConvertTo-Json; - $Parameters = @{ Uri = "$url/api/v1/manufacturers" Method = 'post' - Body = $Body + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/New-SnipeitModel.ps1 b/SnipeitPS/Public/New-SnipeitModel.ps1 index 5e36b8a..c15616e 100644 --- a/SnipeitPS/Public/New-SnipeitModel.ps1 +++ b/SnipeitPS/Public/New-SnipeitModel.ps1 @@ -20,6 +20,9 @@ .PARAMETER fieldset_id Fieldset ID that the asset uses (Custom fields) + .PARAMETER image + Asset model Image filename and path + .PARAMETER url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -54,6 +57,9 @@ function New-SnipeitModel() [parameter(mandatory = $true)] [int]$fieldset_id, + [ValidateScript({Test-Path $_})] + [string]$image, + [parameter(mandatory = $true)] [string]$url, @@ -73,12 +79,11 @@ function New-SnipeitModel() if ($PSBoundParameters.ContainsKey('model_number')) { $Values.Add("model_number", $model_number) } if ($PSBoundParameters.ContainsKey('eol')) { $Values.Add("eol", $eol) } - $Body = $Values | ConvertTo-Json; $Parameters = @{ Uri = "$url/api/v1/models" Method = 'post' - Body = $Body + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/New-SnipeitSupplier.ps1 b/SnipeitPS/Public/New-SnipeitSupplier.ps1 new file mode 100644 index 0000000..3bd64bf --- /dev/null +++ b/SnipeitPS/Public/New-SnipeitSupplier.ps1 @@ -0,0 +1,117 @@ +<# + .SYNOPSIS + Creates a supplier + + .DESCRIPTION + Creates a new supplier on Snipe-It system + + .PARAMETER name + Department Name + + .PARAMETER address + Address line 1 of supplier + + .PARAMETER address2 + Address line 1 of supplier + + .PARAMETER city + City + + .PARAMETER state + State + + .PARAMETER country + Country + + .PARAMETER zip + Zip code + + .PARAMETER phone + Phone number + + .PARAMETER fax + Fax number + + .PARAMETER email + Email address + + .PARAMETER contact + Contact person + + .PARAMETER notes + Email address + + .PARAMETER image + Image file name and path for item + + .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-SnipeitDepartment -name "Department1" -company_id 1 -localtion_id 1 -manager_id 3 + +#> + +function New-SnipeitSupplier() { + [CmdletBinding( + SupportsShouldProcess = $true, + ConfirmImpact = "Low" + )] + + Param( + [parameter(mandatory = $true)] + [string]$name, + + [string]$address, + + [string]$address2, + + [string]$city, + + [string]$state, + + [string]$country, + + [string]$zip, + + [string]$phone, + + [string]$fax, + + [string]$email, + + [string]$contact, + + [string]$notes, + + [ValidateScript({Test-Path $_})] + [string]$image, + + [parameter(mandatory = $true)] + [string]$url, + + [parameter(mandatory = $true)] + [string]$apiKey + ) + + Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + + $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters + + $Parameters = @{ + Uri = "$url/api/v1/suppilers" + Method = 'POST' + Body = $Values + Token = $apiKey + } + + If ($PSCmdlet.ShouldProcess("ShouldProcess?")) { + $result = Invoke-SnipeitMethod @Parameters + } + + $result +} + diff --git a/SnipeitPS/Public/New-SnipeitUser.ps1 b/SnipeitPS/Public/New-SnipeitUser.ps1 index d3b4030..61cbe36 100644 --- a/SnipeitPS/Public/New-SnipeitUser.ps1 +++ b/SnipeitPS/Public/New-SnipeitUser.ps1 @@ -50,6 +50,9 @@ .PARAMETER ldap_import Mark user as import from ldap + .PARAMETER image + User Image file name and path + .PARAMETER url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -104,6 +107,8 @@ function New-SnipeitUser() { [bool]$ldap_import = $false, + [ValidateScript({Test-Path $_})] + [string]$image, [parameter(mandatory = $true)] [string]$url, @@ -120,12 +125,10 @@ function New-SnipeitUser() { $Values['password_confirmation'] = $password } - $Body = $Values | ConvertTo-Json; - $Parameters = @{ Uri = "$url/api/v1/users" Method = 'post' - Body = $Body + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/Remove-SnipeitAccessory.ps1 b/SnipeitPS/Public/Remove-SnipeitAccessory.ps1 index 387ab01..4189b17 100644 --- a/SnipeitPS/Public/Remove-SnipeitAccessory.ps1 +++ b/SnipeitPS/Public/Remove-SnipeitAccessory.ps1 @@ -41,7 +41,6 @@ function Remove-SnipeitAccessory () $Parameters = @{ Uri = "$url/api/v1/accessories/$accessory_id" Method = 'Delete' - Body = '{}' Token = $apiKey } diff --git a/SnipeitPS/Public/Remove-SnipeitAsset.ps1 b/SnipeitPS/Public/Remove-SnipeitAsset.ps1 index 47811e7..68d9dbb 100644 --- a/SnipeitPS/Public/Remove-SnipeitAsset.ps1 +++ b/SnipeitPS/Public/Remove-SnipeitAsset.ps1 @@ -42,7 +42,6 @@ function Remove-SnipeitAsset () $Parameters = @{ Uri = "$url/api/v1/hardware/$asset_id" Method = 'Delete' - Body = '{}' Token = $apiKey } diff --git a/SnipeitPS/Public/Remove-SnipeitAssetMaintenance.ps1 b/SnipeitPS/Public/Remove-SnipeitAssetMaintenance.ps1 index 10cc017..a1f7b65 100644 --- a/SnipeitPS/Public/Remove-SnipeitAssetMaintenance.ps1 +++ b/SnipeitPS/Public/Remove-SnipeitAssetMaintenance.ps1 @@ -46,7 +46,6 @@ function Remove-SnipeitAssetMaintenance { $Parameters = @{ Uri = "$url/api/v1/maintenances/$maintenance_id" Method = 'Delete' - Body = '{}' Token = $apiKey } diff --git a/SnipeitPS/Public/Remove-SnipeitCategory.ps1 b/SnipeitPS/Public/Remove-SnipeitCategory.ps1 index 873858b..0f86693 100644 --- a/SnipeitPS/Public/Remove-SnipeitCategory.ps1 +++ b/SnipeitPS/Public/Remove-SnipeitCategory.ps1 @@ -41,7 +41,6 @@ function Remove-SnipeitCategory () $Parameters = @{ Uri = "$url/api/v1/categories/$category_id" Method = 'Delete' - Body = '{}' Token = $apiKey } diff --git a/SnipeitPS/Public/Remove-SnipeitCompany.ps1 b/SnipeitPS/Public/Remove-SnipeitCompany.ps1 index d9b4758..9ff94dc 100644 --- a/SnipeitPS/Public/Remove-SnipeitCompany.ps1 +++ b/SnipeitPS/Public/Remove-SnipeitCompany.ps1 @@ -41,7 +41,6 @@ function Remove-SnipeitCompany () $Parameters = @{ Uri = "$url/api/v1/companies/$company_id" Method = 'Delete' - Body = '{}' Token = $apiKey } diff --git a/SnipeitPS/Public/Remove-SnipeitComponent.ps1 b/SnipeitPS/Public/Remove-SnipeitComponent.ps1 index 2dfd012..450dbed 100644 --- a/SnipeitPS/Public/Remove-SnipeitComponent.ps1 +++ b/SnipeitPS/Public/Remove-SnipeitComponent.ps1 @@ -41,7 +41,6 @@ function Remove-SnipeitComponent () $Parameters = @{ Uri = "$url/api/v1/components/$component_id" Method = 'Delete' - Body = '{}' Token = $apiKey } diff --git a/SnipeitPS/Public/Remove-SnipeitConsumable.ps1 b/SnipeitPS/Public/Remove-SnipeitConsumable.ps1 index 0bda660..3e18b3d 100644 --- a/SnipeitPS/Public/Remove-SnipeitConsumable.ps1 +++ b/SnipeitPS/Public/Remove-SnipeitConsumable.ps1 @@ -42,7 +42,6 @@ function Remove-SnipeitConsumable () $Parameters = @{ Uri = "$url/api/v1/consumables/$consumable_id" Method = 'Delete' - Body = '{}' Token = $apiKey } diff --git a/SnipeitPS/Public/Remove-SnipeitCustomField.ps1 b/SnipeitPS/Public/Remove-SnipeitCustomField.ps1 index 291eac4..e258ca2 100644 --- a/SnipeitPS/Public/Remove-SnipeitCustomField.ps1 +++ b/SnipeitPS/Public/Remove-SnipeitCustomField.ps1 @@ -41,7 +41,6 @@ function Remove-SnipeitCustomField () $Parameters = @{ Uri = "$url/api/v1/fields/$field_id" Method = 'Delete' - Body = '{}' Token = $apiKey } diff --git a/SnipeitPS/Public/Remove-SnipeitDepartment.ps1 b/SnipeitPS/Public/Remove-SnipeitDepartment.ps1 index 8bf9daa..d6e95c7 100644 --- a/SnipeitPS/Public/Remove-SnipeitDepartment.ps1 +++ b/SnipeitPS/Public/Remove-SnipeitDepartment.ps1 @@ -41,7 +41,6 @@ function Remove-SnipeitDepartment () $Parameters = @{ Uri = "$url/api/v1/departments/$department_id" Method = 'Delete' - Body = '{}' Token = $apiKey } diff --git a/SnipeitPS/Public/Remove-SnipeitLicense.ps1 b/SnipeitPS/Public/Remove-SnipeitLicense.ps1 index 094435c..ba0dee4 100644 --- a/SnipeitPS/Public/Remove-SnipeitLicense.ps1 +++ b/SnipeitPS/Public/Remove-SnipeitLicense.ps1 @@ -41,7 +41,6 @@ function Remove-SnipeitLicense () $Parameters = @{ Uri = "$url/api/v1/licenses/$license_id" Method = 'Delete' - Body = '{}' Token = $apiKey } diff --git a/SnipeitPS/Public/Remove-SnipeitLocation.ps1 b/SnipeitPS/Public/Remove-SnipeitLocation.ps1 index d0bfa94..15c4567 100644 --- a/SnipeitPS/Public/Remove-SnipeitLocation.ps1 +++ b/SnipeitPS/Public/Remove-SnipeitLocation.ps1 @@ -41,7 +41,6 @@ function Remove-SnipeitLocation () $Parameters = @{ Uri = "$url/api/v1/locations/$asset_id" Method = 'Delete' - Body = '{}' Token = $apiKey } diff --git a/SnipeitPS/Public/Remove-SnipeitManufacturer.ps1 b/SnipeitPS/Public/Remove-SnipeitManufacturer.ps1 index 40a87ca..9605d9b 100644 --- a/SnipeitPS/Public/Remove-SnipeitManufacturer.ps1 +++ b/SnipeitPS/Public/Remove-SnipeitManufacturer.ps1 @@ -39,9 +39,8 @@ function Remove-SnipeitManufacturer () process { foreach($manufacturer_id in $id){ $Parameters = @{ - Uri = "$url/api/v1/manufacturers/$manufacturer_id_id" + Uri = "$url/api/v1/manufacturers/$manufacturer_id" Method = 'Delete' - Body = '{}' Token = $apiKey } diff --git a/SnipeitPS/Public/Remove-SnipeitModel.ps1 b/SnipeitPS/Public/Remove-SnipeitModel.ps1 index 788710f..65509bd 100644 --- a/SnipeitPS/Public/Remove-SnipeitModel.ps1 +++ b/SnipeitPS/Public/Remove-SnipeitModel.ps1 @@ -41,7 +41,6 @@ function Remove-SnipeitModel () $Parameters = @{ Uri = "$url/api/v1/models/$model_id" Method = 'Delete' - Body = '{}' Token = $apiKey } diff --git a/SnipeitPS/Public/Remove-SnipeitSupplier.ps1 b/SnipeitPS/Public/Remove-SnipeitSupplier.ps1 new file mode 100644 index 0000000..196df14 --- /dev/null +++ b/SnipeitPS/Public/Remove-SnipeitSupplier.ps1 @@ -0,0 +1,54 @@ +<# + .SYNOPSIS + Removes supplier from Snipe-it asset system + .DESCRIPTION + Removes supplier or multiple manufacturers from Snipe-it asset system + .PARAMETER ID + Unique ID For supplier 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-SnipeitSupplier -ID 44 + + .EXAMPLE + Get-SnipeitSupplier | Where-object {$_.name -like '*something*'} | Remove-SnipeitSupplier +#> + +function Remove-SnipeitSupplier () +{ + [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($suppliers_id in $id){ + $Parameters = @{ + Uri = "$url/api/v1/suppliers/$supplier_id" + Method = 'Delete' + Token = $apiKey + } + + If ($PSCmdlet.ShouldProcess("ShouldProcess?")) + { + $result = Invoke-SnipeitMethod @Parameters + } + $result + } + } +} diff --git a/SnipeitPS/Public/Remove-SnipeitUser.ps1 b/SnipeitPS/Public/Remove-SnipeitUser.ps1 index ca254bf..6afd60b 100644 --- a/SnipeitPS/Public/Remove-SnipeitUser.ps1 +++ b/SnipeitPS/Public/Remove-SnipeitUser.ps1 @@ -41,7 +41,6 @@ function Remove-SnipeitUser () $Parameters = @{ Uri = "$url/api/v1/users/$user_id" Method = 'Delete' - Body = '{}' Token = $apiKey } diff --git a/SnipeitPS/Public/Reset-SnipeitAccessoryOwner.ps1 b/SnipeitPS/Public/Reset-SnipeitAccessoryOwner.ps1 index a85ca2c..060bb90 100644 --- a/SnipeitPS/Public/Reset-SnipeitAccessoryOwner.ps1 +++ b/SnipeitPS/Public/Reset-SnipeitAccessoryOwner.ps1 @@ -46,7 +46,7 @@ function Reset-SnipeitAccessoryOwner() $Parameters = @{ Uri = "$url/api/v1/accessories/$assigned_pivot_id/checkin" Method = 'Post' - Body = '{}' + Body = @{} Token = $apiKey } diff --git a/SnipeitPS/Public/Reset-SnipeitAssetOwner.ps1 b/SnipeitPS/Public/Reset-SnipeitAssetOwner.ps1 index 9340d42..6a55915 100644 --- a/SnipeitPS/Public/Reset-SnipeitAssetOwner.ps1 +++ b/SnipeitPS/Public/Reset-SnipeitAssetOwner.ps1 @@ -57,12 +57,10 @@ function Reset-SnipeitAssetOwner() { if ($PSBoundParameters.ContainsKey('location_id')) { $Values.Add("location_id", $location_id) } if ($PSBoundParameters.ContainsKey('status_id')) { $Values.Add("status_id", $status_id) } - $Body = $Values | ConvertTo-Json; - $Parameters = @{ Uri = "$url/api/v1/hardware/$id/checkin" Method = 'POST' - Body = $Body + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/Set-SnipeitAccessory.ps1 b/SnipeitPS/Public/Set-SnipeitAccessory.ps1 index 6fd29a9..cbb55d2 100644 --- a/SnipeitPS/Public/Set-SnipeitAccessory.ps1 +++ b/SnipeitPS/Public/Set-SnipeitAccessory.ps1 @@ -38,23 +38,20 @@ Cost of item being purchased. .PARAMETER purchase_date Date accessory was purchased -.PARAMETER order_number -Order number for this accessory. - -.PARAMETER purchase_cost -Cost of item being purchased. - -.PARAMETER purchase_date -Date accessory was purchased - .PARAMETER supplier_id ID number of the supplier for this accessory .PARAMETER location_id ID number of the location the accessory is assigned to -.PARAMETER min_qty -Min quantity of the accessory before alert is triggered +.PARAMETER image +Image file name and path for item + +.PARAMETER image_delete +Remove current image + +.PARAMETER RequestType +Http request type to send Snipe IT system. Defaults to Patch you could use Put if needed. .PARAMETER url URL of Snipeit system, can be set using Set-SnipeitInfoeItInfo command @@ -100,6 +97,16 @@ function Set-SnipeitAccessory() { [Nullable[System.Int32]]$supplier_id, + [Nullable[System.Int32]]$location_id, + + [ValidateScript({Test-Path $_})] + [string]$image, + + [switch]$image_delete=$false, + + [ValidateSet("Put","Patch")] + [string]$RequestType = "Patch", + [parameter(mandatory = $true)] [string]$url, @@ -112,20 +119,18 @@ function Set-SnipeitAccessory() { $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters - if ($values['purchase_date']) { - $values['purchase_date'] = $values['purchase_date'].ToString("yyyy-MM-dd") + if ($Values['purchase_date']) { + $Values['purchase_date'] = $Values['purchase_date'].ToString("yyyy-MM-dd") } - $Body = $Values | ConvertTo-Json; - Write-Verbose "Body: $Body" } process { foreach($accessory_id in $id){ $Parameters = @{ Uri = "$url/api/v1/accessories/$accessory_id" - Method = 'Put' - Body = $Body + Method = $RequestType + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/Set-SnipeitAccessoryOwner.ps1 b/SnipeitPS/Public/Set-SnipeitAccessoryOwner.ps1 index 513c74c..4a6a319 100644 --- a/SnipeitPS/Public/Set-SnipeitAccessoryOwner.ps1 +++ b/SnipeitPS/Public/Set-SnipeitAccessoryOwner.ps1 @@ -46,8 +46,6 @@ function Set-SnipeitAccessoryOwner() ) begin{ $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters - - $Body = $Values | ConvertTo-Json; } process { @@ -55,7 +53,7 @@ function Set-SnipeitAccessoryOwner() $Parameters = @{ Uri = "$url/api/v1/accessories/$accessory_id/checkout" Method = 'POST' - Body = $Body + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/Set-SnipeitAsset.ps1 b/SnipeitPS/Public/Set-SnipeitAsset.ps1 index 5a36c23..b375fda 100644 --- a/SnipeitPS/Public/Set-SnipeitAsset.ps1 +++ b/SnipeitPS/Public/Set-SnipeitAsset.ps1 @@ -53,8 +53,14 @@ .PARAMETER notes Notes about asset + .PARAMETER image + Image file name and path for item + + .PARAMETER image_delete + Remove current image + .PARAMETER RequestType - Http request type to send Snipe IT system. Defaults to Put youc use Patch if needed + Http request type to send Snipe IT system. Defaults to Patch you could use Put if needed. .PARAMETER url URL of Snipeit system, can be set using Set-SnipeitInfoeItInfo command @@ -122,6 +128,11 @@ function Set-SnipeitAsset() [ValidateSet("Put","Patch")] [string]$RequestType = "Patch", + [ValidateScript({Test-Path $_})] + [string]$image, + + [switch]$image_delete=$false, + [parameter(mandatory = $true)] [string]$url, @@ -136,8 +147,8 @@ function Set-SnipeitAsset() $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters - if ($values['purchase_date']) { - $values['purchase_date'] = $values['purchase_date'].ToString("yyyy-MM-dd") + if ($Values['purchase_date']) { + $Values['purchase_date'] = $Values['purchase_date'].ToString("yyyy-MM-dd") } if ($customfields) @@ -145,7 +156,6 @@ function Set-SnipeitAsset() $Values += $customfields } - $Body = $Values | ConvertTo-Json; } process { @@ -153,7 +163,7 @@ function Set-SnipeitAsset() $Parameters = @{ Uri = "$url/api/v1/hardware/$asset_id" Method = $RequestType - Body = $Body + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/Set-SnipeitAssetOwner.ps1 b/SnipeitPS/Public/Set-SnipeitAssetOwner.ps1 index 5d859f5..0157c48 100644 --- a/SnipeitPS/Public/Set-SnipeitAssetOwner.ps1 +++ b/SnipeitPS/Public/Set-SnipeitAssetOwner.ps1 @@ -71,11 +71,11 @@ function Set-SnipeitAssetOwner() $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters if ($Values['expected_checkin']) { - $Values['expected_checkin'] = $values['expected_checkin'].ToString("yyyy-MM-dd") + $Values['expected_checkin'] = $Values['expected_checkin'].ToString("yyyy-MM-dd") } if ($Values['checkout_at']) { - $Values['checkout_at'] = $values['checkout_at'].ToString("yyyy-MM-dd") + $Values['checkout_at'] = $Values['checkout_at'].ToString("yyyy-MM-dd") } switch ($checkout_to_type) @@ -88,8 +88,6 @@ function Set-SnipeitAssetOwner() #This can be removed now if($Values.ContainsKey('assigned_id')){$Values.Remove('assigned_id')} - $Body = $Values | ConvertTo-Json; - } process{ @@ -97,7 +95,7 @@ function Set-SnipeitAssetOwner() $Parameters = @{ Uri = "$url/api/v1/hardware/$asset_id/checkout" Method = 'POST' - Body = $Body + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/Set-SnipeitCategory.ps1 b/SnipeitPS/Public/Set-SnipeitCategory.ps1 index a1603e9..f10b21e 100644 --- a/SnipeitPS/Public/Set-SnipeitCategory.ps1 +++ b/SnipeitPS/Public/Set-SnipeitCategory.ps1 @@ -8,12 +8,6 @@ Name of new category to be created .PARAMETER type Type of new category to be created (asset, accessory, consumable, component, license) -.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 - .PARAMETER use_default_eula If switch is present, use the primary default EULA @@ -26,6 +20,21 @@ If switch is present, require users to confirm acceptance of assets in this cate .PARAMETER checkin_email Should the user be emailed the EULA and/or an acceptance confirmation email when this item is checked in? +.PARAMETER image +Image file name and path for item + +.PARAMETER image_delete +Remove current image + +.PARAMETER RequestType +Http request type to send Snipe IT system. Defaults to Patch you could use Put if needed. + +.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 Set-SnipeitCategory -id 4 -name "Laptops" #> @@ -54,6 +63,14 @@ function Set-SnipeitCategory() [bool]$checkin_email, + [ValidateScript({Test-Path $_})] + [string]$image, + + [switch]$image_delete=$false, + + [ValidateSet("Put","Patch")] + [string]$RequestType = "Patch", + [parameter(mandatory = $true)] [string]$url, @@ -66,16 +83,14 @@ function Set-SnipeitCategory() Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters - - $Body = $Values | ConvertTo-Json; } process { foreach($category_id in $id){ $Parameters = @{ Uri = "$url/api/v1/categories/$category_id" - Method = 'Put' - Body = $Body + Method = $RequestType + Body = $values Token = $apiKey } diff --git a/SnipeitPS/Public/Set-SnipeitCompany.ps1 b/SnipeitPS/Public/Set-SnipeitCompany.ps1 index 4dcbb16..923e76d 100644 --- a/SnipeitPS/Public/Set-SnipeitCompany.ps1 +++ b/SnipeitPS/Public/Set-SnipeitCompany.ps1 @@ -11,6 +11,15 @@ ID number of company .PARAMETER name Company name +.PARAMETER image +Image file name and path for item + +.PARAMETER image_delete +Remove current image + +.PARAMETER RequestType +Http request type to send Snipe IT system. Defaults to Patch you could use Put if needed. + .PARAMETER url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -37,6 +46,14 @@ function Set-SnipeitCompany() [parameter(mandatory = $true)] [string]$name, + [ValidateScript({Test-Path $_})] + [string]$image, + + [switch]$image_delete=$false, + + [ValidateSet("Put","Patch")] + [string]$RequestType = "Patch", + [parameter(mandatory = $true)] [string]$url, @@ -45,17 +62,15 @@ function Set-SnipeitCompany() ) begin{ - $values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters - - $Body = $values | ConvertTo-Json; + $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters } process{ foreach($company_id in $id){ $Parameters = @{ Uri = "$url/api/v1/companies/$company_id" - Method = 'Patch' - Body = $Body + Method = $RequestType + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/Set-SnipeitComponent.ps1 b/SnipeitPS/Public/Set-SnipeitComponent.ps1 index afaadec..2834df9 100644 --- a/SnipeitPS/Public/Set-SnipeitComponent.ps1 +++ b/SnipeitPS/Public/Set-SnipeitComponent.ps1 @@ -32,6 +32,15 @@ Date accessory was purchased .PARAMETER purchase_cost Cost of item being purchased. +.PARAMETER image +Image file name and path for item + +.PARAMETER image_delete +Remove current image + +.PARAMETER RequestType +Http request type to send Snipe IT system. Defaults to Patch you could use Put if needed. + .PARAMETER url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -73,6 +82,14 @@ function Set-SnipeitComponent() [float]$purchase_cost, + [ValidateScript({Test-Path $_})] + [string]$image, + + [switch]$image_delete=$false, + + [ValidateSet("Put","Patch")] + [string]$RequestType = "Patch", + [parameter(mandatory = $true)] [string]$url, @@ -82,21 +99,19 @@ function Set-SnipeitComponent() begin { Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name - $values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters + $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters - if ($values['purchase_date']) { - $values['purchase_date'] = $values['purchase_date'].ToString("yyyy-MM-dd") + if ($Values['purchase_date']) { + $Values['purchase_date'] = $Values['purchase_date'].ToString("yyyy-MM-dd") } - - $Body = $values | ConvertTo-Json; } process { foreach($component_id in $id){ $Parameters = @{ Uri = "$url/api/v1/components/$component_id" - Method = 'Patch' - Body = $Body + Method = $RequestType + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/Set-SnipeitConsumable.ps1 b/SnipeitPS/Public/Set-SnipeitConsumable.ps1 index faea85a..4aa28ab 100644 --- a/SnipeitPS/Public/Set-SnipeitConsumable.ps1 +++ b/SnipeitPS/Public/Set-SnipeitConsumable.ps1 @@ -47,6 +47,15 @@ Model number of the consumable in months .PARAMETER item_no Item number for the consumable +.PARAMETER image +Image file name and path for item + +.PARAMETER image_delete +Remove current image + +.PARAMETER RequestType +Http request type to send Snipe IT system. Defaults to Patch you could use Put if needed. + .PARAMETER url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -112,6 +121,14 @@ function Set-SnipeitConsumable() [parameter(mandatory = $false)] [string]$item_no, + [ValidateScript({Test-Path $_})] + [string]$image, + + [switch]$image_delete=$false, + + [ValidateSet("Put","Patch")] + [string]$RequestType = "Patch", + [parameter(mandatory = $true)] [string]$url, @@ -126,15 +143,14 @@ function Set-SnipeitConsumable() $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 + Method = $RequestType + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/Set-SnipeitCustomField.ps1 b/SnipeitPS/Public/Set-SnipeitCustomField.ps1 index de84f8d..d958d37 100644 --- a/SnipeitPS/Public/Set-SnipeitCustomField.ps1 +++ b/SnipeitPS/Public/Set-SnipeitCustomField.ps1 @@ -29,6 +29,9 @@ .PARAMETER help_text Any additional text you wish to display under the new form field to make it clearer what the gauges should be. + .PARAMETER RequestType + Http request type to send Snipe IT system. Defaults to Put you could use Patch if needed. + .PARAMETER url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -69,6 +72,9 @@ function Set-SnipeitCustomField() [string]$custom_format, + [ValidateSet("Put","Patch")] + [string]$RequestType = "Put", + [parameter(mandatory = $true)] [string]$url, @@ -82,17 +88,14 @@ function Set-SnipeitCustomField() } $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters - - $Body = $Values | ConvertTo-Json; - } process{ foreach($field_id in $id) { $Parameters = @{ Uri = "$url/api/v1/fields/$field_id" - Method = 'Put' - Body = $Body + Method = $RequestType + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/Set-SnipeitDepartment.ps1 b/SnipeitPS/Public/Set-SnipeitDepartment.ps1 index d65285f..09d4632 100644 --- a/SnipeitPS/Public/Set-SnipeitDepartment.ps1 +++ b/SnipeitPS/Public/Set-SnipeitDepartment.ps1 @@ -20,6 +20,15 @@ .PARAMETER manager_id ID number of manager + .PARAMETER image + Image file name and path for item + + .PARAMETER image_delete + Remove current image + + .PARAMETER RequestType + Http request type to send Snipe IT system. Defaults to Patch you could use Put if needed. + .PARAMETER url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -51,6 +60,14 @@ function Set-SnipeitDepartment() { [string]$notes, + [ValidateScript({Test-Path $_})] + [string]$image, + + [switch]$image_delete=$false, + + [ValidateSet("Put","Patch")] + [string]$RequestType = "Patch", + [parameter(mandatory = $true)] [string]$url, @@ -61,16 +78,14 @@ function Set-SnipeitDepartment() { begin { $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters - - $Body = $Values | ConvertTo-Json; } process { foreach ($department_id in $id) { $Parameters = @{ Uri = "$url/api/v1/departments/$department_id" - Method = 'Put' - Body = $Body + Method = $RequestType + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/Set-SnipeitLicense.ps1 b/SnipeitPS/Public/Set-SnipeitLicense.ps1 index 78880e2..184aa57 100644 --- a/SnipeitPS/Public/Set-SnipeitLicense.ps1 +++ b/SnipeitPS/Public/Set-SnipeitLicense.ps1 @@ -59,6 +59,9 @@ .PARAMETER termination_date Termination date for license. + .PARAMETER RequestType + Http request type to send Snipe IT system. Defaults to Patch you could use Put if needed. + .PARAMETER url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -121,6 +124,9 @@ function Set-SnipeitLicense() { [datetime]$termination_date, + [ValidateSet("Put","Patch")] + [string]$RequestType = "Patch", + [parameter(mandatory = $true)] [string]$url, @@ -133,27 +139,26 @@ function Set-SnipeitLicense() { $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters - if ($values['expiration_date']) { - $values['expiration_date'] = $values['expiration_date'].ToString("yyyy-MM-dd") + if ($Values['expiration_date']) { + $Values['expiration_date'] = $Values['expiration_date'].ToString("yyyy-MM-dd") } - if ($values['purchase_date']) { - $values['purchase_date'] = $values['purchase_date'].ToString("yyyy-MM-dd") + if ($Values['purchase_date']) { + $Values['purchase_date'] = $Values['purchase_date'].ToString("yyyy-MM-dd") } - if ($values['termination_date']) { - $values['termination_date'] = $values['termination_date'].ToString("yyyy-MM-dd") + if ($Values['termination_date']) { + $Values['termination_date'] = $Values['termination_date'].ToString("yyyy-MM-dd") } - $Body = $Values | ConvertTo-Json; } process { foreach($license_id in $id){ $Parameters = @{ Uri = "$url/api/v1/licenses/$license_id" - Method = 'PUT' - Body = $Body + Method = $RequestType + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/Set-SnipeitLicenseSeat.ps1 b/SnipeitPS/Public/Set-SnipeitLicenseSeat.ps1 index a5dcbbf..5ef3880 100644 --- a/SnipeitPS/Public/Set-SnipeitLicenseSeat.ps1 +++ b/SnipeitPS/Public/Set-SnipeitLicenseSeat.ps1 @@ -16,6 +16,9 @@ .PARAMETER note Notes about checkout + .PARAMETER RequestType + Http request type to send Snipe IT system. Defaults to Patch you could use Put if needed. + .PARAMETER url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -50,12 +53,17 @@ function Set-SnipeitLicenseSeat() [int]$seat_id, [Alias('assigned_id')] + [Nullable[System.Int32]]$assigned_to, + [Nullable[System.Int32]]$asset_id, [string]$note, + [ValidateSet("Put","Patch")] + [string]$RequestType = "Patch", + [parameter(mandatory = $true)] [string]$url, @@ -65,16 +73,14 @@ function Set-SnipeitLicenseSeat() begin{ $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters - - $Body = $Values | ConvertTo-Json; } process{ foreach($license_id in $id) { $Parameters = @{ Uri = "$url/api/v1/licenses/$license_id/seats/$seat_id" - Method = 'Patch' - Body = $Body + Method = $RequestType + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/Set-SnipeitLocation.ps1 b/SnipeitPS/Public/Set-SnipeitLocation.ps1 index 225a5f6..b1c3770 100644 --- a/SnipeitPS/Public/Set-SnipeitLocation.ps1 +++ b/SnipeitPS/Public/Set-SnipeitLocation.ps1 @@ -44,6 +44,15 @@ .PARAMETER parent_id Parent location as id + .PARAMETER image + Image file name and path for item + + .PARAMETER image_delete + Remove current image + + .PARAMETER RequestType + Http request type to send Snipe IT system. Defaults to Patch you could use Put if needed. + .PARAMETER url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -88,6 +97,14 @@ function Set-SnipeitLocation() { [Nullable[System.Int32]]$parent_id, + [ValidateScript({Test-Path $_})] + [string]$image, + + [switch]$image_delete=$false, + + [ValidateSet("Put","Patch")] + [string]$RequestType = "Patch", + [parameter(mandatory = $true)] [string]$url, @@ -99,16 +116,14 @@ function Set-SnipeitLocation() { Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters - - $Body = $Values | ConvertTo-Json; } process{ foreach ($location_id in $id) { $Parameters = @{ Uri = "$url/api/v1/locations/$location_id" - Method = 'PUT' - Body = $Body + Method = $RequestType + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/Set-SnipeitManufacturer.ps1 b/SnipeitPS/Public/Set-SnipeitManufacturer.ps1 new file mode 100644 index 0000000..d0c1064 --- /dev/null +++ b/SnipeitPS/Public/Set-SnipeitManufacturer.ps1 @@ -0,0 +1,78 @@ +<# + .SYNOPSIS + Add a new Manufacturer to Snipe-it asset system + + .DESCRIPTION + Long description + + .PARAMETER Name + Name of the Manufacturer + + .PARAMETER image + Image file name and path for item + + .PARAMETER image_delete + Remove current image + + .PARAMETER RequestType + Http request type to send Snipe IT system. Defaults to Patch you could use Put if needed. + + .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-SnipeitManufacturer -name "HP" +#> + +function Set-SnipeitManufacturer() +{ + [CmdletBinding( + SupportsShouldProcess = $true, + ConfirmImpact = "Low" + )] + + Param( + [parameter(mandatory = $true)] + [string]$Name, + + [ValidateScript({Test-Path $_})] + [string]$image, + + [switch]$image_delete=$false, + + [ValidateSet("Put","Patch")] + [string]$RequestType = "Patch", + + [parameter(mandatory = $true)] + [string]$url, + + [parameter(mandatory = $true)] + [string]$apiKey + ) + + begin{ + Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + + $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters + } + + process{ + foreach ($manufacturer_id in $id) { + $Parameters = @{ + Uri = "$url/api/v1/manufacturers/$manufacturer_id" + Method = $RequestType + Body = $Values + Token = $apiKey + } + + If ($PSCmdlet.ShouldProcess("ShouldProcess?")) { + $result = Invoke-SnipeitMethod @Parameters + } + + $result + } + } +} diff --git a/SnipeitPS/Public/Set-SnipeitModel.ps1 b/SnipeitPS/Public/Set-SnipeitModel.ps1 index 9b6c377..695368f 100644 --- a/SnipeitPS/Public/Set-SnipeitModel.ps1 +++ b/SnipeitPS/Public/Set-SnipeitModel.ps1 @@ -23,6 +23,15 @@ .PARAMETER fieldset_id Fieldset ID that the asset uses (Custom fields) + .PARAMETER image + Image file name and path for item + + .PARAMETER image_delete + Remove current image + + .PARAMETER RequestType + Http request type to send Snipe IT system. Defaults to Patch you could use Put if needed. + .PARAMETER url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -57,6 +66,14 @@ function Set-SnipeitModel() { [Alias("fieldset_id")] [Nullable[System.Int32]]$custom_fieldset_id, + [ValidateScript({Test-Path $_})] + [string]$image, + + [switch]$image_delete=$false, + + [ValidateSet("Put","Patch")] + [string]$RequestType = "Patch", + [parameter(mandatory = $true)] [string]$url, @@ -69,14 +86,13 @@ function Set-SnipeitModel() { $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters - $Body = $Values | ConvertTo-Json; } process { foreach ($model_id in $id) { $Parameters = @{ Uri = "$url/api/v1/models/$model_id" - Method = 'put' - Body = $Body + Method = $RequestType + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/Set-SnipeitStatus.ps1 b/SnipeitPS/Public/Set-SnipeitStatus.ps1 index 54ee8d8..4c11b8a 100644 --- a/SnipeitPS/Public/Set-SnipeitStatus.ps1 +++ b/SnipeitPS/Public/Set-SnipeitStatus.ps1 @@ -15,6 +15,9 @@ Hex code showing what color the status label should be on the pie chart in the d .PARAMETER default_label 1 or 0 - determine whether it should be bubbled up to the top of the list of available statuses +.PARAMETER RequestType +Http request type to send Snipe IT system. Defaults to Patch you could use Put if needed. + .PARAMETER url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -53,6 +56,9 @@ function Set-SnipeitStatus() [bool]$default_label, + [ValidateSet("Put","Patch")] + [string]$RequestType = "Patch", + [parameter(mandatory = $true)] [string]$url, @@ -62,15 +68,14 @@ function Set-SnipeitStatus() begin { $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters - $Body = $Values | ConvertTo-Json } process { foreach($status_id in $id) { $Parameters = @{ Uri = "$url/api/v1/statuslabels/$status_id" - Method = 'Put' - Body = $Body + Method = $RequestType + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/Public/Set-SnipeitSupplier.ps1 b/SnipeitPS/Public/Set-SnipeitSupplier.ps1 new file mode 100644 index 0000000..7180c5a --- /dev/null +++ b/SnipeitPS/Public/Set-SnipeitSupplier.ps1 @@ -0,0 +1,134 @@ +<# + .SYNOPSIS + Modify the supplier + + .DESCRIPTION + Modifieds the supplier on Snipe-It system + + .PARAMETER name + Suppiers Name + + .PARAMETER address + Address line 1 of supplier + + .PARAMETER address2 + Address line 1 of supplier + + .PARAMETER city + City + + .PARAMETER state + State + + .PARAMETER country + Country + + .PARAMETER zip + Zip code + + .PARAMETER phone + Phone number + + .PARAMETER fax + Fax number + + .PARAMETER email + Email address + + .PARAMETER contact + Contact person + + .PARAMETER notes + Email address + + .PARAMETER image + Image file name and path for item + + .PARAMETER image_delete + Remove current image + + .PARAMETER RequestType + Http request type to send Snipe IT system. Defaults to Patch you could use Put if needed. + + .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-SnipeitDepartment -name "Department1" -company_id 1 -localtion_id 1 -manager_id 3 + +#> + +function Set-SnipeitSupplier() { + [CmdletBinding( + SupportsShouldProcess = $true, + ConfirmImpact = "Low" + )] + + Param( + [parameter(mandatory = $true)] + [string]$name, + + [string]$address, + + [string]$address2, + + [string]$city, + + [string]$state, + + [string]$country, + + [string]$zip, + + [string]$phone, + + [string]$fax, + + [string]$email, + + [string]$contact, + + [string]$notes, + + [ValidateScript({Test-Path $_})] + [string]$image, + + [switch]$image_delete, + + [ValidateSet("Put","Patch")] + [string]$RequestType = "Patch", + + [parameter(mandatory = $true)] + [string]$url, + + [parameter(mandatory = $true)] + [string]$apiKey + ) + + begin { + Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + + $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters + + } + process { + foreach ($supplier_id in $id) { + $Parameters = @{ + Uri = "$url/api/v1/suppliers/$supplier_id" + Method = $RequestType + Body = $Values + Token = $apiKey + } + + If ($PSCmdlet.ShouldProcess("ShouldProcess?")) { + $result = Invoke-SnipeitMethod @Parameters + } + + $result + } + } +} + diff --git a/SnipeitPS/Public/Set-SnipeitUser.ps1 b/SnipeitPS/Public/Set-SnipeitUser.ps1 index 4af4301..8654f61 100644 --- a/SnipeitPS/Public/Set-SnipeitUser.ps1 +++ b/SnipeitPS/Public/Set-SnipeitUser.ps1 @@ -53,6 +53,15 @@ .PARAMETER ldap_import Mark user as import from ldap + .PARAMETER image + Image file name and path for item + + .PARAMETER image_delete + Remove current image + + .PARAMETER RequestType + Http request type to send Snipe IT system. Defaults to Patch you could use Put if needed. + .PARAMETER url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -107,6 +116,14 @@ function Set-SnipeitUser() { [string]$notes, + [ValidateScript({Test-Path $_})] + [string]$image, + + [switch]$image_delete=$false, + + [ValidateSet("Put","Patch")] + [string]$RequestType = "Patch", + [parameter(mandatory = $true)] [string]$url, @@ -122,7 +139,6 @@ function Set-SnipeitUser() { $Values['password_confirmation'] = $password } - $Body = $Values | ConvertTo-Json; } process{ @@ -130,7 +146,7 @@ function Set-SnipeitUser() { $Parameters = @{ Uri = "$url/api/v1/users/$user_id" Method = 'PATCH' - Body = $Body + Body = $Values Token = $apiKey } diff --git a/SnipeitPS/SnipeitPS.psd1 b/SnipeitPS/SnipeitPS.psd1 index dbbb9ef..0f0201c 100644 --- a/SnipeitPS/SnipeitPS.psd1 +++ b/SnipeitPS/SnipeitPS.psd1 @@ -12,7 +12,7 @@ RootModule = 'SnipeitPS' # Version number of this module. -ModuleVersion = '1.8' +ModuleVersion = '1.9' # Supported PSEditions # CompatiblePSEditions = @() @@ -104,6 +104,7 @@ FunctionsToExport = @( 'New-SnipeitLocation', 'New-SnipeitManufacturer', 'New-SnipeitModel', + 'New-SnipeitSupplier', 'New-SnipeitUser', 'Remove-SnipeitAccessory', 'Remove-SnipeitAsset', @@ -118,6 +119,7 @@ FunctionsToExport = @( 'Remove-SnipeitLocation', 'Remove-SnipeitManufacturer', 'Remove-SnipeitModel', + 'Remove-SnipeitSupplier', 'Remove-SnipeitUser', 'Reset-SnipeitAccessoryOwner', 'Reset-SnipeitAssetOwner', @@ -135,8 +137,10 @@ FunctionsToExport = @( 'Set-SnipeitLicense', 'Set-SnipeitLicenseSeat', 'Set-SnipeitLocation', + 'Set-SnipeitManufacturer', 'Set-SnipeitModel', 'Set-SnipeitStatus', + 'Set-SnipeitSupplier', 'Set-SnipeitUser', 'Update-SnipeitAlias' ) diff --git a/appveyor.yml b/appveyor.yml index a316978..dc61a6c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -17,7 +17,7 @@ environment: secure: UdM6qhf5B0G8liHhUrwWERCZr44iSqmg4jUq0lwlTjZs4KyeoiwnBzdej0phqIAm PShell: '5' -version: 1.8.{build} +version: 1.9.{build} # Don't rebuild when I tag a release on GitHub skip_tags: true diff --git a/docs/New-SnipeitAccessory.md b/docs/New-SnipeitAccessory.md index de15744..27acd04 100644 --- a/docs/New-SnipeitAccessory.md +++ b/docs/New-SnipeitAccessory.md @@ -16,7 +16,7 @@ Creates new accessory on Snipe-It system New-SnipeitAccessory [-name] [-qty] [-category_id] [[-company_id] ] [[-manufacturer_id] ] [[-order_number] ] [[-model_number] ] [[-purchase_cost] ] [[-purchase_date] ] [[-min_amt] ] [[-supplier_id] ] [[-location_id] ] - [-url] [-apiKey] [-WhatIf] [-Confirm] [] + [[-image] ] [-url] [-apiKey] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -40,7 +40,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 14 +Position: 15 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -76,6 +76,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -image +Accessory image fileame and path + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 13 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -location_id ID number of the location the accessory is assigned to @@ -235,7 +250,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 13 +Position: 14 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/New-SnipeitAsset.md b/docs/New-SnipeitAsset.md index 34bef7c..907ab69 100644 --- a/docs/New-SnipeitAsset.md +++ b/docs/New-SnipeitAsset.md @@ -16,7 +16,7 @@ Add a new Asset to Snipe-it asset system New-SnipeitAsset [-status_id] [-model_id] [[-name] ] [[-asset_tag] ] [[-serial] ] [[-company_id] ] [[-order_number] ] [[-notes] ] [[-warranty_months] ] [[-purchase_cost] ] [[-purchase_date] ] - [[-supplier_id] ] [[-rtd_location_id] ] [-url] [-apiKey] + [[-supplier_id] ] [[-rtd_location_id] ] [[-image] ] [-url] [-apiKey] [[-customfields] ] [-WhatIf] [-Confirm] [] ``` @@ -54,7 +54,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 15 +Position: 16 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -100,7 +100,22 @@ Parameter Sets: (All) Aliases: CustomValues Required: False -Position: 16 +Position: 17 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -image +Asset image filename and path + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 14 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -265,7 +280,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 14 +Position: 15 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/New-SnipeitCategory.md b/docs/New-SnipeitCategory.md index beaa7dc..927766d 100644 --- a/docs/New-SnipeitCategory.md +++ b/docs/New-SnipeitCategory.md @@ -14,8 +14,8 @@ Create a new Snipe-IT Category ``` New-SnipeitCategory [-name] [-category_type] [[-eula_text] ] [-use_default_eula] - [-require_acceptance] [-checkin_email] [-url] [-apiKey] [-WhatIf] [-Confirm] - [] + [-require_acceptance] [-checkin_email] [[-image] ] [-url] [-apiKey] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION @@ -39,7 +39,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 5 +Position: 6 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -90,6 +90,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -image +Category image filename and path + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -name Name of new category to be created @@ -129,7 +144,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 4 +Position: 5 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/New-SnipeitCompany.md b/docs/New-SnipeitCompany.md index 3d7a389..320c3d9 100644 --- a/docs/New-SnipeitCompany.md +++ b/docs/New-SnipeitCompany.md @@ -13,7 +13,7 @@ Creates a new Company ## SYNTAX ``` -New-SnipeitCompany [-name] [-url] [-apiKey] [-WhatIf] [-Confirm] +New-SnipeitCompany [-name] [[-image] ] [-url] [-apiKey] [-WhatIf] [-Confirm] [] ``` @@ -38,7 +38,22 @@ Parameter Sets: (All) Aliases: Required: True -Position: 3 +Position: 4 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -image +Company image filename and path + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -68,7 +83,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 2 +Position: 3 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/New-SnipeitComponent.md b/docs/New-SnipeitComponent.md index 19a69e5..3f230a2 100644 --- a/docs/New-SnipeitComponent.md +++ b/docs/New-SnipeitComponent.md @@ -15,7 +15,7 @@ Create a new component ``` New-SnipeitComponent [-name] [-category_id] [-qty] [[-company_id] ] [[-location_id] ] [[-order_number] ] [[-purchase_date] ] [[-purchase_cost] ] - [-url] [-apiKey] [-WhatIf] [-Confirm] [] + [[-image] ] [-url] [-apiKey] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -39,7 +39,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 10 +Position: 11 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -75,6 +75,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -image +Component image filename and path + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 9 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -location_id ID number of the location the accessory is assigned to @@ -174,7 +189,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 9 +Position: 10 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/New-SnipeitConsumable.md b/docs/New-SnipeitConsumable.md index c030a82..4778e65 100644 --- a/docs/New-SnipeitConsumable.md +++ b/docs/New-SnipeitConsumable.md @@ -16,8 +16,8 @@ Add a new Consumable to Snipe-it asset system 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] - [] + [[-model_number] ] [[-item_no] ] [[-image] ] [-url] [-apiKey] + [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -42,7 +42,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 15 +Position: 16 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -78,6 +78,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -image +Consumable Image filename and path + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 14 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -item_no Item number for the consumable @@ -252,7 +267,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 14 +Position: 15 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/New-SnipeitDepartment.md b/docs/New-SnipeitDepartment.md index a5a01b5..cd96ed7 100644 --- a/docs/New-SnipeitDepartment.md +++ b/docs/New-SnipeitDepartment.md @@ -14,7 +14,8 @@ Creates a department ``` New-SnipeitDepartment [-name] [[-company_id] ] [[-location_id] ] [[-manager_id] ] - [[-notes] ] [-url] [-apiKey] [-WhatIf] [-Confirm] [] + [[-notes] ] [[-image] ] [-image_delete] [-url] [-apiKey] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION @@ -38,7 +39,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 7 +Position: 8 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -59,6 +60,36 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -image +Department Image filename and path + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 6 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -image_delete +{{ Fill image_delete Description }} + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -location_id ID number of location @@ -128,7 +159,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 6 +Position: 7 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/New-SnipeitLocation.md b/docs/New-SnipeitLocation.md index 6b12649..744b3f2 100644 --- a/docs/New-SnipeitLocation.md +++ b/docs/New-SnipeitLocation.md @@ -15,8 +15,8 @@ Add a new Location to Snipe-it asset system ``` New-SnipeitLocation [-name] [[-address] ] [[-address2] ] [[-city] ] [[-state] ] [[-country] ] [[-zip] ] [[-currency] ] [[-parent_id] ] - [[-manager_id] ] [[-ldap_ou] ] [-url] [-apiKey] [-WhatIf] [-Confirm] - [] + [[-manager_id] ] [[-ldap_ou] ] [[-image] ] [-image_delete] [-url] + [-apiKey] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -70,7 +70,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 13 +Position: 14 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -121,6 +121,36 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -image +Location Image filename and path + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 12 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -image_delete +{{ Fill image_delete Description }} + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -ldap_ou The LDAP OU of the location @@ -205,7 +235,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 12 +Position: 13 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/New-SnipeitManufacturer.md b/docs/New-SnipeitManufacturer.md index 434bb49..d5e266a 100644 --- a/docs/New-SnipeitManufacturer.md +++ b/docs/New-SnipeitManufacturer.md @@ -13,8 +13,8 @@ Add a new Manufacturer to Snipe-it asset system ## SYNTAX ``` -New-SnipeitManufacturer [-Name] [-url] [-apiKey] [-WhatIf] [-Confirm] - [] +New-SnipeitManufacturer [-Name] [[-image] ] [-image_delete] [-url] [-apiKey] + [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -38,12 +38,42 @@ Parameter Sets: (All) Aliases: Required: True -Position: 3 +Position: 4 Default value: None Accept pipeline input: False Accept wildcard characters: False ``` +### -image +Manufacturer Image filename and path + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -image_delete +Remove current image + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Name Name of the Manufacturer @@ -68,7 +98,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 2 +Position: 3 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/New-SnipeitModel.md b/docs/New-SnipeitModel.md index ea055b5..564f431 100644 --- a/docs/New-SnipeitModel.md +++ b/docs/New-SnipeitModel.md @@ -14,8 +14,8 @@ Add a new Model to Snipe-it asset system ``` New-SnipeitModel [-name] [[-model_number] ] [-category_id] [-manufacturer_id] - [[-eol] ] [-fieldset_id] [-url] [-apiKey] [-WhatIf] [-Confirm] - [] + [[-eol] ] [-fieldset_id] [[-image] ] [-url] [-apiKey] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION @@ -39,7 +39,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 8 +Position: 9 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -90,6 +90,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -image +Asset model Image filename and path + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 7 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -manufacturer_id Manufacturer ID that the asset belongs to this can be got using Get-Manufacturer @@ -144,7 +159,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 7 +Position: 8 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/New-SnipeitSupplier.md b/docs/New-SnipeitSupplier.md new file mode 100644 index 0000000..3892b88 --- /dev/null +++ b/docs/New-SnipeitSupplier.md @@ -0,0 +1,299 @@ +--- +external help file: SnipeitPS-help.xml +Module Name: SnipeitPS +online version: +schema: 2.0.0 +--- + +# New-SnipeitSupplier + +## SYNOPSIS +Creates a supplier + +## SYNTAX + +``` +New-SnipeitSupplier [-name] [[-address] ] [[-address2] ] [[-city] ] + [[-state] ] [[-country] ] [[-zip] ] [[-phone] ] [[-fax] ] + [[-email] ] [[-contact] ] [[-notes] ] [[-image] ] [-url] + [-apiKey] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Creates a new supplier on Snipe-It system + +## EXAMPLES + +### EXAMPLE 1 +``` +New-SnipeitDepartment -name "Department1" -company_id 1 -localtion_id 1 -manager_id 3 +``` + +## PARAMETERS + +### -address +Address line 1 of supplier + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -address2 +Address line 1 of supplier + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +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: 15 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -city +City + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -contact +Contact person + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 11 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -country +Country + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 6 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -email +Email address + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 10 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -fax +Fax number + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 9 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -image +Image file name and path for item + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 13 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -name +Department Name + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -notes +Email address + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 12 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -phone +Phone number + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 8 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -state +State + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 5 +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: 14 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zip +Zip code + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 7 +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-SnipeitUser.md b/docs/New-SnipeitUser.md index 99a4cc0..e830d0a 100644 --- a/docs/New-SnipeitUser.md +++ b/docs/New-SnipeitUser.md @@ -16,8 +16,8 @@ Creates a new user New-SnipeitUser [-first_name] [-last_name] [-username] [[-password] ] [[-activated] ] [[-notes] ] [[-jobtitle] ] [[-email] ] [[-phone] ] [[-company_id] ] [[-location_id] ] [[-department_id] ] [[-manager_id] ] - [[-employee_num] ] [[-ldap_import] ] [-url] [-apiKey] [-WhatIf] [-Confirm] - [] + [[-employee_num] ] [[-ldap_import] ] [[-image] ] [-url] [-apiKey] + [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -57,7 +57,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 17 +Position: 18 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -138,6 +138,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -image +User Image file name and path + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 16 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -jobtitle Users job tittle @@ -267,7 +282,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 16 +Position: 17 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/Remove-SnipeitSupplier.md b/docs/Remove-SnipeitSupplier.md new file mode 100644 index 0000000..4fcae40 --- /dev/null +++ b/docs/Remove-SnipeitSupplier.md @@ -0,0 +1,122 @@ +--- +external help file: SnipeitPS-help.xml +Module Name: SnipeitPS +online version: +schema: 2.0.0 +--- + +# Remove-SnipeitSupplier + +## SYNOPSIS +Removes supplier from Snipe-it asset system + +## SYNTAX + +``` +Remove-SnipeitSupplier [-id] [-URL] [-APIKey] [-WhatIf] [-Confirm] + [] +``` + +## DESCRIPTION +Removes supplier or multiple manufacturers from Snipe-it asset system + +## EXAMPLES + +### EXAMPLE 1 +``` +Remove-SnipeitSupplier -ID 44 +``` + +### EXAMPLE 2 +``` +Get-SnipeitSupplier | Where-object {$_.name -like '*something*'} | Remove-SnipeitSupplier +``` + +## 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 supplier 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-SnipeitAccessory.md b/docs/Set-SnipeitAccessory.md index 9adeae2..3d689f6 100644 --- a/docs/Set-SnipeitAccessory.md +++ b/docs/Set-SnipeitAccessory.md @@ -16,7 +16,8 @@ Updates accessory on Snipe-It system Set-SnipeitAccessory [-id] [[-name] ] [[-qty] ] [[-category_id] ] [[-company_id] ] [[-manufacturer_id] ] [[-model_number] ] [[-order_number] ] [[-purchase_cost] ] [[-purchase_date] ] [[-min_amt] ] [[-supplier_id] ] - [-url] [-apiKey] [-WhatIf] [-Confirm] [] + [[-location_id] ] [[-image] ] [-image_delete] [[-RequestType] ] [-url] + [-apiKey] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -40,7 +41,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 14 +Position: 17 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -91,6 +92,51 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -image +Image file name and path for item + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 14 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -image_delete +Remove current image + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -location_id +ID number of the location the accessory is assigned to + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 13 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -manufacturer_id ID number of the manufacturer for this accessory. @@ -211,6 +257,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -RequestType +Http request type to send Snipe IT system. +Defaults to Patch you could use Put if needed. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 15 +Default value: Patch +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -supplier_id ID number of the supplier for this accessory @@ -235,7 +297,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 13 +Position: 16 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/Set-SnipeitAsset.md b/docs/Set-SnipeitAsset.md index 900e5da..84476cf 100644 --- a/docs/Set-SnipeitAsset.md +++ b/docs/Set-SnipeitAsset.md @@ -17,8 +17,8 @@ Set-SnipeitAsset [-id] [[-name] ] [[-status_id] ] [[-mo [[-last_checkout] ] [[-assigned_to] ] [[-company_id] ] [[-serial] ] [[-order_number] ] [[-warranty_months] ] [[-purchase_cost] ] [[-purchase_date] ] [[-requestable] ] [[-archived] ] [[-rtd_location_id] ] - [[-notes] ] [[-RequestType] ] [-url] [-apiKey] [[-customfields] ] - [-WhatIf] [-Confirm] [] + [[-notes] ] [[-RequestType] ] [[-image] ] [-image_delete] [-url] + [-apiKey] [[-customfields] ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -52,7 +52,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 19 +Position: 20 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -113,7 +113,7 @@ Parameter Sets: (All) Aliases: CustomValues Required: False -Position: 20 +Position: 21 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -134,6 +134,36 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -image +Image file name and path for item + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 18 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -image_delete +Remove current image + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -last_checkout Date the asset was last checked out @@ -256,7 +286,7 @@ Accept wildcard characters: False ### -RequestType Http request type to send Snipe IT system. -Defaults to Put youc use Patch if needed +Defaults to Patch you could use Put if needed. ```yaml Type: String @@ -324,7 +354,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 18 +Position: 19 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/Set-SnipeitCategory.md b/docs/Set-SnipeitCategory.md index a380ae5..ffa7b95 100644 --- a/docs/Set-SnipeitCategory.md +++ b/docs/Set-SnipeitCategory.md @@ -14,8 +14,9 @@ Create a new Snipe-IT Category ``` Set-SnipeitCategory [-id] [[-name] ] [[-category_type] ] [[-eula_text] ] - [[-use_default_eula] ] [[-require_acceptance] ] [[-checkin_email] ] [-url] - [-apiKey] [-WhatIf] [-Confirm] [] + [[-use_default_eula] ] [[-require_acceptance] ] [[-checkin_email] ] + [[-image] ] [-image_delete] [[-RequestType] ] [-url] [-apiKey] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION @@ -39,7 +40,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 9 +Position: 11 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -105,6 +106,36 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -image +Image file name and path for item + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 8 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -image_delete +Remove current image + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -name Name of new category to be created @@ -120,6 +151,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -RequestType +Http request type to send Snipe IT system. +Defaults to Patch you could use Put if needed. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 9 +Default value: Patch +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -require_acceptance If switch is present, require users to confirm acceptance of assets in this category @@ -144,7 +191,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 8 +Position: 10 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/Set-SnipeitCompany.md b/docs/Set-SnipeitCompany.md index 53ee457..6c32fed 100644 --- a/docs/Set-SnipeitCompany.md +++ b/docs/Set-SnipeitCompany.md @@ -13,8 +13,8 @@ Updates company name ## SYNTAX ``` -Set-SnipeitCompany [-id] [-name] [-url] [-apiKey] [-WhatIf] [-Confirm] - [] +Set-SnipeitCompany [-id] [-name] [[-image] ] [-image_delete] + [[-RequestType] ] [-url] [-apiKey] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -38,7 +38,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 4 +Position: 6 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -59,6 +59,36 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -image +Image file name and path for item + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -image_delete +Remove current image + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -name Company name @@ -74,6 +104,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -RequestType +Http request type to send Snipe IT system. +Defaults to Patch you could use Put if needed. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: Patch +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -83,7 +129,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 3 +Position: 5 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/Set-SnipeitComponent.md b/docs/Set-SnipeitComponent.md index 69b6a50..38312ae 100644 --- a/docs/Set-SnipeitComponent.md +++ b/docs/Set-SnipeitComponent.md @@ -15,7 +15,8 @@ Updates component ``` Set-SnipeitComponent [-id] [-qty] [[-min_amt] ] [[-name] ] [[-company_id] ] [[-location_id] ] [[-order_number] ] [[-purchase_date] ] - [[-purchase_cost] ] [-url] [-apiKey] [-WhatIf] [-Confirm] [] + [[-purchase_cost] ] [[-image] ] [-image_delete] [[-RequestType] ] [-url] + [-apiKey] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -39,7 +40,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 11 +Position: 13 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -75,6 +76,36 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -image +Image file name and path for item + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 10 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -image_delete +Remove current image + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -location_id ID number of the location the accessory is assigned to @@ -180,6 +211,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -RequestType +Http request type to send Snipe IT system. +Defaults to Patch you could use Put if needed. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 11 +Default value: Patch +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -189,7 +236,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 10 +Position: 12 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/Set-SnipeitConsumable.md b/docs/Set-SnipeitConsumable.md index 2379254..ec673c0 100644 --- a/docs/Set-SnipeitConsumable.md +++ b/docs/Set-SnipeitConsumable.md @@ -16,8 +16,8 @@ Add a new Consumable to Snipe-it asset system 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] - [] + [[-model_number] ] [[-item_no] ] [[-image] ] [-image_delete] [[-RequestType] ] + [-url] [-apiKey] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -42,7 +42,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 16 +Position: 18 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -93,6 +93,36 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -image +Image file name and path for item + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 15 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -image_delete +Remove current image + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -item_no Item number for the consumable @@ -258,6 +288,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -RequestType +Http request type to send Snipe IT system. +Defaults to Patch you could use Put if needed. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 16 +Default value: Patch +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -267,7 +313,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 15 +Position: 17 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/Set-SnipeitCustomField.md b/docs/Set-SnipeitCustomField.md index 78fe1f3..8606f6d 100644 --- a/docs/Set-SnipeitCustomField.md +++ b/docs/Set-SnipeitCustomField.md @@ -15,7 +15,8 @@ Add a new Custom Field to Snipe-it asset system ``` Set-SnipeitCustomField [-id] [[-name] ] [[-help_text] ] [-element] [[-format] ] [[-field_values] ] [[-field_encrypted] ] [[-show_in_email] ] - [[-custom_format] ] [-url] [-apiKey] [-WhatIf] [-Confirm] [] + [[-custom_format] ] [[-RequestType] ] [-url] [-apiKey] [-WhatIf] [-Confirm] + [] ``` ## DESCRIPTION @@ -39,7 +40,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 11 +Position: 12 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -166,6 +167,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -RequestType +Http request type to send Snipe IT system. +Defaults to Put you could use Patch if needed. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 10 +Default value: Put +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -show_in_email Whether or not to show the custom field in email notifications @@ -190,7 +207,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 10 +Position: 11 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/Set-SnipeitDepartment.md b/docs/Set-SnipeitDepartment.md index c701fc9..e3de315 100644 --- a/docs/Set-SnipeitDepartment.md +++ b/docs/Set-SnipeitDepartment.md @@ -14,8 +14,8 @@ Updates a department ``` Set-SnipeitDepartment [-id] [[-name] ] [[-company_id] ] [[-location_id] ] - [[-manager_id] ] [[-notes] ] [-url] [-apiKey] [-WhatIf] [-Confirm] - [] + [[-manager_id] ] [[-notes] ] [[-image] ] [-image_delete] [[-RequestType] ] + [-url] [-apiKey] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -39,7 +39,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 8 +Position: 10 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -75,6 +75,36 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -image +Image file name and path for item + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 7 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -image_delete +Remove current image + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -location_id ID number of location @@ -135,6 +165,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -RequestType +Http request type to send Snipe IT system. +Defaults to Patch you could use Put if needed. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 8 +Default value: Patch +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -144,7 +190,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 7 +Position: 9 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/Set-SnipeitLicense.md b/docs/Set-SnipeitLicense.md index 8730895..00a36ea 100644 --- a/docs/Set-SnipeitLicense.md +++ b/docs/Set-SnipeitLicense.md @@ -18,7 +18,7 @@ Set-SnipeitLicense [-id] [[-name] ] [[-seats] ] [[-cate [[-license_name] ] [[-maintained] ] [[-manufacturer_id] ] [[-notes] ] [[-order_number] ] [[-purchase_cost] ] [[-purchase_date] ] [[-reassignable] ] [[-serial] ] [[-supplier_id] ] [[-termination_date] ] - [-url] [-apiKey] [-WhatIf] [-Confirm] [] + [[-RequestType] ] [-url] [-apiKey] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -42,7 +42,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 20 +Position: 21 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -258,6 +258,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -RequestType +Http request type to send Snipe IT system. +Defaults to Patch you could use Put if needed. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 19 +Default value: Patch +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -seats Number of license seats owned. @@ -327,7 +343,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 19 +Position: 20 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/Set-SnipeitLicenseSeat.md b/docs/Set-SnipeitLicenseSeat.md index 7f53a74..f8ba02b 100644 --- a/docs/Set-SnipeitLicenseSeat.md +++ b/docs/Set-SnipeitLicenseSeat.md @@ -14,7 +14,8 @@ Set license seat or checkout license seat ``` Set-SnipeitLicenseSeat [-id] [-seat_id] [[-assigned_to] ] [[-asset_id] ] - [[-note] ] [-url] [-apiKey] [-WhatIf] [-Confirm] [] + [[-note] ] [[-RequestType] ] [-url] [-apiKey] [-WhatIf] [-Confirm] + [] ``` ## DESCRIPTION @@ -51,7 +52,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 7 +Position: 8 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -117,6 +118,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -RequestType +Http request type to send Snipe IT system. +Defaults to Patch you could use Put if needed. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 6 +Default value: Patch +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -seat_id {{ Fill seat_id Description }} @@ -141,7 +158,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 6 +Position: 7 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/Set-SnipeitLocation.md b/docs/Set-SnipeitLocation.md index f1fa607..c1ffa14 100644 --- a/docs/Set-SnipeitLocation.md +++ b/docs/Set-SnipeitLocation.md @@ -15,8 +15,8 @@ Updates Location in Snipe-it asset system ``` Set-SnipeitLocation [-id] [[-name] ] [[-address] ] [[-address2] ] [[-state] ] [[-country] ] [[-zip] ] [[-city] ] [[-currency] ] - [[-manager_id] ] [[-ldap_ou] ] [[-parent_id] ] [-url] [-apiKey] - [-WhatIf] [-Confirm] [] + [[-manager_id] ] [[-ldap_ou] ] [[-parent_id] ] [[-image] ] [-image_delete] + [[-RequestType] ] [-url] [-apiKey] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -70,7 +70,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 14 +Position: 16 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -136,6 +136,36 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -image +Image file name and path for item + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 13 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -image_delete +Remove current image + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -ldap_ou LDAP OU of Location @@ -196,6 +226,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -RequestType +Http request type to send Snipe IT system. +Defaults to Patch you could use Put if needed. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 14 +Default value: Patch +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -state Address State @@ -220,7 +266,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 13 +Position: 15 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/Set-SnipeitManufacturer.md b/docs/Set-SnipeitManufacturer.md new file mode 100644 index 0000000..18ea40e --- /dev/null +++ b/docs/Set-SnipeitManufacturer.md @@ -0,0 +1,163 @@ +--- +external help file: SnipeitPS-help.xml +Module Name: SnipeitPS +online version: +schema: 2.0.0 +--- + +# Set-SnipeitManufacturer + +## SYNOPSIS +Add a new Manufacturer to Snipe-it asset system + +## SYNTAX + +``` +Set-SnipeitManufacturer [-Name] [[-image] ] [-image_delete] [[-RequestType] ] + [-url] [-apiKey] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Long description + +## EXAMPLES + +### EXAMPLE 1 +``` +New-SnipeitManufacturer -name "HP" +``` + +## PARAMETERS + +### -apiKey +Users API Key for Snipeit, can be set using Set-SnipeitInfo command + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 5 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -image +Image file name and path for item + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -image_delete +Remove current image + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the Manufacturer + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RequestType +Http request type to send Snipe IT system. +Defaults to Patch you could use Put if needed. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: Patch +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: 4 +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-SnipeitModel.md b/docs/Set-SnipeitModel.md index 9397c5e..41bb999 100644 --- a/docs/Set-SnipeitModel.md +++ b/docs/Set-SnipeitModel.md @@ -14,8 +14,9 @@ Updates Model on Snipe-it asset system ``` Set-SnipeitModel [-id] [[-name] ] [[-model_number] ] [[-category_id] ] - [[-manufacturer_id] ] [[-eol] ] [[-custom_fieldset_id] ] [-url] - [-apiKey] [-WhatIf] [-Confirm] [] + [[-manufacturer_id] ] [[-eol] ] [[-custom_fieldset_id] ] [[-image] ] + [-image_delete] [[-RequestType] ] [-url] [-apiKey] [-WhatIf] [-Confirm] + [] ``` ## DESCRIPTION @@ -39,7 +40,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 9 +Position: 11 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -105,6 +106,36 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -image +Image file name and path for item + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 8 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -image_delete +Remove current image + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -manufacturer_id Manufacturer ID that the asset belongs to this can be got using Get-Manufacturer @@ -150,6 +181,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -RequestType +Http request type to send Snipe IT system. +Defaults to Patch you could use Put if needed. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 9 +Default value: Patch +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -159,7 +206,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 8 +Position: 10 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/Set-SnipeitStatus.md b/docs/Set-SnipeitStatus.md index 2e23b50..e8f37c0 100644 --- a/docs/Set-SnipeitStatus.md +++ b/docs/Set-SnipeitStatus.md @@ -14,8 +14,8 @@ Sets Snipe-it Status Labels ``` Set-SnipeitStatus [-id] [[-name] ] [-type] [[-notes] ] [[-color] ] - [[-show_in_nav] ] [[-default_label] ] [-url] [-apiKey] [-WhatIf] - [-Confirm] [] + [[-show_in_nav] ] [[-default_label] ] [[-RequestType] ] [-url] + [-apiKey] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -44,7 +44,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 9 +Position: 10 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -125,6 +125,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -RequestType +Http request type to send Snipe IT system. +Defaults to Patch you could use Put if needed. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 8 +Default value: Patch +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -show_in_nav 1 or 0 - determine whether the status label should show in the left-side nav of the web GUI @@ -164,7 +180,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 8 +Position: 9 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/Set-SnipeitSupplier.md b/docs/Set-SnipeitSupplier.md new file mode 100644 index 0000000..c1e35e6 --- /dev/null +++ b/docs/Set-SnipeitSupplier.md @@ -0,0 +1,330 @@ +--- +external help file: SnipeitPS-help.xml +Module Name: SnipeitPS +online version: +schema: 2.0.0 +--- + +# Set-SnipeitSupplier + +## SYNOPSIS +Modify the supplier + +## SYNTAX + +``` +Set-SnipeitSupplier [-name] [[-address] ] [[-address2] ] [[-city] ] + [[-state] ] [[-country] ] [[-zip] ] [[-phone] ] [[-fax] ] + [[-email] ] [[-contact] ] [[-notes] ] [[-image] ] [-image_delete] + [[-RequestType] ] [-url] [-apiKey] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Modifieds the supplier on Snipe-It system + +## EXAMPLES + +### EXAMPLE 1 +``` +New-SnipeitDepartment -name "Department1" -company_id 1 -localtion_id 1 -manager_id 3 +``` + +## PARAMETERS + +### -address +Address line 1 of supplier + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -address2 +Address line 1 of supplier + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +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: 16 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -city +City + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -contact +Contact person + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 11 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -country +Country + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 6 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -email +Email address + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 10 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -fax +Fax number + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 9 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -image +Image file name and path for item + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 13 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -image_delete +Remove current image + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -name +Suppiers Name + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -notes +Email address + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 12 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -phone +Phone number + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 8 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RequestType +Http request type to send Snipe IT system. +Defaults to Patch you could use Put if needed. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 14 +Default value: Patch +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -state +State + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 5 +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: 15 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zip +Zip code + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 7 +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-SnipeitUser.md b/docs/Set-SnipeitUser.md index 1e52ef2..d2ca9f5 100644 --- a/docs/Set-SnipeitUser.md +++ b/docs/Set-SnipeitUser.md @@ -16,8 +16,8 @@ Creates a new user Set-SnipeitUser [-id] [[-first_name] ] [[-last_name] ] [[-userName] ] [[-jobtitle] ] [[-email] ] [[-phone] ] [[-password] ] [[-company_id] ] [[-location_id] ] [[-department_id] ] [[-manager_id] ] [[-employee_num] ] - [[-activated] ] [[-notes] ] [-url] [-apiKey] [-WhatIf] [-Confirm] - [] + [[-activated] ] [[-notes] ] [[-image] ] [-image_delete] [[-RequestType] ] + [-url] [-apiKey] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -57,7 +57,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 17 +Position: 19 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -153,6 +153,36 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -image +Image file name and path for item + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 16 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -image_delete +Remove current image + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -jobtitle Users job tittle @@ -258,6 +288,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -RequestType +Http request type to send Snipe IT system. +Defaults to Patch you could use Put if needed. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 17 +Default value: Patch +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -267,7 +313,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 16 +Position: 18 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/SnipeitPS.md b/docs/SnipeitPS.md index aba8a60..2378a40 100644 --- a/docs/SnipeitPS.md +++ b/docs/SnipeitPS.md @@ -104,6 +104,9 @@ Add a new Manufacturer to Snipe-it asset system ### [New-SnipeitModel](New-SnipeitModel.md) Add a new Model to Snipe-it asset system +### [New-SnipeitSupplier](New-SnipeitSupplier.md) +Creates a supplier + ### [New-SnipeitUser](New-SnipeitUser.md) Creates a new user @@ -146,6 +149,9 @@ Removes manufacturer from Snipe-it asset system ### [Remove-SnipeitModel](Remove-SnipeitModel.md) Removes Asset model from Snipe-it asset system +### [Remove-SnipeitSupplier](Remove-SnipeitSupplier.md) +Removes supplier from Snipe-it asset system + ### [Remove-SnipeitUser](Remove-SnipeitUser.md) Removes User from Snipe-it asset system @@ -197,12 +203,18 @@ Set license seat or checkout license seat ### [Set-SnipeitLocation](Set-SnipeitLocation.md) Updates Location in Snipe-it asset system +### [Set-SnipeitManufacturer](Set-SnipeitManufacturer.md) +Add a new Manufacturer to Snipe-it asset system + ### [Set-SnipeitModel](Set-SnipeitModel.md) Updates Model on Snipe-it asset system ### [Set-SnipeitStatus](Set-SnipeitStatus.md) Sets Snipe-it Status Labels +### [Set-SnipeitSupplier](Set-SnipeitSupplier.md) +Modify the supplier + ### [Set-SnipeitUser](Set-SnipeitUser.md) Creates a new user