Merge pull request #200 from snazy2000/develop

Release 1.9
This commit is contained in:
Petri Asikainen 2021-07-14 13:22:04 +03:00 committed by GitHub
commit 64902b58b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
87 changed files with 2575 additions and 277 deletions

View file

@ -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/), The format is based on [Keep a Changelog](http://keepachangelog.com/),
and this project adheres to [Semantic Versioning](http://semver.org/). 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 # [v.1.8.x] - 2021-06-17

View file

@ -57,5 +57,13 @@ function Get-ParameterValue {
} }
finally {} 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 return $ParameterValues
} }

View file

@ -17,7 +17,7 @@
# Body of the request # Body of the request
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string]$Body, [Hashtable]$Body,
[string] $Token, [string] $Token,
@ -34,6 +34,8 @@
Throw $exception Throw $exception
} }
#To support images "image" property have be handled before this
$_headers = @{ $_headers = @{
"Authorization" = "Bearer $($token)" "Authorization" = "Bearer $($token)"
'Content-Type' = 'application/json; charset=utf-8' 'Content-Type' = 'application/json; charset=utf-8'
@ -59,17 +61,37 @@
ErrorAction = 'SilentlyContinue' 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 $script:PSDefaultParameterValues = $global:PSDefaultParameterValues
Write-Debug $Body Write-Debug "$($Body | ConvertTo-Json)"
# Invoke the API # Invoke the API
try { try {
Write-Verbose "[$($MyInvocation.MyCommand.Name)] Invoking method $Method to URI $URi" Write-Verbose "[$($MyInvocation.MyCommand.Name)] Invoking method $Method to URI $URi"
Write-Debug "[$($MyInvocation.MyCommand.Name)] Invoke-WebRequest with: $($splatParameters | Out-String)" Write-Debug "[$($MyInvocation.MyCommand.Name)] Invoke-WebRequest with: $($splatParameters | Out-String)"
$webResponse = Invoke-WebRequest @splatParameters $webResponse = Invoke-RestMethod @splatParameters
} }
catch { catch {
Write-Verbose "[$($MyInvocation.MyCommand.Name)] Failed to get an answer from the server" Write-Verbose "[$($MyInvocation.MyCommand.Name)] Failed to get an answer from the server"
@ -81,30 +103,43 @@
if ($webResponse) { if ($webResponse) {
Write-Verbose "[$($MyInvocation.MyCommand.Name)] Status code: $($webResponse.StatusCode)" Write-Verbose "[$($MyInvocation.MyCommand.Name)] Status code: $($webResponse.StatusCode)"
if ($webResponse.Content) { if ($webResponse) {
Write-Verbose $webResponse.Content Write-Verbose $webResponse
# API returned a Content: lets work wit it # API returned a Content: lets work wit it
try{ 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" Write-Verbose "[$($MyInvocation.MyCommand.Name)] An error response was received from; resolving"
# This could be handled nicely in an function such as: # This could be handled nicely in an function such as:
# ResolveError $response -WriteError # ResolveError $response -WriteError
Write-Error $($response.messages | Out-String) Write-Error $($webResponse.messages | Out-String)
} }
else { else {
$result = $response #update operations return payload
if (($response) -and ($response | Get-Member -Name payload)) if ($webResponse.payload){
{ $result = $webResponse.payload
$result = $response.payload
} }
elseif (($response) -and ($response | Get-Member -Name rows)) { #Search operations return rows
$result = $response.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 $result
} }
} }
catch { catch {

View file

@ -221,7 +221,6 @@ function Get-SnipeitAsset() {
'Assets with component id' {$apiurl = "$url/api/v1/components/$component_id/assets"} 'Assets with component id' {$apiurl = "$url/api/v1/components/$component_id/assets"}
} }
$Parameters = @{ $Parameters = @{
Uri = $apiurl Uri = $apiurl
Method = 'Get' Method = 'Get'

View file

@ -53,6 +53,9 @@ ID number of the location the accessory is assigned to
.PARAMETER min_amt .PARAMETER min_amt
Min quantity of the accessory before alert is triggered Min quantity of the accessory before alert is triggered
.PARAMETER image
Accessory image fileame and path
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -103,6 +106,9 @@ function New-SnipeitAccessory() {
[ValidateRange(1, [int]::MaxValue)] [ValidateRange(1, [int]::MaxValue)]
[int]$location_id, [int]$location_id,
[ValidateScript({Test-Path $_})]
[string]$image,
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$url, [string]$url,
@ -118,12 +124,10 @@ function New-SnipeitAccessory() {
$values['purchase_date'] = $values['purchase_date'].ToString("yyyy-MM-dd") $values['purchase_date'] = $values['purchase_date'].ToString("yyyy-MM-dd")
} }
$Body = $Values | ConvertTo-Json;
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/accessories" Uri = "$url/api/v1/accessories"
Method = 'POST' Method = 'POST'
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -42,6 +42,9 @@ Optional Purchase cost of the Asset
.PARAMETER rtd_location_id .PARAMETER rtd_location_id
Optional Default location id for the asset Optional Default location id for the asset
.PARAMETER image
Asset image filename and path
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -114,6 +117,9 @@ function New-SnipeitAsset()
[parameter(mandatory = $false)] [parameter(mandatory = $false)]
[int]$rtd_location_id, [int]$rtd_location_id,
[ValidateScript({Test-Path $_})]
[string]$image,
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$url, [string]$url,
@ -137,12 +143,10 @@ function New-SnipeitAsset()
$Values += $customfields $Values += $customfields
} }
$Body = $Values | ConvertTo-Json;
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/hardware" Uri = "$url/api/v1/hardware"
Method = 'Post' Method = 'Post'
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -81,20 +81,19 @@ function New-SnipeitAssetMaintenance() {
$Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
if ($values['start_date']) { if ($Values['start_date']) {
$values['start_date'] = $values['start_date'].ToString("yyyy-MM-dd") $Values['start_date'] = $Values['start_date'].ToString("yyyy-MM-dd")
} }
if ($values['completion_date']) { if ($Values['completion_date']) {
$values['completion_date'] = $values['completion_date'].ToString("yyyy-MM-dd") $Values['completion_date'] = $Values['completion_date'].ToString("yyyy-MM-dd")
} }
$Body = $Values | ConvertTo-Json;
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/maintenances" Uri = "$url/api/v1/maintenances"
Method = 'Post' Method = 'Post'
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -48,12 +48,10 @@ function New-SnipeitAudit()
$Values += @{"asset_tag" = $tag} $Values += @{"asset_tag" = $tag}
} }
$Body = $Values | ConvertTo-Json;
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/hardware/audit" Uri = "$url/api/v1/hardware/audit"
Method = 'Post' Method = 'Post'
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -20,6 +20,9 @@ If switch is present, require users to confirm acceptance of assets in this cate
.PARAMETER checkin_email .PARAMETER checkin_email
If switch is present, send email to user on checkin/checkout If switch is present, send email to user on checkin/checkout
.PARAMETER image
Category image filename and path
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -47,12 +50,15 @@ function New-SnipeitCategory()
[string]$eula_text, [string]$eula_text,
[switch]$use_default_eula, [switch]$use_default_eula,
[switch]$require_acceptance, [switch]$require_acceptance,
[switch]$checkin_email, [switch]$checkin_email,
[ValidateScript({Test-Path $_})]
[string]$image,
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$url, [string]$url,
@ -68,8 +74,6 @@ function New-SnipeitCategory()
} }
$Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
$Body = $Values | ConvertTo-Json;
} }
process { process {
@ -77,7 +81,7 @@ function New-SnipeitCategory()
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/categories" Uri = "$url/api/v1/categories"
Method = 'POST' Method = 'POST'
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -8,6 +8,9 @@ Creates new company on Snipe-It system
.PARAMETER name .PARAMETER name
Comapany name Comapany name
.PARAMETER image
Company image filename and path
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -30,6 +33,9 @@ function New-SnipeitCompany()
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$name, [string]$name,
[ValidateScript({Test-Path $_})]
[string]$image,
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$url, [string]$url,
@ -41,12 +47,10 @@ function New-SnipeitCompany()
$Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
$Body = $Values | ConvertTo-Json;
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/companies" Uri = "$url/api/v1/companies"
Method = 'POST' Method = 'POST'
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -26,6 +26,9 @@ Date accessory was purchased
.PARAMETER purchase_cost .PARAMETER purchase_cost
Cost of item being purchased. Cost of item being purchased.
.PARAMETER image
Component image filename and path
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -65,6 +68,9 @@ function New-SnipeitComponent() {
[float]$purchase_cost, [float]$purchase_cost,
[ValidateScript({Test-Path $_})]
[string]$image,
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$url, [string]$url,
@ -76,16 +82,14 @@ function New-SnipeitComponent() {
$Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters $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") $Values['purchase_date'] = $Values['purchase_date'].ToString("yyyy-MM-dd")
} }
$Body = $Values | ConvertTo-Json;
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/components" Uri = "$url/api/v1/components"
Method = 'POST' Method = 'POST'
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -44,6 +44,9 @@ Model number of the consumable in months
.PARAMETER item_no .PARAMETER item_no
Item number for the consumable Item number for the consumable
.PARAMETER image
Consumable Image filename and path
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -104,6 +107,9 @@ function New-SnipeitConsumable()
[parameter(mandatory = $false)] [parameter(mandatory = $false)]
[string]$item_no, [string]$item_no,
[ValidateScript({Test-Path $_})]
[string]$image,
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$url, [string]$url,
@ -114,18 +120,16 @@ function New-SnipeitConsumable()
begin { begin {
$Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters $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") $Values['purchase_date'] = $Values['purchase_date'].ToString("yyyy-MM-dd")
} }
$Body = $Values | ConvertTo-Json;
} }
process { process {
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/consumables" Uri = "$url/api/v1/consumables"
Method = 'Post' Method = 'Post'
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -83,12 +83,10 @@ function New-SnipeitCustomField()
$Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
$Body = $Values | ConvertTo-Json;
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/fields" Uri = "$url/api/v1/fields"
Method = 'post' Method = 'post'
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }
} }

View file

@ -17,6 +17,9 @@
.PARAMETER manager_id .PARAMETER manager_id
ID number of manager ID number of manager
.PARAMETER image
Department Image filename and path
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -46,6 +49,11 @@ function New-SnipeitDepartment() {
[string]$notes, [string]$notes,
[ValidateScript({Test-Path $_})]
[string]$image,
[switch]$image_delete=$false,
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$url, [string]$url,
@ -57,12 +65,10 @@ function New-SnipeitDepartment() {
$Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
$Body = $Values | ConvertTo-Json;
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/departments" Uri = "$url/api/v1/departments"
Method = 'POST' Method = 'POST'
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -128,24 +128,22 @@ function New-SnipeitLicense() {
$Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
if ($values['expiration_date']) { if ($Values['expiration_date']) {
$values['expiration_date'] = $values['expiration_date'].ToString("yyyy-MM-dd") $Values['expiration_date'] = $Values['expiration_date'].ToString("yyyy-MM-dd")
} }
if ($values['purchase_date']) { if ($Values['purchase_date']) {
$values['purchase_date'] = $values['purchase_date'].ToString("yyyy-MM-dd") $Values['purchase_date'] = $Values['purchase_date'].ToString("yyyy-MM-dd")
} }
if ($values['termination_date']) { if ($Values['termination_date']) {
$values['termination_date'] = $values['termination_date'].ToString("yyyy-MM-dd") $Values['termination_date'] = $Values['termination_date'].ToString("yyyy-MM-dd")
} }
$Body = $Values | ConvertTo-Json;
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/licenses" Uri = "$url/api/v1/licenses"
Method = 'POST' Method = 'POST'
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -38,6 +38,9 @@
.PARAMETER manager_id .PARAMETER manager_id
The manager ID of the location The manager ID of the location
.PARAMETER image
Location Image filename and path
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -78,6 +81,11 @@ function New-SnipeitLocation() {
[string]$ldap_ou, [string]$ldap_ou,
[ValidateScript({Test-Path $_})]
[string]$image,
[switch]$image_delete=$false,
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$url, [string]$url,
@ -89,12 +97,10 @@ function New-SnipeitLocation() {
$Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
$Body = $Values | ConvertTo-Json;
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/locations" Uri = "$url/api/v1/locations"
Method = 'post' Method = 'post'
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -8,6 +8,12 @@
.PARAMETER Name .PARAMETER Name
Name of the Manufacturer Name of the Manufacturer
.PARAMETER image
Manufacturer Image filename and path
.PARAMETER image_delete
Remove current image
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -29,6 +35,11 @@ function New-SnipeitManufacturer()
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$Name, [string]$Name,
[ValidateScript({Test-Path $_})]
[string]$image,
[switch]$image_delete=$false,
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$url, [string]$url,
@ -42,13 +53,10 @@ function New-SnipeitManufacturer()
"name" = $Name "name" = $Name
} }
#Convert Values to JSON format
$Body = $Values | ConvertTo-Json;
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/manufacturers" Uri = "$url/api/v1/manufacturers"
Method = 'post' Method = 'post'
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -20,6 +20,9 @@
.PARAMETER fieldset_id .PARAMETER fieldset_id
Fieldset ID that the asset uses (Custom fields) Fieldset ID that the asset uses (Custom fields)
.PARAMETER image
Asset model Image filename and path
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -54,6 +57,9 @@ function New-SnipeitModel()
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[int]$fieldset_id, [int]$fieldset_id,
[ValidateScript({Test-Path $_})]
[string]$image,
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$url, [string]$url,
@ -73,12 +79,11 @@ function New-SnipeitModel()
if ($PSBoundParameters.ContainsKey('model_number')) { $Values.Add("model_number", $model_number) } if ($PSBoundParameters.ContainsKey('model_number')) { $Values.Add("model_number", $model_number) }
if ($PSBoundParameters.ContainsKey('eol')) { $Values.Add("eol", $eol) } if ($PSBoundParameters.ContainsKey('eol')) { $Values.Add("eol", $eol) }
$Body = $Values | ConvertTo-Json;
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/models" Uri = "$url/api/v1/models"
Method = 'post' Method = 'post'
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -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
}

View file

@ -50,6 +50,9 @@
.PARAMETER ldap_import .PARAMETER ldap_import
Mark user as import from ldap Mark user as import from ldap
.PARAMETER image
User Image file name and path
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -104,6 +107,8 @@ function New-SnipeitUser() {
[bool]$ldap_import = $false, [bool]$ldap_import = $false,
[ValidateScript({Test-Path $_})]
[string]$image,
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$url, [string]$url,
@ -120,12 +125,10 @@ function New-SnipeitUser() {
$Values['password_confirmation'] = $password $Values['password_confirmation'] = $password
} }
$Body = $Values | ConvertTo-Json;
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/users" Uri = "$url/api/v1/users"
Method = 'post' Method = 'post'
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -41,7 +41,6 @@ function Remove-SnipeitAccessory ()
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/accessories/$accessory_id" Uri = "$url/api/v1/accessories/$accessory_id"
Method = 'Delete' Method = 'Delete'
Body = '{}'
Token = $apiKey Token = $apiKey
} }

View file

@ -42,7 +42,6 @@ function Remove-SnipeitAsset ()
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/hardware/$asset_id" Uri = "$url/api/v1/hardware/$asset_id"
Method = 'Delete' Method = 'Delete'
Body = '{}'
Token = $apiKey Token = $apiKey
} }

View file

@ -46,7 +46,6 @@ function Remove-SnipeitAssetMaintenance {
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/maintenances/$maintenance_id" Uri = "$url/api/v1/maintenances/$maintenance_id"
Method = 'Delete' Method = 'Delete'
Body = '{}'
Token = $apiKey Token = $apiKey
} }

View file

@ -41,7 +41,6 @@ function Remove-SnipeitCategory ()
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/categories/$category_id" Uri = "$url/api/v1/categories/$category_id"
Method = 'Delete' Method = 'Delete'
Body = '{}'
Token = $apiKey Token = $apiKey
} }

View file

@ -41,7 +41,6 @@ function Remove-SnipeitCompany ()
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/companies/$company_id" Uri = "$url/api/v1/companies/$company_id"
Method = 'Delete' Method = 'Delete'
Body = '{}'
Token = $apiKey Token = $apiKey
} }

View file

@ -41,7 +41,6 @@ function Remove-SnipeitComponent ()
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/components/$component_id" Uri = "$url/api/v1/components/$component_id"
Method = 'Delete' Method = 'Delete'
Body = '{}'
Token = $apiKey Token = $apiKey
} }

View file

@ -42,7 +42,6 @@ function Remove-SnipeitConsumable ()
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/consumables/$consumable_id" Uri = "$url/api/v1/consumables/$consumable_id"
Method = 'Delete' Method = 'Delete'
Body = '{}'
Token = $apiKey Token = $apiKey
} }

View file

@ -41,7 +41,6 @@ function Remove-SnipeitCustomField ()
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/fields/$field_id" Uri = "$url/api/v1/fields/$field_id"
Method = 'Delete' Method = 'Delete'
Body = '{}'
Token = $apiKey Token = $apiKey
} }

View file

@ -41,7 +41,6 @@ function Remove-SnipeitDepartment ()
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/departments/$department_id" Uri = "$url/api/v1/departments/$department_id"
Method = 'Delete' Method = 'Delete'
Body = '{}'
Token = $apiKey Token = $apiKey
} }

View file

@ -41,7 +41,6 @@ function Remove-SnipeitLicense ()
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/licenses/$license_id" Uri = "$url/api/v1/licenses/$license_id"
Method = 'Delete' Method = 'Delete'
Body = '{}'
Token = $apiKey Token = $apiKey
} }

View file

@ -41,7 +41,6 @@ function Remove-SnipeitLocation ()
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/locations/$asset_id" Uri = "$url/api/v1/locations/$asset_id"
Method = 'Delete' Method = 'Delete'
Body = '{}'
Token = $apiKey Token = $apiKey
} }

View file

@ -39,9 +39,8 @@ function Remove-SnipeitManufacturer ()
process { process {
foreach($manufacturer_id in $id){ foreach($manufacturer_id in $id){
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/manufacturers/$manufacturer_id_id" Uri = "$url/api/v1/manufacturers/$manufacturer_id"
Method = 'Delete' Method = 'Delete'
Body = '{}'
Token = $apiKey Token = $apiKey
} }

View file

@ -41,7 +41,6 @@ function Remove-SnipeitModel ()
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/models/$model_id" Uri = "$url/api/v1/models/$model_id"
Method = 'Delete' Method = 'Delete'
Body = '{}'
Token = $apiKey Token = $apiKey
} }

View file

@ -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
}
}
}

View file

@ -41,7 +41,6 @@ function Remove-SnipeitUser ()
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/users/$user_id" Uri = "$url/api/v1/users/$user_id"
Method = 'Delete' Method = 'Delete'
Body = '{}'
Token = $apiKey Token = $apiKey
} }

View file

@ -46,7 +46,7 @@ function Reset-SnipeitAccessoryOwner()
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/accessories/$assigned_pivot_id/checkin" Uri = "$url/api/v1/accessories/$assigned_pivot_id/checkin"
Method = 'Post' Method = 'Post'
Body = '{}' Body = @{}
Token = $apiKey Token = $apiKey
} }

View file

@ -57,12 +57,10 @@ function Reset-SnipeitAssetOwner() {
if ($PSBoundParameters.ContainsKey('location_id')) { $Values.Add("location_id", $location_id) } if ($PSBoundParameters.ContainsKey('location_id')) { $Values.Add("location_id", $location_id) }
if ($PSBoundParameters.ContainsKey('status_id')) { $Values.Add("status_id", $status_id) } if ($PSBoundParameters.ContainsKey('status_id')) { $Values.Add("status_id", $status_id) }
$Body = $Values | ConvertTo-Json;
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/hardware/$id/checkin" Uri = "$url/api/v1/hardware/$id/checkin"
Method = 'POST' Method = 'POST'
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -38,23 +38,20 @@ Cost of item being purchased.
.PARAMETER purchase_date .PARAMETER purchase_date
Date accessory was purchased 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 .PARAMETER supplier_id
ID number of the supplier for this accessory ID number of the supplier for this accessory
.PARAMETER location_id .PARAMETER location_id
ID number of the location the accessory is assigned to ID number of the location the accessory is assigned to
.PARAMETER min_qty .PARAMETER image
Min quantity of the accessory before alert is triggered 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 .PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfoeItInfo command 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]]$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)] [parameter(mandatory = $true)]
[string]$url, [string]$url,
@ -112,20 +119,18 @@ function Set-SnipeitAccessory() {
$Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters $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") $Values['purchase_date'] = $Values['purchase_date'].ToString("yyyy-MM-dd")
} }
$Body = $Values | ConvertTo-Json;
Write-Verbose "Body: $Body"
} }
process { process {
foreach($accessory_id in $id){ foreach($accessory_id in $id){
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/accessories/$accessory_id" Uri = "$url/api/v1/accessories/$accessory_id"
Method = 'Put' Method = $RequestType
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -46,8 +46,6 @@ function Set-SnipeitAccessoryOwner()
) )
begin{ begin{
$Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
$Body = $Values | ConvertTo-Json;
} }
process { process {
@ -55,7 +53,7 @@ function Set-SnipeitAccessoryOwner()
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/accessories/$accessory_id/checkout" Uri = "$url/api/v1/accessories/$accessory_id/checkout"
Method = 'POST' Method = 'POST'
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -53,8 +53,14 @@
.PARAMETER notes .PARAMETER notes
Notes about asset Notes about asset
.PARAMETER image
Image file name and path for item
.PARAMETER image_delete
Remove current image
.PARAMETER RequestType .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 .PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfoeItInfo command URL of Snipeit system, can be set using Set-SnipeitInfoeItInfo command
@ -122,6 +128,11 @@ function Set-SnipeitAsset()
[ValidateSet("Put","Patch")] [ValidateSet("Put","Patch")]
[string]$RequestType = "Patch", [string]$RequestType = "Patch",
[ValidateScript({Test-Path $_})]
[string]$image,
[switch]$image_delete=$false,
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$url, [string]$url,
@ -136,8 +147,8 @@ function Set-SnipeitAsset()
$Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters $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") $Values['purchase_date'] = $Values['purchase_date'].ToString("yyyy-MM-dd")
} }
if ($customfields) if ($customfields)
@ -145,7 +156,6 @@ function Set-SnipeitAsset()
$Values += $customfields $Values += $customfields
} }
$Body = $Values | ConvertTo-Json;
} }
process { process {
@ -153,7 +163,7 @@ function Set-SnipeitAsset()
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/hardware/$asset_id" Uri = "$url/api/v1/hardware/$asset_id"
Method = $RequestType Method = $RequestType
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -71,11 +71,11 @@ function Set-SnipeitAssetOwner()
$Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
if ($Values['expected_checkin']) { 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']) { 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) switch ($checkout_to_type)
@ -88,8 +88,6 @@ function Set-SnipeitAssetOwner()
#This can be removed now #This can be removed now
if($Values.ContainsKey('assigned_id')){$Values.Remove('assigned_id')} if($Values.ContainsKey('assigned_id')){$Values.Remove('assigned_id')}
$Body = $Values | ConvertTo-Json;
} }
process{ process{
@ -97,7 +95,7 @@ function Set-SnipeitAssetOwner()
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/hardware/$asset_id/checkout" Uri = "$url/api/v1/hardware/$asset_id/checkout"
Method = 'POST' Method = 'POST'
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -8,12 +8,6 @@ Name of new category to be created
.PARAMETER type .PARAMETER type
Type of new category to be created (asset, accessory, consumable, component, license) 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 .PARAMETER use_default_eula
If switch is present, use the primary 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 .PARAMETER checkin_email
Should the user be emailed the EULA and/or an acceptance confirmation email when this item is checked in? 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 .EXAMPLE
Set-SnipeitCategory -id 4 -name "Laptops" Set-SnipeitCategory -id 4 -name "Laptops"
#> #>
@ -54,6 +63,14 @@ function Set-SnipeitCategory()
[bool]$checkin_email, [bool]$checkin_email,
[ValidateScript({Test-Path $_})]
[string]$image,
[switch]$image_delete=$false,
[ValidateSet("Put","Patch")]
[string]$RequestType = "Patch",
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$url, [string]$url,
@ -66,16 +83,14 @@ function Set-SnipeitCategory()
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name 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
$Body = $Values | ConvertTo-Json;
} }
process { process {
foreach($category_id in $id){ foreach($category_id in $id){
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/categories/$category_id" Uri = "$url/api/v1/categories/$category_id"
Method = 'Put' Method = $RequestType
Body = $Body Body = $values
Token = $apiKey Token = $apiKey
} }

View file

@ -11,6 +11,15 @@ ID number of company
.PARAMETER name .PARAMETER name
Company 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 .PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -37,6 +46,14 @@ function Set-SnipeitCompany()
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$name, [string]$name,
[ValidateScript({Test-Path $_})]
[string]$image,
[switch]$image_delete=$false,
[ValidateSet("Put","Patch")]
[string]$RequestType = "Patch",
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$url, [string]$url,
@ -45,17 +62,15 @@ function Set-SnipeitCompany()
) )
begin{ begin{
$values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
$Body = $values | ConvertTo-Json;
} }
process{ process{
foreach($company_id in $id){ foreach($company_id in $id){
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/companies/$company_id" Uri = "$url/api/v1/companies/$company_id"
Method = 'Patch' Method = $RequestType
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -32,6 +32,15 @@ Date accessory was purchased
.PARAMETER purchase_cost .PARAMETER purchase_cost
Cost of item being purchased. 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 .PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -73,6 +82,14 @@ function Set-SnipeitComponent()
[float]$purchase_cost, [float]$purchase_cost,
[ValidateScript({Test-Path $_})]
[string]$image,
[switch]$image_delete=$false,
[ValidateSet("Put","Patch")]
[string]$RequestType = "Patch",
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$url, [string]$url,
@ -82,21 +99,19 @@ function Set-SnipeitComponent()
begin { begin {
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name 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']) { if ($Values['purchase_date']) {
$values['purchase_date'] = $values['purchase_date'].ToString("yyyy-MM-dd") $Values['purchase_date'] = $Values['purchase_date'].ToString("yyyy-MM-dd")
} }
$Body = $values | ConvertTo-Json;
} }
process { process {
foreach($component_id in $id){ foreach($component_id in $id){
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/components/$component_id" Uri = "$url/api/v1/components/$component_id"
Method = 'Patch' Method = $RequestType
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -47,6 +47,15 @@ Model number of the consumable in months
.PARAMETER item_no .PARAMETER item_no
Item number for the consumable 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 .PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -112,6 +121,14 @@ function Set-SnipeitConsumable()
[parameter(mandatory = $false)] [parameter(mandatory = $false)]
[string]$item_no, [string]$item_no,
[ValidateScript({Test-Path $_})]
[string]$image,
[switch]$image_delete=$false,
[ValidateSet("Put","Patch")]
[string]$RequestType = "Patch",
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$url, [string]$url,
@ -126,15 +143,14 @@ function Set-SnipeitConsumable()
$Values['purchase_date'] = $Values['purchase_date'].ToString("yyyy-MM-dd") $Values['purchase_date'] = $Values['purchase_date'].ToString("yyyy-MM-dd")
} }
$Body = $Values | ConvertTo-Json;
} }
process { process {
foreach($consumable_id in $id ){ foreach($consumable_id in $id ){
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/consumables/$consumable_id" Uri = "$url/api/v1/consumables/$consumable_id"
Method = 'Put' Method = $RequestType
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -29,6 +29,9 @@
.PARAMETER help_text .PARAMETER help_text
Any additional text you wish to display under the new form field to make it clearer what the gauges should be. 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 .PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -69,6 +72,9 @@ function Set-SnipeitCustomField()
[string]$custom_format, [string]$custom_format,
[ValidateSet("Put","Patch")]
[string]$RequestType = "Put",
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$url, [string]$url,
@ -82,17 +88,14 @@ function Set-SnipeitCustomField()
} }
$Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
$Body = $Values | ConvertTo-Json;
} }
process{ process{
foreach($field_id in $id) { foreach($field_id in $id) {
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/fields/$field_id" Uri = "$url/api/v1/fields/$field_id"
Method = 'Put' Method = $RequestType
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -20,6 +20,15 @@
.PARAMETER manager_id .PARAMETER manager_id
ID number of manager 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 .PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -51,6 +60,14 @@ function Set-SnipeitDepartment() {
[string]$notes, [string]$notes,
[ValidateScript({Test-Path $_})]
[string]$image,
[switch]$image_delete=$false,
[ValidateSet("Put","Patch")]
[string]$RequestType = "Patch",
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$url, [string]$url,
@ -61,16 +78,14 @@ function Set-SnipeitDepartment() {
begin { begin {
$Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
$Body = $Values | ConvertTo-Json;
} }
process { process {
foreach ($department_id in $id) { foreach ($department_id in $id) {
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/departments/$department_id" Uri = "$url/api/v1/departments/$department_id"
Method = 'Put' Method = $RequestType
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -59,6 +59,9 @@
.PARAMETER termination_date .PARAMETER termination_date
Termination date for license. 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 .PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -121,6 +124,9 @@ function Set-SnipeitLicense() {
[datetime]$termination_date, [datetime]$termination_date,
[ValidateSet("Put","Patch")]
[string]$RequestType = "Patch",
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$url, [string]$url,
@ -133,27 +139,26 @@ function Set-SnipeitLicense() {
$Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
if ($values['expiration_date']) { if ($Values['expiration_date']) {
$values['expiration_date'] = $values['expiration_date'].ToString("yyyy-MM-dd") $Values['expiration_date'] = $Values['expiration_date'].ToString("yyyy-MM-dd")
} }
if ($values['purchase_date']) { if ($Values['purchase_date']) {
$values['purchase_date'] = $values['purchase_date'].ToString("yyyy-MM-dd") $Values['purchase_date'] = $Values['purchase_date'].ToString("yyyy-MM-dd")
} }
if ($values['termination_date']) { if ($Values['termination_date']) {
$values['termination_date'] = $values['termination_date'].ToString("yyyy-MM-dd") $Values['termination_date'] = $Values['termination_date'].ToString("yyyy-MM-dd")
} }
$Body = $Values | ConvertTo-Json;
} }
process { process {
foreach($license_id in $id){ foreach($license_id in $id){
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/licenses/$license_id" Uri = "$url/api/v1/licenses/$license_id"
Method = 'PUT' Method = $RequestType
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -16,6 +16,9 @@
.PARAMETER note .PARAMETER note
Notes about checkout Notes about checkout
.PARAMETER RequestType
Http request type to send Snipe IT system. Defaults to Patch you could use Put if needed.
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -50,12 +53,17 @@ function Set-SnipeitLicenseSeat()
[int]$seat_id, [int]$seat_id,
[Alias('assigned_id')] [Alias('assigned_id')]
[Nullable[System.Int32]]$assigned_to, [Nullable[System.Int32]]$assigned_to,
[Nullable[System.Int32]]$asset_id, [Nullable[System.Int32]]$asset_id,
[string]$note, [string]$note,
[ValidateSet("Put","Patch")]
[string]$RequestType = "Patch",
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$url, [string]$url,
@ -65,16 +73,14 @@ function Set-SnipeitLicenseSeat()
begin{ begin{
$Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
$Body = $Values | ConvertTo-Json;
} }
process{ process{
foreach($license_id in $id) { foreach($license_id in $id) {
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/licenses/$license_id/seats/$seat_id" Uri = "$url/api/v1/licenses/$license_id/seats/$seat_id"
Method = 'Patch' Method = $RequestType
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -44,6 +44,15 @@
.PARAMETER parent_id .PARAMETER parent_id
Parent location as 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 .PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -88,6 +97,14 @@ function Set-SnipeitLocation() {
[Nullable[System.Int32]]$parent_id, [Nullable[System.Int32]]$parent_id,
[ValidateScript({Test-Path $_})]
[string]$image,
[switch]$image_delete=$false,
[ValidateSet("Put","Patch")]
[string]$RequestType = "Patch",
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$url, [string]$url,
@ -99,16 +116,14 @@ function Set-SnipeitLocation() {
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name 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
$Body = $Values | ConvertTo-Json;
} }
process{ process{
foreach ($location_id in $id) { foreach ($location_id in $id) {
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/locations/$location_id" Uri = "$url/api/v1/locations/$location_id"
Method = 'PUT' Method = $RequestType
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -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
}
}
}

View file

@ -23,6 +23,15 @@
.PARAMETER fieldset_id .PARAMETER fieldset_id
Fieldset ID that the asset uses (Custom fields) 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 .PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -57,6 +66,14 @@ function Set-SnipeitModel() {
[Alias("fieldset_id")] [Alias("fieldset_id")]
[Nullable[System.Int32]]$custom_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)] [parameter(mandatory = $true)]
[string]$url, [string]$url,
@ -69,14 +86,13 @@ function Set-SnipeitModel() {
$Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
$Body = $Values | ConvertTo-Json;
} }
process { process {
foreach ($model_id in $id) { foreach ($model_id in $id) {
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/models/$model_id" Uri = "$url/api/v1/models/$model_id"
Method = 'put' Method = $RequestType
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -15,6 +15,9 @@ Hex code showing what color the status label should be on the pie chart in the d
.PARAMETER default_label .PARAMETER default_label
1 or 0 - determine whether it should be bubbled up to the top of the list of available statuses 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 .PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -53,6 +56,9 @@ function Set-SnipeitStatus()
[bool]$default_label, [bool]$default_label,
[ValidateSet("Put","Patch")]
[string]$RequestType = "Patch",
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$url, [string]$url,
@ -62,15 +68,14 @@ function Set-SnipeitStatus()
begin { begin {
$Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
$Body = $Values | ConvertTo-Json
} }
process { process {
foreach($status_id in $id) { foreach($status_id in $id) {
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/statuslabels/$status_id" Uri = "$url/api/v1/statuslabels/$status_id"
Method = 'Put' Method = $RequestType
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -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
}
}
}

View file

@ -53,6 +53,15 @@
.PARAMETER ldap_import .PARAMETER ldap_import
Mark user as import from ldap 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 .PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -107,6 +116,14 @@ function Set-SnipeitUser() {
[string]$notes, [string]$notes,
[ValidateScript({Test-Path $_})]
[string]$image,
[switch]$image_delete=$false,
[ValidateSet("Put","Patch")]
[string]$RequestType = "Patch",
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$url, [string]$url,
@ -122,7 +139,6 @@ function Set-SnipeitUser() {
$Values['password_confirmation'] = $password $Values['password_confirmation'] = $password
} }
$Body = $Values | ConvertTo-Json;
} }
process{ process{
@ -130,7 +146,7 @@ function Set-SnipeitUser() {
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/users/$user_id" Uri = "$url/api/v1/users/$user_id"
Method = 'PATCH' Method = 'PATCH'
Body = $Body Body = $Values
Token = $apiKey Token = $apiKey
} }

View file

@ -12,7 +12,7 @@
RootModule = 'SnipeitPS' RootModule = 'SnipeitPS'
# Version number of this module. # Version number of this module.
ModuleVersion = '1.8' ModuleVersion = '1.9'
# Supported PSEditions # Supported PSEditions
# CompatiblePSEditions = @() # CompatiblePSEditions = @()
@ -104,6 +104,7 @@ FunctionsToExport = @(
'New-SnipeitLocation', 'New-SnipeitLocation',
'New-SnipeitManufacturer', 'New-SnipeitManufacturer',
'New-SnipeitModel', 'New-SnipeitModel',
'New-SnipeitSupplier',
'New-SnipeitUser', 'New-SnipeitUser',
'Remove-SnipeitAccessory', 'Remove-SnipeitAccessory',
'Remove-SnipeitAsset', 'Remove-SnipeitAsset',
@ -118,6 +119,7 @@ FunctionsToExport = @(
'Remove-SnipeitLocation', 'Remove-SnipeitLocation',
'Remove-SnipeitManufacturer', 'Remove-SnipeitManufacturer',
'Remove-SnipeitModel', 'Remove-SnipeitModel',
'Remove-SnipeitSupplier',
'Remove-SnipeitUser', 'Remove-SnipeitUser',
'Reset-SnipeitAccessoryOwner', 'Reset-SnipeitAccessoryOwner',
'Reset-SnipeitAssetOwner', 'Reset-SnipeitAssetOwner',
@ -135,8 +137,10 @@ FunctionsToExport = @(
'Set-SnipeitLicense', 'Set-SnipeitLicense',
'Set-SnipeitLicenseSeat', 'Set-SnipeitLicenseSeat',
'Set-SnipeitLocation', 'Set-SnipeitLocation',
'Set-SnipeitManufacturer',
'Set-SnipeitModel', 'Set-SnipeitModel',
'Set-SnipeitStatus', 'Set-SnipeitStatus',
'Set-SnipeitSupplier',
'Set-SnipeitUser', 'Set-SnipeitUser',
'Update-SnipeitAlias' 'Update-SnipeitAlias'
) )

View file

@ -17,7 +17,7 @@ environment:
secure: UdM6qhf5B0G8liHhUrwWERCZr44iSqmg4jUq0lwlTjZs4KyeoiwnBzdej0phqIAm secure: UdM6qhf5B0G8liHhUrwWERCZr44iSqmg4jUq0lwlTjZs4KyeoiwnBzdej0phqIAm
PShell: '5' PShell: '5'
version: 1.8.{build} version: 1.9.{build}
# Don't rebuild when I tag a release on GitHub # Don't rebuild when I tag a release on GitHub
skip_tags: true skip_tags: true

View file

@ -16,7 +16,7 @@ Creates new accessory on Snipe-It system
New-SnipeitAccessory [-name] <String> [-qty] <Int32> [-category_id] <Int32> [[-company_id] <Int32>] New-SnipeitAccessory [-name] <String> [-qty] <Int32> [-category_id] <Int32> [[-company_id] <Int32>]
[[-manufacturer_id] <Int32>] [[-order_number] <String>] [[-model_number] <String>] [[-purchase_cost] <Single>] [[-manufacturer_id] <Int32>] [[-order_number] <String>] [[-model_number] <String>] [[-purchase_cost] <Single>]
[[-purchase_date] <DateTime>] [[-min_amt] <Int32>] [[-supplier_id] <Int32>] [[-location_id] <Int32>] [[-purchase_date] <DateTime>] [[-min_amt] <Int32>] [[-supplier_id] <Int32>] [[-location_id] <Int32>]
[-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>] [[-image] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -40,7 +40,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 14 Position: 15
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -76,6 +76,21 @@ Accept pipeline input: False
Accept wildcard characters: 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 ### -location_id
ID number of the location the accessory is assigned to ID number of the location the accessory is assigned to
@ -235,7 +250,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 13 Position: 14
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False

View file

@ -16,7 +16,7 @@ Add a new Asset to Snipe-it asset system
New-SnipeitAsset [-status_id] <Int32> [-model_id] <Int32> [[-name] <String>] [[-asset_tag] <String>] New-SnipeitAsset [-status_id] <Int32> [-model_id] <Int32> [[-name] <String>] [[-asset_tag] <String>]
[[-serial] <String>] [[-company_id] <Int32>] [[-order_number] <String>] [[-notes] <String>] [[-serial] <String>] [[-company_id] <Int32>] [[-order_number] <String>] [[-notes] <String>]
[[-warranty_months] <Int32>] [[-purchase_cost] <String>] [[-purchase_date] <DateTime>] [[-warranty_months] <Int32>] [[-purchase_cost] <String>] [[-purchase_date] <DateTime>]
[[-supplier_id] <Int32>] [[-rtd_location_id] <Int32>] [-url] <String> [-apiKey] <String> [[-supplier_id] <Int32>] [[-rtd_location_id] <Int32>] [[-image] <String>] [-url] <String> [-apiKey] <String>
[[-customfields] <Hashtable>] [-WhatIf] [-Confirm] [<CommonParameters>] [[-customfields] <Hashtable>] [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
@ -54,7 +54,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 15 Position: 16
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -100,7 +100,22 @@ Parameter Sets: (All)
Aliases: CustomValues Aliases: CustomValues
Required: False 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 Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -265,7 +280,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 14 Position: 15
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False

View file

@ -14,8 +14,8 @@ Create a new Snipe-IT Category
``` ```
New-SnipeitCategory [-name] <String> [-category_type] <String> [[-eula_text] <String>] [-use_default_eula] New-SnipeitCategory [-name] <String> [-category_type] <String> [[-eula_text] <String>] [-use_default_eula]
[-require_acceptance] [-checkin_email] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [-require_acceptance] [-checkin_email] [[-image] <String>] [-url] <String> [-apiKey] <String> [-WhatIf]
[<CommonParameters>] [-Confirm] [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -39,7 +39,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 5 Position: 6
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -90,6 +90,21 @@ Accept pipeline input: False
Accept wildcard characters: 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
Name of new category to be created Name of new category to be created
@ -129,7 +144,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 4 Position: 5
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False

View file

@ -13,7 +13,7 @@ Creates a new Company
## SYNTAX ## SYNTAX
``` ```
New-SnipeitCompany [-name] <String> [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] New-SnipeitCompany [-name] <String> [[-image] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm]
[<CommonParameters>] [<CommonParameters>]
``` ```
@ -38,7 +38,22 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True 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 Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -68,7 +83,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 2 Position: 3
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False

View file

@ -15,7 +15,7 @@ Create a new component
``` ```
New-SnipeitComponent [-name] <String> [-category_id] <Int32> [-qty] <String> [[-company_id] <Int32>] New-SnipeitComponent [-name] <String> [-category_id] <Int32> [-qty] <String> [[-company_id] <Int32>]
[[-location_id] <Int32>] [[-order_number] <String>] [[-purchase_date] <DateTime>] [[-purchase_cost] <Single>] [[-location_id] <Int32>] [[-order_number] <String>] [[-purchase_date] <DateTime>] [[-purchase_cost] <Single>]
[-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>] [[-image] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -39,7 +39,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 10 Position: 11
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -75,6 +75,21 @@ Accept pipeline input: False
Accept wildcard characters: 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 ### -location_id
ID number of the location the accessory is assigned to ID number of the location the accessory is assigned to
@ -174,7 +189,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 9 Position: 10
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False

View file

@ -16,8 +16,8 @@ Add a new Consumable to Snipe-it asset system
New-SnipeitConsumable [-name] <String> [-qty] <Int32> [-category_id] <Int32> [[-min_amt] <Int32>] New-SnipeitConsumable [-name] <String> [-qty] <Int32> [-category_id] <Int32> [[-min_amt] <Int32>]
[[-company_id] <Int32>] [[-order_number] <String>] [[-manufacturer_id] <Int32>] [[-location_id] <Int32>] [[-company_id] <Int32>] [[-order_number] <String>] [[-manufacturer_id] <Int32>] [[-location_id] <Int32>]
[[-requestable] <Boolean>] [[-purchase_date] <DateTime>] [[-purchase_cost] <String>] [[-requestable] <Boolean>] [[-purchase_date] <DateTime>] [[-purchase_cost] <String>]
[[-model_number] <String>] [[-item_no] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [[-model_number] <String>] [[-item_no] <String>] [[-image] <String>] [-url] <String> [-apiKey] <String>
[<CommonParameters>] [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -42,7 +42,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 15 Position: 16
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -78,6 +78,21 @@ Accept pipeline input: False
Accept wildcard characters: 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_no
Item number for the consumable Item number for the consumable
@ -252,7 +267,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 14 Position: 15
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False

View file

@ -14,7 +14,8 @@ Creates a department
``` ```
New-SnipeitDepartment [-name] <String> [[-company_id] <Int32>] [[-location_id] <Int32>] [[-manager_id] <Int32>] New-SnipeitDepartment [-name] <String> [[-company_id] <Int32>] [[-location_id] <Int32>] [[-manager_id] <Int32>]
[[-notes] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>] [[-notes] <String>] [[-image] <String>] [-image_delete] [-url] <String> [-apiKey] <String> [-WhatIf]
[-Confirm] [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -38,7 +39,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 7 Position: 8
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -59,6 +60,36 @@ Accept pipeline input: False
Accept wildcard characters: 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 ### -location_id
ID number of location ID number of location
@ -128,7 +159,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 6 Position: 7
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False

View file

@ -15,8 +15,8 @@ Add a new Location to Snipe-it asset system
``` ```
New-SnipeitLocation [-name] <String> [[-address] <String>] [[-address2] <String>] [[-city] <String>] New-SnipeitLocation [-name] <String> [[-address] <String>] [[-address2] <String>] [[-city] <String>]
[[-state] <String>] [[-country] <String>] [[-zip] <String>] [[-currency] <String>] [[-parent_id] <Int32>] [[-state] <String>] [[-country] <String>] [[-zip] <String>] [[-currency] <String>] [[-parent_id] <Int32>]
[[-manager_id] <Int32>] [[-ldap_ou] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [[-manager_id] <Int32>] [[-ldap_ou] <String>] [[-image] <String>] [-image_delete] [-url] <String>
[<CommonParameters>] [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -70,7 +70,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 13 Position: 14
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -121,6 +121,36 @@ Accept pipeline input: False
Accept wildcard characters: 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 ### -ldap_ou
The LDAP OU of the location The LDAP OU of the location
@ -205,7 +235,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 12 Position: 13
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False

View file

@ -13,8 +13,8 @@ Add a new Manufacturer to Snipe-it asset system
## SYNTAX ## SYNTAX
``` ```
New-SnipeitManufacturer [-Name] <String> [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] New-SnipeitManufacturer [-Name] <String> [[-image] <String>] [-image_delete] [-url] <String> [-apiKey] <String>
[<CommonParameters>] [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -38,12 +38,42 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 3 Position: 4
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: 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
Name of the Manufacturer Name of the Manufacturer
@ -68,7 +98,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 2 Position: 3
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False

View file

@ -14,8 +14,8 @@ Add a new Model to Snipe-it asset system
``` ```
New-SnipeitModel [-name] <String> [[-model_number] <String>] [-category_id] <Int32> [-manufacturer_id] <Int32> New-SnipeitModel [-name] <String> [[-model_number] <String>] [-category_id] <Int32> [-manufacturer_id] <Int32>
[[-eol] <Int32>] [-fieldset_id] <Int32> [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [[-eol] <Int32>] [-fieldset_id] <Int32> [[-image] <String>] [-url] <String> [-apiKey] <String> [-WhatIf]
[<CommonParameters>] [-Confirm] [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -39,7 +39,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 8 Position: 9
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -90,6 +90,21 @@ Accept pipeline input: False
Accept wildcard characters: 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
Manufacturer ID that the asset belongs to this can be got using Get-Manufacturer Manufacturer ID that the asset belongs to this can be got using Get-Manufacturer
@ -144,7 +159,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 7 Position: 8
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False

299
docs/New-SnipeitSupplier.md Normal file
View file

@ -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] <String> [[-address] <String>] [[-address2] <String>] [[-city] <String>]
[[-state] <String>] [[-country] <String>] [[-zip] <String>] [[-phone] <String>] [[-fax] <String>]
[[-email] <String>] [[-contact] <String>] [[-notes] <String>] [[-image] <String>] [-url] <String>
[-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
```
## 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

View file

@ -16,8 +16,8 @@ Creates a new user
New-SnipeitUser [-first_name] <String> [-last_name] <String> [-username] <String> [[-password] <String>] New-SnipeitUser [-first_name] <String> [-last_name] <String> [-username] <String> [[-password] <String>]
[[-activated] <Boolean>] [[-notes] <String>] [[-jobtitle] <String>] [[-email] <String>] [[-phone] <String>] [[-activated] <Boolean>] [[-notes] <String>] [[-jobtitle] <String>] [[-email] <String>] [[-phone] <String>]
[[-company_id] <Int32>] [[-location_id] <Int32>] [[-department_id] <Int32>] [[-manager_id] <Int32>] [[-company_id] <Int32>] [[-location_id] <Int32>] [[-department_id] <Int32>] [[-manager_id] <Int32>]
[[-employee_num] <String>] [[-ldap_import] <Boolean>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [[-employee_num] <String>] [[-ldap_import] <Boolean>] [[-image] <String>] [-url] <String> [-apiKey] <String>
[<CommonParameters>] [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -57,7 +57,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 17 Position: 18
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -138,6 +138,21 @@ Accept pipeline input: False
Accept wildcard characters: 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 ### -jobtitle
Users job tittle Users job tittle
@ -267,7 +282,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 16 Position: 17
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False

View file

@ -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] <Int32[]> [-URL] <String> [-APIKey] <String> [-WhatIf] [-Confirm]
[<CommonParameters>]
```
## 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

View file

@ -16,7 +16,8 @@ Updates accessory on Snipe-It system
Set-SnipeitAccessory [-id] <Int32[]> [[-name] <String>] [[-qty] <Int32>] [[-category_id] <Int32>] Set-SnipeitAccessory [-id] <Int32[]> [[-name] <String>] [[-qty] <Int32>] [[-category_id] <Int32>]
[[-company_id] <Int32>] [[-manufacturer_id] <Int32>] [[-model_number] <String>] [[-order_number] <String>] [[-company_id] <Int32>] [[-manufacturer_id] <Int32>] [[-model_number] <String>] [[-order_number] <String>]
[[-purchase_cost] <Single>] [[-purchase_date] <DateTime>] [[-min_amt] <Int32>] [[-supplier_id] <Int32>] [[-purchase_cost] <Single>] [[-purchase_date] <DateTime>] [[-min_amt] <Int32>] [[-supplier_id] <Int32>]
[-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>] [[-location_id] <Int32>] [[-image] <String>] [-image_delete] [[-RequestType] <String>] [-url] <String>
[-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -40,7 +41,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 14 Position: 17
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -91,6 +92,51 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False 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 ### -manufacturer_id
ID number of the manufacturer for this accessory. ID number of the manufacturer for this accessory.
@ -211,6 +257,22 @@ Accept pipeline input: False
Accept wildcard characters: 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 ### -supplier_id
ID number of the supplier for this accessory ID number of the supplier for this accessory
@ -235,7 +297,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 13 Position: 16
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False

View file

@ -17,8 +17,8 @@ Set-SnipeitAsset [-id] <Int32[]> [[-name] <String>] [[-status_id] <Int32>] [[-mo
[[-last_checkout] <DateTime>] [[-assigned_to] <Int32>] [[-company_id] <Int32>] [[-serial] <String>] [[-last_checkout] <DateTime>] [[-assigned_to] <Int32>] [[-company_id] <Int32>] [[-serial] <String>]
[[-order_number] <String>] [[-warranty_months] <Int32>] [[-purchase_cost] <Double>] [[-order_number] <String>] [[-warranty_months] <Int32>] [[-purchase_cost] <Double>]
[[-purchase_date] <DateTime>] [[-requestable] <Boolean>] [[-archived] <Boolean>] [[-rtd_location_id] <Int32>] [[-purchase_date] <DateTime>] [[-requestable] <Boolean>] [[-archived] <Boolean>] [[-rtd_location_id] <Int32>]
[[-notes] <String>] [[-RequestType] <String>] [-url] <String> [-apiKey] <String> [[-customfields] <Hashtable>] [[-notes] <String>] [[-RequestType] <String>] [[-image] <String>] [-image_delete] [-url] <String>
[-WhatIf] [-Confirm] [<CommonParameters>] [-apiKey] <String> [[-customfields] <Hashtable>] [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -52,7 +52,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 19 Position: 20
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -113,7 +113,7 @@ Parameter Sets: (All)
Aliases: CustomValues Aliases: CustomValues
Required: False Required: False
Position: 20 Position: 21
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -134,6 +134,36 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False 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 ### -last_checkout
Date the asset was last checked out Date the asset was last checked out
@ -256,7 +286,7 @@ Accept wildcard characters: False
### -RequestType ### -RequestType
Http request type to send Snipe IT system. 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 ```yaml
Type: String Type: String
@ -324,7 +354,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 18 Position: 19
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False

View file

@ -14,8 +14,9 @@ Create a new Snipe-IT Category
``` ```
Set-SnipeitCategory [-id] <Int32[]> [[-name] <String>] [[-category_type] <String>] [[-eula_text] <String>] Set-SnipeitCategory [-id] <Int32[]> [[-name] <String>] [[-category_type] <String>] [[-eula_text] <String>]
[[-use_default_eula] <Boolean>] [[-require_acceptance] <Boolean>] [[-checkin_email] <Boolean>] [-url] <String> [[-use_default_eula] <Boolean>] [[-require_acceptance] <Boolean>] [[-checkin_email] <Boolean>]
[-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>] [[-image] <String>] [-image_delete] [[-RequestType] <String>] [-url] <String> [-apiKey] <String> [-WhatIf]
[-Confirm] [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -39,7 +40,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 9 Position: 11
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -105,6 +106,36 @@ Accept pipeline input: False
Accept wildcard characters: 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
Name of new category to be created Name of new category to be created
@ -120,6 +151,22 @@ Accept pipeline input: False
Accept wildcard characters: 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 ### -require_acceptance
If switch is present, require users to confirm acceptance of assets in this category If switch is present, require users to confirm acceptance of assets in this category
@ -144,7 +191,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 8 Position: 10
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False

View file

@ -13,8 +13,8 @@ Updates company name
## SYNTAX ## SYNTAX
``` ```
Set-SnipeitCompany [-id] <Int32[]> [-name] <String> [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] Set-SnipeitCompany [-id] <Int32[]> [-name] <String> [[-image] <String>] [-image_delete]
[<CommonParameters>] [[-RequestType] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -38,7 +38,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 4 Position: 6
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -59,6 +59,36 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False 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 ### -name
Company name Company name
@ -74,6 +104,22 @@ Accept pipeline input: False
Accept wildcard characters: 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
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -83,7 +129,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 3 Position: 5
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False

View file

@ -15,7 +15,8 @@ Updates component
``` ```
Set-SnipeitComponent [-id] <Int32[]> [-qty] <Int32> [[-min_amt] <Int32>] [[-name] <String>] Set-SnipeitComponent [-id] <Int32[]> [-qty] <Int32> [[-min_amt] <Int32>] [[-name] <String>]
[[-company_id] <Int32>] [[-location_id] <Int32>] [[-order_number] <String>] [[-purchase_date] <DateTime>] [[-company_id] <Int32>] [[-location_id] <Int32>] [[-order_number] <String>] [[-purchase_date] <DateTime>]
[[-purchase_cost] <Single>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>] [[-purchase_cost] <Single>] [[-image] <String>] [-image_delete] [[-RequestType] <String>] [-url] <String>
[-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -39,7 +40,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 11 Position: 13
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -75,6 +76,36 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False 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 ### -location_id
ID number of the location the accessory is assigned to ID number of the location the accessory is assigned to
@ -180,6 +211,22 @@ Accept pipeline input: False
Accept wildcard characters: 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
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -189,7 +236,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 10 Position: 12
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False

View file

@ -16,8 +16,8 @@ Add a new Consumable to Snipe-it asset system
Set-SnipeitConsumable [-id] <Int32[]> [[-name] <String>] [[-qty] <Int32>] [[-category_id] <Int32>] Set-SnipeitConsumable [-id] <Int32[]> [[-name] <String>] [[-qty] <Int32>] [[-category_id] <Int32>]
[[-min_amt] <Int32>] [[-company_id] <Int32>] [[-order_number] <String>] [[-manufacturer_id] <Int32>] [[-min_amt] <Int32>] [[-company_id] <Int32>] [[-order_number] <String>] [[-manufacturer_id] <Int32>]
[[-location_id] <Int32>] [[-requestable] <Boolean>] [[-purchase_date] <DateTime>] [[-purchase_cost] <String>] [[-location_id] <Int32>] [[-requestable] <Boolean>] [[-purchase_date] <DateTime>] [[-purchase_cost] <String>]
[[-model_number] <String>] [[-item_no] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [[-model_number] <String>] [[-item_no] <String>] [[-image] <String>] [-image_delete] [[-RequestType] <String>]
[<CommonParameters>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -42,7 +42,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 16 Position: 18
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -93,6 +93,36 @@ Accept pipeline input: False
Accept wildcard characters: 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_no
Item number for the consumable Item number for the consumable
@ -258,6 +288,22 @@ Accept pipeline input: False
Accept wildcard characters: 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
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -267,7 +313,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 15 Position: 17
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False

View file

@ -15,7 +15,8 @@ Add a new Custom Field to Snipe-it asset system
``` ```
Set-SnipeitCustomField [-id] <Int32[]> [[-name] <String>] [[-help_text] <String>] [-element] <String> Set-SnipeitCustomField [-id] <Int32[]> [[-name] <String>] [[-help_text] <String>] [-element] <String>
[[-format] <String>] [[-field_values] <String>] [[-field_encrypted] <Boolean>] [[-show_in_email] <Boolean>] [[-format] <String>] [[-field_values] <String>] [[-field_encrypted] <Boolean>] [[-show_in_email] <Boolean>]
[[-custom_format] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>] [[-custom_format] <String>] [[-RequestType] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm]
[<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -39,7 +40,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 11 Position: 12
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -166,6 +167,22 @@ Accept pipeline input: False
Accept wildcard characters: 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 ### -show_in_email
Whether or not to show the custom field in email notifications Whether or not to show the custom field in email notifications
@ -190,7 +207,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 10 Position: 11
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False

View file

@ -14,8 +14,8 @@ Updates a department
``` ```
Set-SnipeitDepartment [-id] <Int32[]> [[-name] <String>] [[-company_id] <Int32>] [[-location_id] <Int32>] Set-SnipeitDepartment [-id] <Int32[]> [[-name] <String>] [[-company_id] <Int32>] [[-location_id] <Int32>]
[[-manager_id] <Int32>] [[-notes] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [[-manager_id] <Int32>] [[-notes] <String>] [[-image] <String>] [-image_delete] [[-RequestType] <String>]
[<CommonParameters>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -39,7 +39,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 8 Position: 10
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -75,6 +75,36 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False 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 ### -location_id
ID number of location ID number of location
@ -135,6 +165,22 @@ Accept pipeline input: False
Accept wildcard characters: 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
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -144,7 +190,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 7 Position: 9
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False

View file

@ -18,7 +18,7 @@ Set-SnipeitLicense [-id] <Int32[]> [[-name] <String>] [[-seats] <Int32>] [[-cate
[[-license_name] <String>] [[-maintained] <Boolean>] [[-manufacturer_id] <Int32>] [[-notes] <String>] [[-license_name] <String>] [[-maintained] <Boolean>] [[-manufacturer_id] <Int32>] [[-notes] <String>]
[[-order_number] <String>] [[-purchase_cost] <Single>] [[-purchase_date] <DateTime>] [[-order_number] <String>] [[-purchase_cost] <Single>] [[-purchase_date] <DateTime>]
[[-reassignable] <Boolean>] [[-serial] <String>] [[-supplier_id] <Int32>] [[-termination_date] <DateTime>] [[-reassignable] <Boolean>] [[-serial] <String>] [[-supplier_id] <Int32>] [[-termination_date] <DateTime>]
[-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>] [[-RequestType] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -42,7 +42,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 20 Position: 21
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -258,6 +258,22 @@ Accept pipeline input: False
Accept wildcard characters: 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 ### -seats
Number of license seats owned. Number of license seats owned.
@ -327,7 +343,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 19 Position: 20
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False

View file

@ -14,7 +14,8 @@ Set license seat or checkout license seat
``` ```
Set-SnipeitLicenseSeat [-id] <Int32[]> [-seat_id] <Int32> [[-assigned_to] <Int32>] [[-asset_id] <Int32>] Set-SnipeitLicenseSeat [-id] <Int32[]> [-seat_id] <Int32> [[-assigned_to] <Int32>] [[-asset_id] <Int32>]
[[-note] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>] [[-note] <String>] [[-RequestType] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm]
[<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -51,7 +52,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 7 Position: 8
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -117,6 +118,22 @@ Accept pipeline input: False
Accept wildcard characters: 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 ### -seat_id
{{ Fill seat_id Description }} {{ Fill seat_id Description }}
@ -141,7 +158,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 6 Position: 7
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False

View file

@ -15,8 +15,8 @@ Updates Location in Snipe-it asset system
``` ```
Set-SnipeitLocation [-id] <Int32[]> [[-name] <String>] [[-address] <String>] [[-address2] <String>] Set-SnipeitLocation [-id] <Int32[]> [[-name] <String>] [[-address] <String>] [[-address2] <String>]
[[-state] <String>] [[-country] <String>] [[-zip] <String>] [[-city] <String>] [[-currency] <String>] [[-state] <String>] [[-country] <String>] [[-zip] <String>] [[-city] <String>] [[-currency] <String>]
[[-manager_id] <Int32>] [[-ldap_ou] <String>] [[-parent_id] <Int32>] [-url] <String> [-apiKey] <String> [[-manager_id] <Int32>] [[-ldap_ou] <String>] [[-parent_id] <Int32>] [[-image] <String>] [-image_delete]
[-WhatIf] [-Confirm] [<CommonParameters>] [[-RequestType] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -70,7 +70,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 14 Position: 16
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -136,6 +136,36 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: 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
```
### -ldap_ou ### -ldap_ou
LDAP OU of Location LDAP OU of Location
@ -196,6 +226,22 @@ Accept pipeline input: False
Accept wildcard characters: 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
Address State Address State
@ -220,7 +266,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 13 Position: 15
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False

View file

@ -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] <String> [[-image] <String>] [-image_delete] [[-RequestType] <String>]
[-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
```
## 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

View file

@ -14,8 +14,9 @@ Updates Model on Snipe-it asset system
``` ```
Set-SnipeitModel [-id] <Int32[]> [[-name] <String>] [[-model_number] <String>] [[-category_id] <Int32>] Set-SnipeitModel [-id] <Int32[]> [[-name] <String>] [[-model_number] <String>] [[-category_id] <Int32>]
[[-manufacturer_id] <Int32>] [[-eol] <Int32>] [[-custom_fieldset_id] <Int32>] [-url] <String> [[-manufacturer_id] <Int32>] [[-eol] <Int32>] [[-custom_fieldset_id] <Int32>] [[-image] <String>]
[-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>] [-image_delete] [[-RequestType] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm]
[<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -39,7 +40,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 9 Position: 11
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -105,6 +106,36 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: 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
```
### -manufacturer_id ### -manufacturer_id
Manufacturer ID that the asset belongs to this can be got using Get-Manufacturer 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 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
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -159,7 +206,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 8 Position: 10
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False

View file

@ -14,8 +14,8 @@ Sets Snipe-it Status Labels
``` ```
Set-SnipeitStatus [-id] <Int32[]> [[-name] <String>] [-type] <String> [[-notes] <String>] [[-color] <String>] Set-SnipeitStatus [-id] <Int32[]> [[-name] <String>] [-type] <String> [[-notes] <String>] [[-color] <String>]
[[-show_in_nav] <Boolean>] [[-default_label] <Boolean>] [-url] <String> [-apiKey] <String> [-WhatIf] [[-show_in_nav] <Boolean>] [[-default_label] <Boolean>] [[-RequestType] <String>] [-url] <String>
[-Confirm] [<CommonParameters>] [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -44,7 +44,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 9 Position: 10
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -125,6 +125,22 @@ Accept pipeline input: False
Accept wildcard characters: 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 ### -show_in_nav
1 or 0 - determine whether the status label should show in the left-side nav of the web GUI 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: Aliases:
Required: True Required: True
Position: 8 Position: 9
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False

330
docs/Set-SnipeitSupplier.md Normal file
View file

@ -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] <String> [[-address] <String>] [[-address2] <String>] [[-city] <String>]
[[-state] <String>] [[-country] <String>] [[-zip] <String>] [[-phone] <String>] [[-fax] <String>]
[[-email] <String>] [[-contact] <String>] [[-notes] <String>] [[-image] <String>] [-image_delete]
[[-RequestType] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
```
## 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

View file

@ -16,8 +16,8 @@ Creates a new user
Set-SnipeitUser [-id] <Int32[]> [[-first_name] <String>] [[-last_name] <String>] [[-userName] <String>] Set-SnipeitUser [-id] <Int32[]> [[-first_name] <String>] [[-last_name] <String>] [[-userName] <String>]
[[-jobtitle] <String>] [[-email] <String>] [[-phone] <String>] [[-password] <String>] [[-company_id] <Int32>] [[-jobtitle] <String>] [[-email] <String>] [[-phone] <String>] [[-password] <String>] [[-company_id] <Int32>]
[[-location_id] <Int32>] [[-department_id] <Int32>] [[-manager_id] <Int32>] [[-employee_num] <String>] [[-location_id] <Int32>] [[-department_id] <Int32>] [[-manager_id] <Int32>] [[-employee_num] <String>]
[[-activated] <Boolean>] [[-notes] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [[-activated] <Boolean>] [[-notes] <String>] [[-image] <String>] [-image_delete] [[-RequestType] <String>]
[<CommonParameters>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -57,7 +57,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 17 Position: 19
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -153,6 +153,36 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False 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 ### -jobtitle
Users job tittle Users job tittle
@ -258,6 +288,22 @@ Accept pipeline input: False
Accept wildcard characters: 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
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -267,7 +313,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 16 Position: 18
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False

View file

@ -104,6 +104,9 @@ Add a new Manufacturer to Snipe-it asset system
### [New-SnipeitModel](New-SnipeitModel.md) ### [New-SnipeitModel](New-SnipeitModel.md)
Add a new Model to Snipe-it asset system Add a new Model to Snipe-it asset system
### [New-SnipeitSupplier](New-SnipeitSupplier.md)
Creates a supplier
### [New-SnipeitUser](New-SnipeitUser.md) ### [New-SnipeitUser](New-SnipeitUser.md)
Creates a new user Creates a new user
@ -146,6 +149,9 @@ Removes manufacturer from Snipe-it asset system
### [Remove-SnipeitModel](Remove-SnipeitModel.md) ### [Remove-SnipeitModel](Remove-SnipeitModel.md)
Removes Asset model from Snipe-it asset system 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) ### [Remove-SnipeitUser](Remove-SnipeitUser.md)
Removes User from Snipe-it asset system Removes User from Snipe-it asset system
@ -197,12 +203,18 @@ Set license seat or checkout license seat
### [Set-SnipeitLocation](Set-SnipeitLocation.md) ### [Set-SnipeitLocation](Set-SnipeitLocation.md)
Updates Location in Snipe-it asset system 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) ### [Set-SnipeitModel](Set-SnipeitModel.md)
Updates Model on Snipe-it asset system Updates Model on Snipe-it asset system
### [Set-SnipeitStatus](Set-SnipeitStatus.md) ### [Set-SnipeitStatus](Set-SnipeitStatus.md)
Sets Snipe-it Status Labels Sets Snipe-it Status Labels
### [Set-SnipeitSupplier](Set-SnipeitSupplier.md)
Modify the supplier
### [Set-SnipeitUser](Set-SnipeitUser.md) ### [Set-SnipeitUser](Set-SnipeitUser.md)
Creates a new user Creates a new user