From 8d33d687b0a3cafa9abc6bcd0cec8a829b35df17 Mon Sep 17 00:00:00 2001 From: Petri Asikainen Date: Wed, 19 May 2021 15:51:49 +0300 Subject: [PATCH] Updated docs --- SnipeitPS/Public/Get-Accessory.ps1 | 12 +- SnipeitPS/Public/Get-Asset.ps1 | 9 +- SnipeitPS/Public/Get-AssetMaintenance.ps1 | 6 +- SnipeitPS/Public/Get-Category.ps1 | 8 +- SnipeitPS/Public/Get-Company.ps1 | 9 +- SnipeitPS/Public/Get-Component.ps1 | 14 +- SnipeitPS/Public/Get-CustomField.ps1 | 16 +- SnipeitPS/Public/Get-Department.ps1 | 7 +- SnipeitPS/Public/Get-Fieldset.ps1 | 2 +- SnipeitPS/Public/Get-License.ps1 | 6 +- SnipeitPS/Public/Get-Manufacturer.ps1 | 6 +- SnipeitPS/Public/Get-Model.ps1 | 6 +- SnipeitPS/Public/Get-SnipeitLocation.ps1 | 6 +- SnipeitPS/Public/Get-Status.ps1 | 6 +- SnipeitPS/Public/Get-Supplier.ps1 | 4 +- SnipeitPS/Public/Get-User.ps1 | 16 +- SnipeitPS/Public/New-Accessory.ps1 | 63 +++++- SnipeitPS/Public/New-Asset.ps1 | 83 +++---- SnipeitPS/Public/New-AssetMaintenance.ps1 | 41 ++++ SnipeitPS/Public/New-Audit.ps1 | 20 +- SnipeitPS/Public/New-Category.ps1 | 10 +- SnipeitPS/Public/New-Company.ps1 | 26 +-- SnipeitPS/Public/New-Component.ps1 | 45 ++-- SnipeitPS/Public/New-Department.ps1 | 25 ++- SnipeitPS/Public/New-License.ps1 | 68 ++++++ SnipeitPS/Public/New-Model.ps1 | 3 + SnipeitPS/Public/New-User.ps1 | 39 ++-- SnipeitPS/Public/Remove-Asset.ps1 | 8 +- SnipeitPS/Public/Remove-AssetMaintenance.ps1 | 6 + SnipeitPS/Public/Remove-User.ps1 | 7 + SnipeitPS/Public/Reset-AssetOwner.ps1 | 27 +++ SnipeitPS/Public/Set-Accessory.ps1 | 60 ++++- SnipeitPS/Public/Set-AssetOwner.ps1 | 57 ++++- SnipeitPS/Public/Set-Components.ps1 | 58 ++++- SnipeitPS/Public/Set-Info.ps1 | 15 ++ SnipeitPS/Public/Set-License.ps1 | 71 ++++++ SnipeitPS/Public/Set-Model.ps1 | 35 +++ SnipeitPS/Public/Set-User.ps1 | 92 ++++---- docs/Get-Accessory.md | 10 +- docs/Get-Asset.md | 8 +- docs/Get-AssetMaintenance.md | 6 +- docs/Get-Category.md | 8 +- docs/Get-Company.md | 10 +- docs/Get-Component.md | 19 +- docs/Get-CustomField.md | 2 +- docs/Get-Department.md | 9 +- docs/Get-Fieldset.md | 2 +- docs/Get-Manufacturer.md | 8 +- docs/Get-Model.md | 6 +- docs/Get-SnipeitLocation.md | 6 +- docs/Get-Status.md | 6 +- docs/Get-Supplier.md | 4 +- docs/Get-User.md | 18 +- docs/New-Asset.md | 26 ++- docs/New-AssetMaintenance.md | 111 +++++----- docs/New-Category.md | 2 +- docs/New-Component.md | 26 +-- docs/New-Department.md | 29 ++- docs/New-License.md | 181 ++++++++-------- docs/New-Location.md | 20 +- docs/New-Manufacturer.md | 4 +- docs/New-Model.md | 6 +- docs/New-User.md | 40 ++-- docs/Remove-Asset.md | 6 +- docs/Remove-User.md | 4 +- docs/Set-Accessory.md | 187 ++++++++-------- docs/Set-Asset.md | 11 +- docs/Set-AssetOwner.md | 112 +++++++--- docs/Set-Component.md | 138 +++++++++--- docs/Set-Info.md | 49 ++--- docs/Set-License.md | 217 +++++++++---------- docs/Set-Model.md | 81 ++++--- docs/Set-User.md | 44 ++-- docs/SnipeItPS.md | 67 ++++-- 74 files changed, 1602 insertions(+), 873 deletions(-) diff --git a/SnipeitPS/Public/Get-Accessory.ps1 b/SnipeitPS/Public/Get-Accessory.ps1 index a40d23f..3cb0ba6 100644 --- a/SnipeitPS/Public/Get-Accessory.ps1 +++ b/SnipeitPS/Public/Get-Accessory.ps1 @@ -1,6 +1,9 @@ <# .SYNOPSIS -# Gets a list of Snipe-it Accessories +Gets a list of Snipe-it Accessories + +.DESCRIPTION +Gets a list of Snipe-it Accessories .PARAMETER search A text string to search the Accessory data @@ -12,7 +15,7 @@ A id of specific Accessory Specify the number of results you wish to return. Defaults to 50. Defines batch size for -all .PARAMETER offset -Offset to use +Result offset to use .PARAMETER all A return all results, works with -offset and other parameters @@ -24,12 +27,13 @@ URL of Snipeit system, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-Info command .EXAMPLE -Get-Accessory -url "https://assets.example.com" -token "token..." +Get-Accessory -search Keyboard .EXAMPLE -Get-Accessory -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "HP" } +Get-Accessory -id 1 #> + function Get-Accessory() { Param( [string]$search, diff --git a/SnipeitPS/Public/Get-Asset.ps1 b/SnipeitPS/Public/Get-Asset.ps1 index 7d996dd..8954437 100644 --- a/SnipeitPS/Public/Get-Asset.ps1 +++ b/SnipeitPS/Public/Get-Asset.ps1 @@ -1,18 +1,18 @@ <# .SYNOPSIS - Gets a list of Snipe-it Assets +Gets a list of Snipe-it Assets or specific asset .PARAMETER search A text string to search the assets data .PARAMETER id -A text string to search the assets data +ID number of excact snipeit asset .PARAMETER asset_tag -Specify exact asset tag to query +Exact asset tag to query .PARAMETER asset_serial -Specify exact asset serial to query +Exact asset serialnumber to query .PARAMETER order_number Optionally restrict asset results to this order number @@ -71,6 +71,7 @@ Get-Asset -search "myMachine"-url "https://assets.example.com"-token "token..." .EXAMPLE Get-Asset -asset_tag "myAssetTag"-url "https://assets.example.com"-token "token..." #> + function Get-Asset() { Param( [string]$search, diff --git a/SnipeitPS/Public/Get-AssetMaintenance.ps1 b/SnipeitPS/Public/Get-AssetMaintenance.ps1 index f470da5..81b29fe 100644 --- a/SnipeitPS/Public/Get-AssetMaintenance.ps1 +++ b/SnipeitPS/Public/Get-AssetMaintenance.ps1 @@ -1,12 +1,12 @@ <# .SYNOPSIS - Gets a list of Snipe-it Assets +Lists Snipe-it Assets Maintenances .PARAMETER asset_id - +Asset ID of the asset you'd like to return maintenances for .PARAMETER search -A text string to search the assets data +Search string .PARAMETER sort Specify the column name you wish to sort by diff --git a/SnipeitPS/Public/Get-Category.ps1 b/SnipeitPS/Public/Get-Category.ps1 index 39959be..c66f530 100644 --- a/SnipeitPS/Public/Get-Category.ps1 +++ b/SnipeitPS/Public/Get-Category.ps1 @@ -1,6 +1,6 @@ <# .SYNOPSIS -# Gets a list of Snipe-it Categories +Gets a list of Snipe-it Categories .PARAMETER search A text string to search the Categories data @@ -18,16 +18,16 @@ Offset to use A return all results, works with -offset and other parameters .PARAMETER url -URL of Snipeit system, can be set using Set-Info command +Url of Snipeit system, can be set using Set-Info command .PARAMETER apiKey Users API Key for Snipeit, can be set using Set-Info command .EXAMPLE -Get-Category -url "https://assets.example.com" -token "token..." +Get-Category -id 1 .EXAMPLE -Get-Category -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "Laptop" } +Get-Category -search "Laptop" #> diff --git a/SnipeitPS/Public/Get-Company.ps1 b/SnipeitPS/Public/Get-Company.ps1 index 7fd5798..fbead48 100644 --- a/SnipeitPS/Public/Get-Company.ps1 +++ b/SnipeitPS/Public/Get-Company.ps1 @@ -1,6 +1,6 @@ <# .SYNOPSIS -# Gets a list of Snipe-it Companies +Gets a list of Snipe-it Companies .PARAMETER search A text string to search the Companies data @@ -16,7 +16,6 @@ Offset to use .PARAMETER all A return all results, works with -offset and other parameters - .PARAMETER url URL of Snipeit system, can be set using Set-Info command @@ -24,10 +23,12 @@ URL of Snipeit system, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-Info command .EXAMPLE -Get-Company -url "https://assets.example.com" -token "token..." +Get-Company +Gets all companies .EXAMPLE -Get-Company -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "Company1" } +Get-Company -id 1 +Gets specific company #> diff --git a/SnipeitPS/Public/Get-Component.ps1 b/SnipeitPS/Public/Get-Component.ps1 index 71a028e..2218ad5 100644 --- a/SnipeitPS/Public/Get-Component.ps1 +++ b/SnipeitPS/Public/Get-Component.ps1 @@ -1,6 +1,6 @@ <# .SYNOPSIS -# Gets a list of Snipe-it Components +Gets a list of Snipe-it Components .PARAMETER search A text string to search the Components data @@ -18,16 +18,22 @@ Offset to use A return all results, works with -offset and other parameters .PARAMETER url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system,can be set using Set-Info command .PARAMETER apiKey Users API Key for Snipeit, can be set using Set-Info command .EXAMPLE -Get-Component -url "https://assets.example.com" -token "token..." +Get-Component +Returns all components .EXAMPLE -Get-Component -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "Memory" } +Get-Component -search display +Returns search results containeing string display + +.EXAMPLE +Get-Component -id +Returns specific component #> diff --git a/SnipeitPS/Public/Get-CustomField.ps1 b/SnipeitPS/Public/Get-CustomField.ps1 index 6a65368..ff52aa5 100644 --- a/SnipeitPS/Public/Get-CustomField.ps1 +++ b/SnipeitPS/Public/Get-CustomField.ps1 @@ -1,15 +1,15 @@ <# -.SYNOPSIS -# Returns a list of all Snipe-IT custom fields + .SYNOPSIS + Returns a list of all Snipe-IT custom fields -.PARAMETER url -URL of Snipeit system, can be set using Set-Info command + .PARAMETER url + URL of Snipeit system, can be set using Set-Info command -.PARAMETER apiKey -Users API Key for Snipeit, can be set using Set-Info command + .PARAMETER apiKey + Users API Key for Snipeit, can be set using Set-Info command -.EXAMPLE -Get-Field -url "https://assets.example.com" -token "token..." + .EXAMPLE + Get-Field -url "https://assets.example.com" -token "token..." #> diff --git a/SnipeitPS/Public/Get-Department.ps1 b/SnipeitPS/Public/Get-Department.ps1 index 85f6b13..4fcaeb6 100644 --- a/SnipeitPS/Public/Get-Department.ps1 +++ b/SnipeitPS/Public/Get-Department.ps1 @@ -1,6 +1,6 @@ <# .SYNOPSIS -# Gets a list of Snipe-it Departments +Gets a list of Snipe-it Departments .PARAMETER search A text string to search the Departments data @@ -27,7 +27,10 @@ Users API Key for Snipeit, can be set using Set-Info command Get-Department -url "https://assets.example.com" -token "token..." .EXAMPLE -Get-Department -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "Department1" } +Get-Department -search Department1 + +.EXAMPLE +Get-Department -id 1 #> diff --git a/SnipeitPS/Public/Get-Fieldset.ps1 b/SnipeitPS/Public/Get-Fieldset.ps1 index 9e4058d..54035b3 100644 --- a/SnipeitPS/Public/Get-Fieldset.ps1 +++ b/SnipeitPS/Public/Get-Fieldset.ps1 @@ -1,6 +1,6 @@ <# .SYNOPSIS -# Gets a list of Snipe-it Fieldsets +Gets a list of Snipe-it Fieldsets .PARAMETER url URL of Snipeit system, can be set using Set-Info command diff --git a/SnipeitPS/Public/Get-License.ps1 b/SnipeitPS/Public/Get-License.ps1 index 5d207d6..0cb1a7d 100644 --- a/SnipeitPS/Public/Get-License.ps1 +++ b/SnipeitPS/Public/Get-License.ps1 @@ -1,6 +1,6 @@ <# .SYNOPSIS -# Gets a list of Snipe-it Licenses +Gets a list of Snipe-it Licenses .PARAMETER search A text string to search the Licenses data @@ -25,10 +25,10 @@ URL of Snipeit system, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-Info command .EXAMPLE -Get-License -url "https://assets.example.com" -token "token..." +Get-License -search SomeLicense .EXAMPLE -Get-License -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "License" } +Get-License -id 1 #> diff --git a/SnipeitPS/Public/Get-Manufacturer.ps1 b/SnipeitPS/Public/Get-Manufacturer.ps1 index 2260148..9ddc1f1 100644 --- a/SnipeitPS/Public/Get-Manufacturer.ps1 +++ b/SnipeitPS/Public/Get-Manufacturer.ps1 @@ -24,10 +24,12 @@ URL of Snipeit system, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-Info command .EXAMPLE -Get-Manufacturer -url "https://assets.example.com" -token "token..." +Get-Manufacturer -search HP +Search all manufacturers for string HP .EXAMPLE -Get-Manufacturer -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "HP" } +Get-Manufacturer -id 3 +Returns manufacturer with id 3 #> diff --git a/SnipeitPS/Public/Get-Model.ps1 b/SnipeitPS/Public/Get-Model.ps1 index 76d7d37..0df4b34 100644 --- a/SnipeitPS/Public/Get-Model.ps1 +++ b/SnipeitPS/Public/Get-Model.ps1 @@ -1,6 +1,6 @@ <# .SYNOPSIS -# Gets a list of Snipe-it Models +Gets a list of Snipe-it Models .PARAMETER search A text string to search the Models data @@ -24,10 +24,10 @@ URL of Snipeit system, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-Info command .EXAMPLE -Get-Model -url "https://assets.example.com" -token "token..." +Get-Model -search "DL380" .EXAMPLE -Get-Model -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "DL380" } +Get-Model -id 1 #> diff --git a/SnipeitPS/Public/Get-SnipeitLocation.ps1 b/SnipeitPS/Public/Get-SnipeitLocation.ps1 index 3d61c9a..db9276e 100644 --- a/SnipeitPS/Public/Get-SnipeitLocation.ps1 +++ b/SnipeitPS/Public/Get-SnipeitLocation.ps1 @@ -1,6 +1,6 @@ <# .SYNOPSIS -# Gets a list of Snipe-it Locations +Gets a list of Snipe-it Locations .PARAMETER search A text string to search the Locations data @@ -24,10 +24,10 @@ URL of Snipeit system, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-Info command .EXAMPLE -Get-Location -url "https://assets.example.com" -token "token..." +Get-Location -search Location1 .EXAMPLE -Get-Location -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "Location1" } +Get-Location -id 3 #> diff --git a/SnipeitPS/Public/Get-Status.ps1 b/SnipeitPS/Public/Get-Status.ps1 index 6a6f477..63fb4ca 100644 --- a/SnipeitPS/Public/Get-Status.ps1 +++ b/SnipeitPS/Public/Get-Status.ps1 @@ -1,6 +1,6 @@ <# .SYNOPSIS -# Gets a list of Snipe-it Status Labels +Gets a list of Snipe-it Status Labels .PARAMETER search A text string to search the Status Labels data @@ -24,10 +24,10 @@ URL of Snipeit system, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-Info command .EXAMPLE -Get-Status -url "https://assets.example.com" -token "token..." +Get-Status -search "Ready to Deploy" .EXAMPLE -Get-Status -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "Ready to Deploy" } +Get-Status -id 3 #> diff --git a/SnipeitPS/Public/Get-Supplier.ps1 b/SnipeitPS/Public/Get-Supplier.ps1 index 4cbbb98..5cf5245 100644 --- a/SnipeitPS/Public/Get-Supplier.ps1 +++ b/SnipeitPS/Public/Get-Supplier.ps1 @@ -24,10 +24,10 @@ URL of Snipeit system, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-Info command .EXAMPLE -Get-Supplier -url "https://assets.example.com" -token "token..." +Get-Supplier -search MySupplier .EXAMPLE -Get-Supplier -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "MySupplier" } +Get-Supplier -id 2 #> diff --git a/SnipeitPS/Public/Get-User.ps1 b/SnipeitPS/Public/Get-User.ps1 index 934a6d0..859c48a 100644 --- a/SnipeitPS/Public/Get-User.ps1 +++ b/SnipeitPS/Public/Get-User.ps1 @@ -8,6 +8,12 @@ A text string to search the User data .PARAMETER id A id of specific User +.PARAMETER username +Search string for username field + +.PARAMETER email +Search string for email field + .PARAMETER limit Specify the number of results you wish to return. Defaults to 50. Defines batch size for -all @@ -24,12 +30,18 @@ URL of Snipeit system, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-Info command .EXAMPLE -Get-User -url "https://assets.example.com" -token "token..." +Get-User -search SomeSurname .EXAMPLE -Get-User -url "https://assets.example.com" -token "token..." | Where-Object {$_.username -eq "stephenm" } +Get-User -id 3 +.EXAMPLE +Get-User -username someuser + +.EXAMPLE +Get-User -email user@somedomain.com #> + function Get-User() { Param( [string]$search, diff --git a/SnipeitPS/Public/New-Accessory.ps1 b/SnipeitPS/Public/New-Accessory.ps1 index 16216aa..22fdd96 100644 --- a/SnipeitPS/Public/New-Accessory.ps1 +++ b/SnipeitPS/Public/New-Accessory.ps1 @@ -1,4 +1,62 @@ +<# +.SYNOPSIS +Creates new accessory on Snipe-It system +.DESCRIPTION +Creates new accessory on Snipe-It system + +.PARAMETER name +Accessory name + +.PARAMETER qty +Quantity of the accessory you have + +.PARAMETER category_id +ID number of the category the accessory belongs to + +.PARAMETER company_id +ID Number of the company the accessory is assigned to + +.PARAMETER manufacturer_id +ID number of the manufacturer for this accessory. + +.PARAMETER order_number +Order number for this accessory. + +.PARAMETER purchase_cost +Cost of item being purchased. + +.PARAMETER purchase_date +Date accessory was purchased + +.PARAMETER order_number +Order number for this accessory. + +.PARAMETER purchase_cost +Cost of item being purchased. + +.PARAMETER purchase_date +Date accessory was purchased + +.PARAMETER supplier_id +ID number of the supplier for this accessory + +.PARAMETER location_id +ID number of the location the accessory is assigned to + +.PARAMETER min_qty +Min quantity of the accessory before alert is triggered + +.PARAMETER url +URL of Snipeit system, can be set using Set-Info command + +.PARAMETER apiKey +Users API Key for Snipeit, can be set using Set-Info command + +.EXAMPLE +New-Accessory -name "Accessory" -qty 3 -category_id 1 + +#> function New-Accessory() { [CmdletBinding( SupportsShouldProcess = $true, @@ -29,11 +87,14 @@ function New-Accessory() { [datetime]$purchase_date, - [bool]$requestable, + [int]$min_qty, [ValidateRange(1, [int]::MaxValue)] [int]$supplier_id, + [ValidateRange(1, [int]::MaxValue)] + [int]$location_id, + [parameter(mandatory = $true)] [string]$url, diff --git a/SnipeitPS/Public/New-Asset.ps1 b/SnipeitPS/Public/New-Asset.ps1 index e20cd01..d86a32f 100644 --- a/SnipeitPS/Public/New-Asset.ps1 +++ b/SnipeitPS/Public/New-Asset.ps1 @@ -1,61 +1,68 @@ <# - .SYNOPSIS - Add a new Asset to Snipe-it asset system +.SYNOPSIS +Add a new Asset to Snipe-it asset system - .DESCRIPTION - Long description +.DESCRIPTION +Long description - .PARAMETER status_id - Required Status ID of the asset, this can be got using Get-Status +.PARAMETER status_id +Required Status ID of the asset, this can be got using Get-Status - .PARAMETER model_id - Required Model ID of the asset, this can be got using Get-Model +.PARAMETER model_id +Required Model ID of the asset, this can be got using Get-Model - .PARAMETER name - Optional Name of the Asset +.PARAMETER name +Optional Name of the Asset - .PARAMETER asset_tag - Asset Tag for the Asset, not required when snipe asset_tag autogeneration is on. +.PARAMETER asset_tag +Asset Tag for the Asset, not required when snipe asset_tag autogeneration is on. - .PARAMETER serial - Optional Serial number of the Asset +.PARAMETER serial +Optional Serial number of the Asset - .PARAMETER company_id - Optional Company id +.PARAMETER company_id +Optional Company id - .PARAMETER order_number - Optional Order number +.PARAMETER order_number +Optional Order number - .PARAMETER notes - Optional Notes +.PARAMETER notes +Optional Notes - .PARAMETER warranty_monhts - Optional Warranty lenght of the Asset in months +.PARAMETER warranty_monhts +Optional Warranty lenght of the Asset in months - .PARAMETER purchase_cost - Optional Purchase cost of the Asset +.PARAMETER purchase_cost +Optional Purchase cost of the Asset - .PARAMETER purchase_date - Optional Purchase cost of the Asset +.PARAMETER purchase_date +Optional Purchase cost of the Asset - .PARAMETER rtd_location_id - Optional Default location id for the asset +.PARAMETER rtd_location_id +Optional Default location id for the asset - .PARAMETER url - URL of Snipeit system, can be set using Set-Info command +.PARAMETER url +URL of Snipeit system, can be set using Set-Info command - .PARAMETER apiKey - Users API Key for Snipeit, can be set using Set-Info command +.PARAMETER apiKey +Users API Key for Snipeit, can be set using Set-Info command - .PARAMETER customfields - Hastable of custom fields and extra fields that need passing through to Snipeit +.PARAMETER customfields +Hastable of custom fields and extra fields that need passing through to Snipeit. +Use internal field names from snipeit .You can use Get-CustomField to get internal field names. - .EXAMPLE - New-Asset -status_id 1 -model_id 1 -name "Machine1" +.EXAMPLE +New-Asset -status_id 1 -model_id 1 -name "Machine1" +Create asset with automatic tag if tag genaration is enabled on snipe-it, other wise without tag - .EXAMPLE - New-Asset -status_id 1 -model_id 1 -name "Machine1" -CustomValues = @{ "_snipeit_os_5 = "Windows 10 Pro" } +.EXAMPLE +New-Asset -status_id 1 -model_id 1 -name "Machine1" -asset_tag "DEV123" +Specifying asset tag when creating asset + +.EXAMPLE +New-Asset -status_id 1 -model_id 1 -name "Machine1" -CustomValues = @{ "_snipeit_os_5" = "Windows 10 Pro" } +Using customfields when creating asset. #> function New-Asset() diff --git a/SnipeitPS/Public/New-AssetMaintenance.ps1 b/SnipeitPS/Public/New-AssetMaintenance.ps1 index b3bf214..8c66445 100644 --- a/SnipeitPS/Public/New-AssetMaintenance.ps1 +++ b/SnipeitPS/Public/New-AssetMaintenance.ps1 @@ -1,3 +1,44 @@ +<# +.SYNOPSIS +Add a new Asset maintenence to Snipe-it asset system + +.DESCRIPTION +Long description + + +.PARAMETER title +Required Title of maintenance + +.PARAMETER asset_id +Required ID of the asset, this can be got using Get-Asset + +.PARAMETER supplier_id +Required maintenance supplier + +.PARAMETER start_date +Required start date + +.PARAMETER is_warranty +Optional Maintenance done under warranty + +.PARAMETER cost +Optional cost + +.PARAMETER comletion_date +Optional completion date + +.PARAMETER notes +Optional cost + +.PARAMETER url +URL of Snipeit system, can be set using Set-Info command + +.PARAMETER apiKey +Users API Key for Snipeit, can be set using Set-Info command + +.EXAMPLE +New-AssetMaintenence -asset_id 1 -supplier_id 1 -title "replace keyboard" -start_date 2021-01-01 +#> function New-AssetMaintenance() { [CmdletBinding( SupportsShouldProcess = $true, diff --git a/SnipeitPS/Public/New-Audit.ps1 b/SnipeitPS/Public/New-Audit.ps1 index 15f9aea..94824d3 100644 --- a/SnipeitPS/Public/New-Audit.ps1 +++ b/SnipeitPS/Public/New-Audit.ps1 @@ -1,18 +1,18 @@ <# - .SYNOPSIS - Add a new Audit to Snipe-it asset system +.SYNOPSIS +Add a new Audit to Snipe-it asset system - .DESCRIPTION - Long description +.DESCRIPTION +Long description - .PARAMETER Tag - The asset tag of the asset you wish to audit +.PARAMETER Tag +The asset tag of the asset you wish to audit - .PARAMETER Location_id - ID of the location you want to associate with the audit +.PARAMETER Location_id +ID of the location you want to associate with the audit - .EXAMPLE - New-Audit -tag 1 -location_id "Location of Audit" +.EXAMPLE +New-Audit -tag 1 -location_id 1 #> diff --git a/SnipeitPS/Public/New-Category.ps1 b/SnipeitPS/Public/New-Category.ps1 index fc5c0e1..f5e8c27 100644 --- a/SnipeitPS/Public/New-Category.ps1 +++ b/SnipeitPS/Public/New-Category.ps1 @@ -1,20 +1,28 @@ <# .SYNOPSIS -# Create a new Snipe-IT Category +Create a new Snipe-IT Category + .PARAMETER name Name of new category to be created + .PARAMETER type Type of new category to be created (asset, accessory, consumable, component, license) + .PARAMETER url URL of Snipeit system, can be set using Set-Info command + .PARAMETER apiKey User's API Key for Snipeit, can be set using Set-Info command + .PARAMETER use_default_eula If switch is present, use the primary default EULA + .PARAMETER require_acceptance If switch is present, require users to confirm acceptance of assets in this category + .PARAMETER checkin_email If switch is present, send email to user on checkin/checkout + .EXAMPLE New-Category -name "Laptops" -category_type asset -url "Snipe-IT URL here..." -apiKey "API key here..." #> diff --git a/SnipeitPS/Public/New-Company.ps1 b/SnipeitPS/Public/New-Company.ps1 index 620fd7a..3d0b669 100644 --- a/SnipeitPS/Public/New-Company.ps1 +++ b/SnipeitPS/Public/New-Company.ps1 @@ -1,24 +1,22 @@ <# - .SYNOPSIS - Short description +.SYNOPSIS +Creates a new Company - .DESCRIPTION - Long description +.DESCRIPTION +Creates new company on Snipe-It system - .PARAMETER name - Parameter description +.PARAMETER name +Comapany name - .PARAMETER url - Parameter description +.PARAMETER url +URL of Snipeit system, can be set using Set-Info command - .PARAMETER apiKey - Parameter description +.PARAMETER apiKey +User's API Key for Snipeit, can be set using Set-Info command - .EXAMPLE - An example +.EXAMPLE +New-Company -name "Acme Company" - .NOTES - General notes #> function New-Company() diff --git a/SnipeitPS/Public/New-Component.ps1 b/SnipeitPS/Public/New-Component.ps1 index 755d48b..4504de6 100644 --- a/SnipeitPS/Public/New-Component.ps1 +++ b/SnipeitPS/Public/New-Component.ps1 @@ -1,30 +1,39 @@ <# - .SYNOPSIS - Short description +.SYNOPSIS +Create a new component - .DESCRIPTION - Long description +.DESCRIPTION +Createa new componen on Snipe-It system - .PARAMETER name - Parameter description +.PARAMETER name +Component name - .PARAMETER category_id - Parameter description +.PARAMETER category_id +ID number of category - .PARAMETER qty - Parameter description +.PARAMETER qty +Quantity of the components you have - .PARAMETER url - Parameter description +.PARAMETER location_id +ID number of the location the accessory is assigned to - .PARAMETER apiKey - Parameter description +.PARAMETER purchase_date +Date accessory was purchased - .EXAMPLE - An example +.PARAMETER purchase_cost +Cost of item being purchased. - .NOTES - General notes +.PARAMETER url +URL of Snipeit system, can be set using Set-Info command + +.PARAMETER apiKey +User's API Key for Snipeit, can be set using Set-Info command + +.EXAMPLE +An example + +.NOTES +General notes #> function New-Component() { diff --git a/SnipeitPS/Public/New-Department.ps1 b/SnipeitPS/Public/New-Department.ps1 index 3bcb51b..800b3d8 100644 --- a/SnipeitPS/Public/New-Department.ps1 +++ b/SnipeitPS/Public/New-Department.ps1 @@ -1,30 +1,31 @@ <# .SYNOPSIS - Short description + Creates a department .DESCRIPTION - Long description + Creates a new department on Snipe-It system .PARAMETER name - Parameter description + Department Name - .PARAMETER category_id - Parameter description + .PARAMETER company_id + ID number of company - .PARAMETER qty - Parameter description + .PARAMETER location_id + ID number of location + + .PARAMETER manager_id + ID number of manager .PARAMETER url - Parameter description + URL of Snipeit system, can be set using Set-Info command .PARAMETER apiKey - Parameter description + Users API Key for Snipeit, can be set using Set-Info command .EXAMPLE - An example + New-Department -name "Department1" -company_id 1 -localtion_id 1 -manager_id 3 - .NOTES - General notes #> function New-Department() { diff --git a/SnipeitPS/Public/New-License.ps1 b/SnipeitPS/Public/New-License.ps1 index f826416..fb38435 100644 --- a/SnipeitPS/Public/New-License.ps1 +++ b/SnipeitPS/Public/New-License.ps1 @@ -1,3 +1,71 @@ +<# + .SYNOPSIS + Creates a licence + + .DESCRIPTION + Creates a new licence on Snipe-It system + + .PARAMETER name + Name of license being created + + .PARAMETER seats + Number of license seats owned. + + .PARAMETER company_id + Id number of company license belongs to + + .PARAMETER expiration_date + Date of license expiration + + .PARAMETER expiration_date + Date of license expiration + + .PARAMETER license_email + Email address associated with license + + .PARAMETER license_name + Name of license contact person + + .PARAMETER serial + Serialnumber of license + + .PARAMETER maintained + Maintained status of license + + .PARAMETER manufacturer_id + ID number of manufacturer of license. + + .PARAMETER notes + License Notes + + .PARAMETER order_number + Order number of license purchase + + .PARAMETER purchase_cost + Cost of license + + .PARAMETER purchase_date + Date of license purchase + + .PARAMETER reassignable + Is license reassignable? + + .PARAMETER supplier_id + ID number of license supplier + + .PARAMETER termination_date + Termination date for license. + + .PARAMETER url + URL of Snipeit system, can be set using Set-Info command + + .PARAMETER apiKey + Users API Key for Snipeit, can be set using Set-Info command + + .EXAMPLE + New-Licence -name "License" -seats 3 -company_id 1 + +#> function New-License() { [CmdletBinding( diff --git a/SnipeitPS/Public/New-Model.ps1 b/SnipeitPS/Public/New-Model.ps1 index 239a6b9..87f0fad 100644 --- a/SnipeitPS/Public/New-Model.ps1 +++ b/SnipeitPS/Public/New-Model.ps1 @@ -8,6 +8,9 @@ .PARAMETER name Name of the Asset Model + .PARAMETER model_number + Model number of the Asset Model + .PARAMETER category_id Category ID that the asset belongs to this can be got using Get-Category diff --git a/SnipeitPS/Public/New-User.ps1 b/SnipeitPS/Public/New-User.ps1 index 49d4507..4630f06 100644 --- a/SnipeitPS/Public/New-User.ps1 +++ b/SnipeitPS/Public/New-User.ps1 @@ -1,64 +1,65 @@ <# .SYNOPSIS - Short description + Creates a new user .DESCRIPTION - Long description + Creates a new user to Snipe-IT system .PARAMETER first_name - Parameter description + Users first name .PARAMETER last_name - Parameter description + Users last name .PARAMETER username - Parameter description + Username for user .PARAMETER active - Parameter description + Can user log in to snipe-it? .PARAMETER notes - Parameter description + User Notes .PARAMETER jobtitle - Parameter description + Users job tittle .PARAMETER email - Parameter description + email address .PARAMETER phone - Parameter description + Phone number .PARAMETER company_id - Parameter description + ID number of company users belogs to .PARAMETER location_id - Parameter description + ID number of localtion .PARAMETER department_id - Parameter description + ID number of department .PARAMETER manager_id - Parameter description + ID number of manager .PARAMETER employee_num - Parameter description + Employeenumber .PARAMETER ldap_import Mark user as import from ldap .PARAMETER url - Parameter description + URL of Snipeit system, can be set using Set-Info command .PARAMETER apiKey - Parameter description + User's API Key for Snipeit, can be set using Set-Info command .EXAMPLE - An example + New-user -fist_name It -lastname Snipe -username snipeit -activated $false -company_id 1 -location_id 1 -department_id 1 + Creates new a new user who can't login to system .NOTES General notes - #> +#> function New-User() { [CmdletBinding( diff --git a/SnipeitPS/Public/Remove-Asset.ps1 b/SnipeitPS/Public/Remove-Asset.ps1 index deec338..095cd0d 100644 --- a/SnipeitPS/Public/Remove-Asset.ps1 +++ b/SnipeitPS/Public/Remove-Asset.ps1 @@ -5,8 +5,14 @@ Long description .PARAMETER ID Unique ID For Asset to be removed + .PARAMETER url + URL of Snipeit system, can be set using Set-Info command + + .PARAMETER apiKey + User's API Key for Snipeit, can be set using Set-Info command + .EXAMPLE - Remove-Asset -ID 44 -url $url -apiKey $secret -Verbose + Remove-Asset -ID 44 -Verbose #> function Remove-Asset () diff --git a/SnipeitPS/Public/Remove-AssetMaintenance.ps1 b/SnipeitPS/Public/Remove-AssetMaintenance.ps1 index 338bbe7..655269b 100644 --- a/SnipeitPS/Public/Remove-AssetMaintenance.ps1 +++ b/SnipeitPS/Public/Remove-AssetMaintenance.ps1 @@ -6,6 +6,12 @@ function Remove-AssetMaintenance { Removes asset maintenance event from Snipe-it asset system by ID .PARAMETER ID Unique ID of the asset maintenance to be removed + .PARAMETER url + URL of Snipeit system, can be set using Set-Info command + + .PARAMETER apiKey + User's API Key for Snipeit, can be set using Set-Info command + .EXAMPLE Remove-AssetMaintenance -ID 44 -url $url -apiKey $secret -Verbose #> diff --git a/SnipeitPS/Public/Remove-User.ps1 b/SnipeitPS/Public/Remove-User.ps1 index 69148c2..4d5c7b1 100644 --- a/SnipeitPS/Public/Remove-User.ps1 +++ b/SnipeitPS/Public/Remove-User.ps1 @@ -5,6 +5,13 @@ Long description .PARAMETER ID Unique ID For User to be removed + + .PARAMETER url + URL of Snipeit system, can be set using Set-Info command + + .PARAMETER apiKey + User's API Key for Snipeit, can be set using Set-Info command + .EXAMPLE Remove-User -ID 44 -url $url -apiKey $secret -Verbose #> diff --git a/SnipeitPS/Public/Reset-AssetOwner.ps1 b/SnipeitPS/Public/Reset-AssetOwner.ps1 index 20090c9..beecfcf 100644 --- a/SnipeitPS/Public/Reset-AssetOwner.ps1 +++ b/SnipeitPS/Public/Reset-AssetOwner.ps1 @@ -1,3 +1,30 @@ +<# + .SYNOPSIS + Checkin asset + .DESCRIPTION + Checks asset in from current user/localtion/asset + + .PARAMETER ID + Unique ID For asset to checkin + + .PARAMETER status_id + Change asset status to + + .PARAMETER location_id + Location id to change asset location to + + .PARAMETER notes + Notes about checkin + + .PARAMETER url + URL of Snipeit system, can be set using Set-Info command + + .PARAMETER apiKey + User's API Key for Snipeit, can be set using Set-Info command + + .EXAMPLE + Remove-User -ID 44 -url $url -apiKey $secret -Verbose +#> function Reset-AssetOwner() { [CmdletBinding( SupportsShouldProcess = $true, diff --git a/SnipeitPS/Public/Set-Accessory.ps1 b/SnipeitPS/Public/Set-Accessory.ps1 index 9671081..298a0c9 100644 --- a/SnipeitPS/Public/Set-Accessory.ps1 +++ b/SnipeitPS/Public/Set-Accessory.ps1 @@ -1,4 +1,62 @@ +<# +.SYNOPSIS +Updates accessory on Snipe-It system +.DESCRIPTION +Updates accessory on Snipe-It system + +.PARAMETER name +ID number of Accessory on Snipe-It system + +.PARAMETER qty +Quantity of the accessory you have + +.PARAMETER category_id +ID number of the category the accessory belongs to + +.PARAMETER company_id +ID Number of the company the accessory is assigned to + +.PARAMETER manufacturer_id +ID number of the manufacturer for this accessory. + +.PARAMETER order_number +Order number for this accessory. + +.PARAMETER purchase_cost +Cost of item being purchased. + +.PARAMETER purchase_date +Date accessory was purchased + +.PARAMETER order_number +Order number for this accessory. + +.PARAMETER purchase_cost +Cost of item being purchased. + +.PARAMETER purchase_date +Date accessory was purchased + +.PARAMETER supplier_id +ID number of the supplier for this accessory + +.PARAMETER location_id +ID number of the location the accessory is assigned to + +.PARAMETER min_qty +Min quantity of the accessory before alert is triggered + +.PARAMETER url +URL of Snipeit system, can be set using Set-Info command + +.PARAMETER apiKey +Users API Key for Snipeit, can be set using Set-Info command + +.EXAMPLE +Set-Accessory -id 1 -qty 3 + +#> function Set-Accessory() { [CmdletBinding( SupportsShouldProcess = $true, @@ -29,7 +87,7 @@ function Set-Accessory() { [datetime]$purchase_date, - [bool]$requestable, + [bool]$min_qty, [ValidateRange(1, [int]::MaxValue)] [int]$supplier_id, diff --git a/SnipeitPS/Public/Set-AssetOwner.ps1 b/SnipeitPS/Public/Set-AssetOwner.ps1 index 84c82b1..15b5284 100644 --- a/SnipeitPS/Public/Set-AssetOwner.ps1 +++ b/SnipeitPS/Public/Set-AssetOwner.ps1 @@ -1,3 +1,38 @@ +<# + .SYNOPSIS + Checkout asset + .DESCRIPTION + Checkout asset to user/localtion/asset + + .PARAMETER ID + Unique ID For asset to checkout + + .PARAMETER assigned_id + Id of target user , location or asset + + .PARAMETER note + Notes about checkout + + .PARAMETER name + Optional new asset name. This is useful for changing the asset's name on new checkout, + for example, an asset that was named "Anna's Macbook Pro" could be renamed on the fly + when it's checked out to Elizabeth, to "Beth's Macbook Pro" + + .PARAMETER expected_checkin + Optional date the asset is expected to be checked in + + .PARAMETER checkout_at + Optional date to override the checkout time of now + + .PARAMETER url + URL of Snipeit system, can be set using Set-Info command + + .PARAMETER apiKey + User's API Key for Snipeit, can be set using Set-Info command + + .EXAMPLE + Remove-User -ID 44 -url $url -apiKey $secret -Verbose +#> function Set-AssetOwner() { [CmdletBinding( @@ -15,6 +50,14 @@ function Set-AssetOwner() [ValidateSet("location","asset","user")] [string] $checkout_to_type = "user", + [string] $name, + + [string] $note, + + [datetime] $expected_checkin, + + [datetime]$checkout_at, + [parameter(mandatory = $true)] [string]$url, @@ -22,9 +65,14 @@ function Set-AssetOwner() [string]$apiKey ) - $Values = @{ - "id" = $id - "checkout_to_type" = $checkout_to_type + $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters + + if ($Values['expected_checkin']) { + $Values['expected_checkin'] = $values['expected_checkin'].ToString("yyyy-MM-dd") + } + + if ($Values['checkout_at']) { + $Values['checkout_at'] = $values['checkout_at'].ToString("yyyy-MM-dd") } switch ($checkout_to_type) @@ -34,6 +82,9 @@ function Set-AssetOwner() 'asset' { $Values += @{ "assigned_asset" = $assigned_id } } } + #This can be removed now + if($Values.ContainsKey('assigned_id')){$Values.Remove('assigned_id')} + $Body = $Values | ConvertTo-Json; $Parameters = @{ diff --git a/SnipeitPS/Public/Set-Components.ps1 b/SnipeitPS/Public/Set-Components.ps1 index b6f95fe..15eaf72 100644 --- a/SnipeitPS/Public/Set-Components.ps1 +++ b/SnipeitPS/Public/Set-Components.ps1 @@ -1,3 +1,43 @@ +<# +.SYNOPSIS +Updates component + +.DESCRIPTION +Updates component on Snipe-It system + +.PARAMETER id +ID number of name + +.PARAMETER name +Component name + +.PARAMETER category_id +ID number of category + +.PARAMETER qty +Quantity of the components you have + +.PARAMETER location_id +ID number of the location the accessory is assigned to + +.PARAMETER purchase_date +Date accessory was purchased + +.PARAMETER purchase_cost +Cost of item being purchased. + +.PARAMETER url +URL of Snipeit system, can be set using Set-Info command + +.PARAMETER apiKey +User's API Key for Snipeit, can be set using Set-Info command + +.EXAMPLE +An example + +.NOTES +General notes +#> function Set-Component() { [CmdletBinding( @@ -12,6 +52,16 @@ function Set-Component() [parameter(mandatory = $true)] [string]$qty, + [string]$name, + + [int]$company_id, + + [int]$location_id, + + [datetime]$purchase_date, + + [float]$purchase_cost, + [parameter(mandatory = $true)] [string]$url, @@ -19,11 +69,13 @@ function Set-Component() [string]$apiKey ) - $Values = @{ - "qty" = $qty + $values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters + + if ($values['purchase_date']) { + $values['purchase_date'] = $values['purchase_date'].ToString("yyyy-MM-dd") } - $Body = $Values | ConvertTo-Json; + $Body = $values | ConvertTo-Json; $Parameters = @{ Uri = "$url/api/v1/components/$id" diff --git a/SnipeitPS/Public/Set-Info.ps1 b/SnipeitPS/Public/Set-Info.ps1 index a0ef88e..79e348d 100644 --- a/SnipeitPS/Public/Set-Info.ps1 +++ b/SnipeitPS/Public/Set-Info.ps1 @@ -1,3 +1,18 @@ +<# + .SYNOPSIS + Sets authetication information + .DESCRIPTION + Set apikey and url user to connect Snipe-It system + + .PARAMETER url + URL of Snipeit system, can be set using Set-Info command + + .PARAMETER apiKey + User's API Key for Snipeit, can be set using Set-Info command + + .EXAMPLE + Set-Info -url $url -apiKey -Verbose +#> function Set-Info { [CmdletBinding()] [System.Diagnostics.CodeAnalysis.SuppressMessage('PSUseShouldProcessForStateChangingFunctions', '')] diff --git a/SnipeitPS/Public/Set-License.ps1 b/SnipeitPS/Public/Set-License.ps1 index 4e3df67..52d92b0 100644 --- a/SnipeitPS/Public/Set-License.ps1 +++ b/SnipeitPS/Public/Set-License.ps1 @@ -1,3 +1,74 @@ +<# + .SYNOPSIS + Updates a licence + + .DESCRIPTION + Updates licence on Snipe-It system + + .PARAMETER id + ID number of licence + + .PARAMETER name + Name of license + + .PARAMETER seats + Number of license seats owned. + + .PARAMETER company_id + Id number of company license belongs to + + .PARAMETER expiration_date + Date of license expiration + + .PARAMETER expiration_date + Date of license expiration + + .PARAMETER license_email + Email address associated with license + + .PARAMETER license_name + Name of license contact person + + .PARAMETER serial + Serialnumber of license + + .PARAMETER maintained + Maintained status of license + + .PARAMETER manufacturer_id + ID number of manufacturer of license. + + .PARAMETER notes + License Notes + + .PARAMETER order_number + Order number of license purchase + + .PARAMETER purchase_cost + Cost of license + + .PARAMETER purchase_date + Date of license purchase + + .PARAMETER reassignable + Is license reassignable? + + .PARAMETER supplier_id + ID number of license supplier + + .PARAMETER termination_date + Termination date for license. + + .PARAMETER url + URL of Snipeit system, can be set using Set-Info command + + .PARAMETER apiKey + Users API Key for Snipeit, can be set using Set-Info command + + .EXAMPLE + Set-Licence -name "License" -seats 3 -company_id 1 + +#> function Set-License() { [CmdletBinding( diff --git a/SnipeitPS/Public/Set-Model.ps1 b/SnipeitPS/Public/Set-Model.ps1 index 7494045..0020c1a 100644 --- a/SnipeitPS/Public/Set-Model.ps1 +++ b/SnipeitPS/Public/Set-Model.ps1 @@ -1,3 +1,38 @@ +<# + .SYNOPSIS + Updates Model on Snipe-it asset system + + .DESCRIPTION + Updates Model on Snipe-it asset system + + .PARAMETER id + ID number of the Asset Model + + .PARAMETER name + Name of the Asset Model + + .PARAMETER model_number + Model number of the Asset Model + + .PARAMETER category_id + Category ID that the asset belongs to this can be got using Get-Category + + .PARAMETER manufacturer_id + Manufacturer ID that the asset belongs to this can be got using Get-Manufacturer + + .PARAMETER fieldset_id + Fieldset ID that the asset uses (Custom fields) + + .PARAMETER url + URL of Snipeit system, can be set using Set-Info command + + .PARAMETER apiKey + Users API Key for Snipeit, can be set using Set-Info command + + .EXAMPLE + New-Model -name "DL380" -manufacturer_id 2 -fieldset_id 2 -category_id 1 +#> + function Set-Model() { [CmdletBinding( SupportsShouldProcess = $true, diff --git a/SnipeitPS/Public/Set-User.ps1 b/SnipeitPS/Public/Set-User.ps1 index 2b42f2e..f609733 100644 --- a/SnipeitPS/Public/Set-User.ps1 +++ b/SnipeitPS/Public/Set-User.ps1 @@ -1,64 +1,65 @@ <# .SYNOPSIS - Short description + Creates a new user .DESCRIPTION - Long description - - .PARAMETER id - Parameter description + Creates a new user to Snipe-IT system .PARAMETER first_name - Parameter description + Users first name .PARAMETER last_name - Parameter description + Users last name - .PARAMETER userName - Parameter description + .PARAMETER username + Username for user - .PARAMETER jobtitle - Parameter description - - .PARAMETER email - Parameter description - - .PARAMETER phone - Parameter description - - .PARAMETER company_id - Parameter description - - .PARAMETER location_id - Parameter description - - .PARAMETER department_id - Parameter description - - .PARAMETER manager_id - Parameter description - - .PARAMETER employee_num - Parameter description - - .PARAMETER activated - Parameter description + .PARAMETER active + Can user log in to snipe-it? .PARAMETER notes - Parameter description + User Notes + + .PARAMETER jobtitle + Users job tittle + + .PARAMETER email + email address + + .PARAMETER phone + Phone number + + .PARAMETER company_id + ID number of company users belogs to + + .PARAMETER location_id + ID number of localtion + + .PARAMETER department_id + ID number of department + + .PARAMETER manager_id + ID number of manager + + .PARAMETER employee_num + Employeenumber + + .PARAMETER ldap_import + Mark user as import from ldap .PARAMETER url - Parameter description + URL of Snipeit system, can be set using Set-Info command .PARAMETER apiKey - Parameter description + User's API Key for Snipeit, can be set using Set-Info command .EXAMPLE - An example + Update-user -id 3 -fist_name It -lastname Snipe -username snipeit -activated $false -company_id 1 -location_id 1 -department_id 1 + Updates user with id 3 .NOTES General notes - #> +#> function Set-User() { [CmdletBinding( @@ -103,16 +104,7 @@ function Set-User() { [string]$apiKey ) - $Values = @{} - - #$exclude = @('id', 'url', 'apiKey') - #$excludeRegex = [string]::Join('|', $exclude) # create the regex - - foreach ($psbp in $PSBoundParameters.GetEnumerator()) { - #if ($psbp.Key -notmatch $excludeRegex) { - $Values.Add($psbp.Key, $psbp.Value) - #} - } + $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $Body = $Values | ConvertTo-Json; diff --git a/docs/Get-Accessory.md b/docs/Get-Accessory.md index bb975e1..bba1853 100644 --- a/docs/Get-Accessory.md +++ b/docs/Get-Accessory.md @@ -8,7 +8,7 @@ schema: 2.0.0 # Get-Accessory ## SYNOPSIS -# Gets a list of Snipe-it Accessories +Gets a list of Snipe-it Accessories ## SYNTAX @@ -19,18 +19,18 @@ Get-Accessory [[-search] ] [[-company_id] ] [[-category_id] ] [[-id] ] [[-order] ] [[-limit] ### EXAMPLE 1 ``` -Get-Category -url "https://assets.example.com" -token "token..." +Get-Category -id 1 ``` ### EXAMPLE 2 ``` -Get-Category -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "Laptop" } +Get-Category -search "Laptop" ``` ## PARAMETERS @@ -142,7 +142,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +Url of Snipeit system, can be set using Set-Info command ```yaml Type: String diff --git a/docs/Get-Company.md b/docs/Get-Company.md index 1b13b0f..1ed64b8 100644 --- a/docs/Get-Company.md +++ b/docs/Get-Company.md @@ -8,7 +8,7 @@ schema: 2.0.0 # Get-Company ## SYNOPSIS -# Gets a list of Snipe-it Companies +Gets a list of Snipe-it Companies ## SYNTAX @@ -24,14 +24,18 @@ Get-Company [[-search] ] [[-id] ] [[-order] ] [[-limit] ### EXAMPLE 1 ``` -Get-Company -url "https://assets.example.com" -token "token..." +Get-Company ``` +Gets all companies + ### EXAMPLE 2 ``` -Get-Company -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "Company1" } +Get-Company -id 1 ``` +Gets specific company + ## PARAMETERS ### -all diff --git a/docs/Get-Component.md b/docs/Get-Component.md index 98723e7..16badb9 100644 --- a/docs/Get-Component.md +++ b/docs/Get-Component.md @@ -8,7 +8,7 @@ schema: 2.0.0 # Get-Component ## SYNOPSIS -# Gets a list of Snipe-it Components +Gets a list of Snipe-it Components ## SYNTAX @@ -25,14 +25,25 @@ Get-Component [[-search] ] [[-id] ] [[-category_id] ] [[- ### EXAMPLE 1 ``` -Get-Component -url "https://assets.example.com" -token "token..." +Get-Component ``` +Returns all components + ### EXAMPLE 2 ``` -Get-Component -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "Memory" } +Get-Component -search display ``` +Returns search results containeing string display + +### EXAMPLE 3 +``` +Get-Component -id +``` + +Returns specific component + ## PARAMETERS ### -all @@ -203,7 +214,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system,can be set using Set-Info command ```yaml Type: String diff --git a/docs/Get-CustomField.md b/docs/Get-CustomField.md index 0cadf98..a62a30a 100644 --- a/docs/Get-CustomField.md +++ b/docs/Get-CustomField.md @@ -8,7 +8,7 @@ schema: 2.0.0 # Get-CustomField ## SYNOPSIS -# Returns a list of all Snipe-IT custom fields +Returns a list of all Snipe-IT custom fields ## SYNTAX diff --git a/docs/Get-Department.md b/docs/Get-Department.md index f5fd892..7059601 100644 --- a/docs/Get-Department.md +++ b/docs/Get-Department.md @@ -8,7 +8,7 @@ schema: 2.0.0 # Get-Department ## SYNOPSIS -# Gets a list of Snipe-it Departments +Gets a list of Snipe-it Departments ## SYNTAX @@ -29,7 +29,12 @@ Get-Department -url "https://assets.example.com" -token "token..." ### EXAMPLE 2 ``` -Get-Department -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "Department1" } +Get-Department -search Department1 +``` + +### EXAMPLE 3 +``` +Get-Department -id 1 ``` ## PARAMETERS diff --git a/docs/Get-Fieldset.md b/docs/Get-Fieldset.md index 0f19150..8f7a118 100644 --- a/docs/Get-Fieldset.md +++ b/docs/Get-Fieldset.md @@ -8,7 +8,7 @@ schema: 2.0.0 # Get-Fieldset ## SYNOPSIS -# Gets a list of Snipe-it Fieldsets +Gets a list of Snipe-it Fieldsets ## SYNTAX diff --git a/docs/Get-Manufacturer.md b/docs/Get-Manufacturer.md index f6077f0..b1006bf 100644 --- a/docs/Get-Manufacturer.md +++ b/docs/Get-Manufacturer.md @@ -24,14 +24,18 @@ Get-Manufacturer [[-search] ] [[-id] ] [[-order] ] [[-li ### EXAMPLE 1 ``` -Get-Manufacturer -url "https://assets.example.com" -token "token..." +Get-Manufacturer -search HP ``` +Search all manufacturers for string HP + ### EXAMPLE 2 ``` -Get-Manufacturer -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "HP" } +Get-Manufacturer -id 3 ``` +Returns manufacturer with id 3 + ## PARAMETERS ### -all diff --git a/docs/Get-Model.md b/docs/Get-Model.md index c85c244..a3ad1ea 100644 --- a/docs/Get-Model.md +++ b/docs/Get-Model.md @@ -8,7 +8,7 @@ schema: 2.0.0 # Get-Model ## SYNOPSIS -# Gets a list of Snipe-it Models +Gets a list of Snipe-it Models ## SYNTAX @@ -24,12 +24,12 @@ Get-Model [[-search] ] [[-id] ] [[-order] ] [[-limit] ] [[-id] ] [[-order] ] [[ ### EXAMPLE 1 ``` -Get-Location -url "https://assets.example.com" -token "token..." +Get-Location -search Location1 ``` ### EXAMPLE 2 ``` -Get-Location -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "Location1" } +Get-Location -id 3 ``` ## PARAMETERS diff --git a/docs/Get-Status.md b/docs/Get-Status.md index 1f402b8..21672b6 100644 --- a/docs/Get-Status.md +++ b/docs/Get-Status.md @@ -8,7 +8,7 @@ schema: 2.0.0 # Get-Status ## SYNOPSIS -# Gets a list of Snipe-it Status Labels +Gets a list of Snipe-it Status Labels ## SYNTAX @@ -24,12 +24,12 @@ Get-Status [[-search] ] [[-id] ] [[-order] ] [[-limit] < ### EXAMPLE 1 ``` -Get-Status -url "https://assets.example.com" -token "token..." +Get-Status -search "Ready to Deploy" ``` ### EXAMPLE 2 ``` -Get-Status -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "Ready to Deploy" } +Get-Status -id 3 ``` ## PARAMETERS diff --git a/docs/Get-Supplier.md b/docs/Get-Supplier.md index 2ed9a81..2996b85 100644 --- a/docs/Get-Supplier.md +++ b/docs/Get-Supplier.md @@ -24,12 +24,12 @@ Get-Supplier [[-search] ] [[-id] ] [[-order] ] [[-limit] ### EXAMPLE 1 ``` -Get-Supplier -url "https://assets.example.com" -token "token..." +Get-Supplier -search MySupplier ``` ### EXAMPLE 2 ``` -Get-Supplier -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "MySupplier" } +Get-Supplier -id 2 ``` ## PARAMETERS diff --git a/docs/Get-User.md b/docs/Get-User.md index 5ecd014..61cf14e 100644 --- a/docs/Get-User.md +++ b/docs/Get-User.md @@ -26,12 +26,22 @@ Get-User [[-search] ] [[-id] ] [[-company_id] ] [[-locati ### EXAMPLE 1 ``` -Get-User -url "https://assets.example.com" -token "token..." +Get-User -search SomeSurname ``` ### EXAMPLE 2 ``` -Get-User -url "https://assets.example.com" -token "token..." | Where-Object {$_.username -eq "stephenm" } +Get-User -id 3 +``` + +### EXAMPLE 3 +``` +Get-User -username someuser +``` + +### EXAMPLE 4 +``` +Get-User -email user@somedomain.com ``` ## PARAMETERS @@ -97,7 +107,7 @@ Accept wildcard characters: False ``` ### -email -{{ Fill email Description }} +Search string for email field ```yaml Type: String @@ -234,7 +244,7 @@ Accept wildcard characters: False ``` ### -username -{{ Fill username Description }} +Search string for username field ```yaml Type: String diff --git a/docs/New-Asset.md b/docs/New-Asset.md index 247083a..f06a49c 100644 --- a/docs/New-Asset.md +++ b/docs/New-Asset.md @@ -1,7 +1,7 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS -online version: http://go.microsoft.com/fwlink/?LinkId=821589 +online version: schema: 2.0.0 --- @@ -30,11 +30,22 @@ Long description New-Asset -status_id 1 -model_id 1 -name "Machine1" ``` +Create asset with automatic tag if tag genaration is enabled on snipe-it, other wise without tag + ### EXAMPLE 2 ``` -New-Asset -status_id 1 -model_id 1 -name "Machine1" -customfields = @{ "_snipeit_os_5" = "Windows 10 Pro" } +New-Asset -status_id 1 -model_id 1 -name "Machine1" -asset_tag "DEV123" ``` +Specifying asset tag when creating asset + +### EXAMPLE 3 +``` +New-Asset -status_id 1 -model_id 1 -name "Machine1" -CustomValues = @{ "_snipeit_os_5" = "Windows 10 Pro" } +``` + +Using customfields when creating asset. + ## PARAMETERS ### -apiKey @@ -83,7 +94,8 @@ Accept wildcard characters: False ``` ### -customfields -Hastable of custom fields and extra fields that need passing through to Snipeit +Hastable of custom fields and extra fields that need passing through to Snipeit. +Use internal field names from snipeit .You can use Get-CustomField to get internal field names. ```yaml Type: Hashtable @@ -98,7 +110,7 @@ Accept wildcard characters: False ``` ### -model_id -Model ID of the asset, this can be got using Get-Model +Required Model ID of the asset, this can be got using Get-Model ```yaml Type: Int32 @@ -113,7 +125,7 @@ Accept wildcard characters: False ``` ### -name -Name of the Asset +Optional Name of the Asset ```yaml Type: String @@ -218,7 +230,7 @@ Accept wildcard characters: False ``` ### -status_id -Status ID of the asset, this can be got using Get-Status +Required Status ID of the asset, this can be got using Get-Status ```yaml Type: Int32 diff --git a/docs/New-AssetMaintenance.md b/docs/New-AssetMaintenance.md index fb9553a..72782c8 100644 --- a/docs/New-AssetMaintenance.md +++ b/docs/New-AssetMaintenance.md @@ -8,7 +8,7 @@ schema: 2.0.0 # New-AssetMaintenance ## SYNOPSIS -{{ Fill in the Synopsis }} +Add a new Asset maintenence to Snipe-it asset system ## SYNTAX @@ -20,21 +20,19 @@ New-AssetMaintenance [-asset_id] [-supplier_id] [-asset_maintena ``` ## DESCRIPTION -{{ Fill in the Description }} +Long description ## EXAMPLES -### Example 1 -```powershell -PS C:\> {{ Add example code here }} +### EXAMPLE 1 +``` +New-AssetMaintenence -asset_id 1 -supplier_id 1 -title "replace keyboard" -start_date 2021-01-01 ``` - -{{ Add example description here }} ## PARAMETERS ### -apiKey -{{ Fill apiKey Description }} +Users API Key for Snipeit, can be set using Set-Info command ```yaml Type: String @@ -42,14 +40,14 @@ Parameter Sets: (All) Aliases: Required: True -Position: 10 +Position: 11 Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -asset_id -{{ Fill asset_id Description }} +Required ID of the asset, this can be got using Get-Asset ```yaml Type: Int32 @@ -57,8 +55,8 @@ Parameter Sets: (All) Aliases: Required: True -Position: 0 -Default value: None +Position: 1 +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` @@ -72,7 +70,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 2 +Position: 3 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -87,14 +85,14 @@ Parameter Sets: (All) Aliases: Required: False -Position: 5 +Position: 6 Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -cost -{{ Fill cost Description }} +Optional cost ```yaml Type: Decimal @@ -102,14 +100,14 @@ Parameter Sets: (All) Aliases: Required: False -Position: 7 -Default value: None +Position: 8 +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` ### -is_warranty -{{ Fill is_warranty Description }} +Optional Maintenance done under warranty ```yaml Type: Boolean @@ -117,14 +115,14 @@ Parameter Sets: (All) Aliases: Required: False -Position: 6 -Default value: None +Position: 7 +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` ### -notes -{{ Fill notes Description }} +Optional cost ```yaml Type: String @@ -132,20 +130,50 @@ Parameter Sets: (All) Aliases: Required: False -Position: 8 +Position: 9 Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -start_date -{{ Fill start_date Description }} +Required start date ```yaml Type: DateTime Parameter Sets: (All) Aliases: +Required: True +Position: 5 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -supplier_id +Required maintenance supplier + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -title +Required Title of maintenance + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + Required: True Position: 4 Default value: None @@ -153,38 +181,8 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -supplier_id -{{ Fill supplier_id Description }} - -```yaml -Type: Int32 -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -title -{{ Fill title Description }} - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -url -{{ Fill url Description }} +URL of Snipeit system, can be set using Set-Info command ```yaml Type: String @@ -192,7 +190,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 9 +Position: 10 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -234,11 +232,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### None - ## OUTPUTS -### System.Object ## NOTES ## RELATED LINKS diff --git a/docs/New-Category.md b/docs/New-Category.md index 6805008..140e5f6 100644 --- a/docs/New-Category.md +++ b/docs/New-Category.md @@ -8,7 +8,7 @@ schema: 2.0.0 # New-Category ## SYNOPSIS -# Create a new Snipe-IT Category +Create a new Snipe-IT Category ## SYNTAX diff --git a/docs/New-Component.md b/docs/New-Component.md index d7b5280..a3d6a17 100644 --- a/docs/New-Component.md +++ b/docs/New-Component.md @@ -1,14 +1,14 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS -online version: http://go.microsoft.com/fwlink/?LinkId=821589 +online version: schema: 2.0.0 --- # New-Component ## SYNOPSIS -Short description +Create a new component ## SYNTAX @@ -19,7 +19,7 @@ New-Component [-name] [-category_id] [-qty] [[-company ``` ## DESCRIPTION -Long description +Createa new componen on Snipe-It system ## EXAMPLES @@ -31,7 +31,7 @@ An example ## PARAMETERS ### -apiKey -Parameter description +User's API Key for Snipeit, can be set using Set-Info command ```yaml Type: String @@ -46,7 +46,7 @@ Accept wildcard characters: False ``` ### -category_id -Parameter description +ID number of category ```yaml Type: Int32 @@ -55,7 +55,7 @@ Aliases: Required: True Position: 2 -Default value: None +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` @@ -76,7 +76,7 @@ Accept wildcard characters: False ``` ### -location_id -{{ Fill location_id Description }} +ID number of the location the accessory is assigned to ```yaml Type: Int32 @@ -91,7 +91,7 @@ Accept wildcard characters: False ``` ### -name -Parameter description +Component name ```yaml Type: String @@ -106,7 +106,7 @@ Accept wildcard characters: False ``` ### -purchase_cost -{{ Fill purchase_cost Description }} +Cost of item being purchased. ```yaml Type: Single @@ -121,7 +121,7 @@ Accept wildcard characters: False ``` ### -purchase_date -{{ Fill purchase_date Description }} +Date accessory was purchased ```yaml Type: DateTime @@ -136,7 +136,7 @@ Accept wildcard characters: False ``` ### -qty -Parameter description +Quantity of the components you have ```yaml Type: String @@ -151,7 +151,7 @@ Accept wildcard characters: False ``` ### -url -Parameter description +URL of Snipeit system, can be set using Set-Info command ```yaml Type: String diff --git a/docs/New-Department.md b/docs/New-Department.md index 1149c8f..fdf1cf4 100644 --- a/docs/New-Department.md +++ b/docs/New-Department.md @@ -1,14 +1,14 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS -online version: http://go.microsoft.com/fwlink/?LinkId=821589 +online version: schema: 2.0.0 --- # New-Department ## SYNOPSIS -Short description +Creates a department ## SYNTAX @@ -18,19 +18,19 @@ New-Department [-name] [[-company_id] ] [[-location_id] ] ``` ## DESCRIPTION -Long description +Creates a new department on Snipe-It system ## EXAMPLES ### EXAMPLE 1 ``` -An example +New-Department -name "Department1" -company_id 1 -localtion_id 1 -manager_id 3 ``` ## PARAMETERS ### -apiKey -Parameter description +Users API Key for Snipeit, can be set using Set-Info command ```yaml Type: String @@ -45,7 +45,7 @@ Accept wildcard characters: False ``` ### -company_id -{{Fill company_id Description}} +ID number of company ```yaml Type: Int32 @@ -54,13 +54,13 @@ Aliases: Required: False Position: 2 -Default value: None +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` ### -location_id -{{Fill location_id Description}} +ID number of location ```yaml Type: Int32 @@ -69,13 +69,13 @@ Aliases: Required: False Position: 3 -Default value: None +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` ### -manager_id -{{Fill manager_id Description}} +ID number of manager ```yaml Type: Int32 @@ -84,13 +84,13 @@ Aliases: Required: False Position: 4 -Default value: None +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` ### -name -Parameter description +Department Name ```yaml Type: String @@ -120,7 +120,7 @@ Accept wildcard characters: False ``` ### -url -Parameter description +URL of Snipeit system, can be set using Set-Info command ```yaml Type: String @@ -173,6 +173,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS ## NOTES -General notes ## RELATED LINKS diff --git a/docs/New-License.md b/docs/New-License.md index a3839b7..5e8c316 100644 --- a/docs/New-License.md +++ b/docs/New-License.md @@ -8,7 +8,7 @@ schema: 2.0.0 # New-License ## SYNOPSIS -{{ Fill in the Synopsis }} +Creates a licence ## SYNTAX @@ -22,21 +22,19 @@ New-License [-name] [-seats] [[-category_id] ] [[-compan ``` ## DESCRIPTION -{{ Fill in the Description }} +Creates a new licence on Snipe-It system ## EXAMPLES -### Example 1 -```powershell -PS C:\> {{ Add example code here }} +### EXAMPLE 1 +``` +New-Licence -name "License" -seats 3 -company_id 1 ``` - -{{ Add example description here }} ## PARAMETERS ### -apiKey -{{ Fill apiKey Description }} +Users API Key for Snipeit, can be set using Set-Info command ```yaml Type: String @@ -44,7 +42,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 18 +Position: 19 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -59,14 +57,14 @@ Parameter Sets: (All) Aliases: Required: False -Position: 2 -Default value: None +Position: 3 +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` ### -company_id -{{ Fill company_id Description }} +Id number of company license belongs to ```yaml Type: Int32 @@ -74,35 +72,20 @@ Parameter Sets: (All) Aliases: Required: False -Position: 3 -Default value: None +Position: 4 +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` ### -expiration_date -{{ Fill expiration_date Description }} +Date of license expiration ```yaml Type: DateTime Parameter Sets: (All) Aliases: -Required: False -Position: 4 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -license_email -{{ Fill license_email Description }} - -```yaml -Type: MailAddress -Parameter Sets: (All) -Aliases: - Required: False Position: 5 Default value: None @@ -110,11 +93,11 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -license_name -{{ Fill license_name Description }} +### -license_email +Email address associated with license ```yaml -Type: String +Type: MailAddress Parameter Sets: (All) Aliases: @@ -125,11 +108,11 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -maintained -{{ Fill maintained Description }} +### -license_name +Name of license contact person ```yaml -Type: Boolean +Type: String Parameter Sets: (All) Aliases: @@ -140,8 +123,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -maintained +Maintained status of license + +```yaml +Type: Boolean +Parameter Sets: (All) +Aliases: + +Required: False +Position: 8 +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -manufacturer_id -{{ Fill manufacturer_id Description }} +ID number of manufacturer of license. ```yaml Type: Int32 @@ -149,14 +147,14 @@ Parameter Sets: (All) Aliases: Required: False -Position: 8 -Default value: None +Position: 9 +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` ### -name -{{ Fill name Description }} +Name of license being created ```yaml Type: String @@ -164,29 +162,14 @@ Parameter Sets: (All) Aliases: Required: True -Position: 0 +Position: 1 Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -notes -{{ Fill notes Description }} - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 9 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -order_number -{{ Fill order_number Description }} +License Notes ```yaml Type: String @@ -200,11 +183,11 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -purchase_cost -{{ Fill purchase_cost Description }} +### -order_number +Order number of license purchase ```yaml -Type: Single +Type: String Parameter Sets: (All) Aliases: @@ -215,26 +198,26 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -purchase_date -{{ Fill purchase_date Description }} +### -purchase_cost +Cost of license ```yaml -Type: DateTime +Type: Single Parameter Sets: (All) Aliases: Required: False Position: 12 -Default value: None +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` -### -reassignable -{{ Fill reassignable Description }} +### -purchase_date +Date of license purchase ```yaml -Type: Boolean +Type: DateTime Parameter Sets: (All) Aliases: @@ -245,8 +228,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -reassignable +Is license reassignable? + +```yaml +Type: Boolean +Parameter Sets: (All) +Aliases: + +Required: False +Position: 14 +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -seats -{{ Fill seats Description }} +Number of license seats owned. ```yaml Type: Int32 @@ -254,35 +252,20 @@ Parameter Sets: (All) Aliases: Required: True -Position: 1 -Default value: None +Position: 2 +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` ### -serial -{{ Fill serial Description }} +Serialnumber of license ```yaml Type: String Parameter Sets: (All) Aliases: -Required: False -Position: 14 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -supplier_id -{{ Fill supplier_id Description }} - -```yaml -Type: Int32 -Parameter Sets: (All) -Aliases: - Required: False Position: 15 Default value: None @@ -290,8 +273,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -supplier_id +ID number of license supplier + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 16 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -termination_date -{{ Fill termination_date Description }} +Termination date for license. ```yaml Type: DateTime @@ -299,14 +297,14 @@ Parameter Sets: (All) Aliases: Required: False -Position: 16 +Position: 17 Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -url -{{ Fill url Description }} +URL of Snipeit system, can be set using Set-Info command ```yaml Type: String @@ -314,7 +312,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 17 +Position: 18 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -356,11 +354,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### None - ## OUTPUTS -### System.Object ## NOTES ## RELATED LINKS diff --git a/docs/New-Location.md b/docs/New-Location.md index 9e2c7ae..64ad41d 100644 --- a/docs/New-Location.md +++ b/docs/New-Location.md @@ -1,14 +1,14 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS -online version: http://go.microsoft.com/fwlink/?LinkId=821589 +online version: schema: 2.0.0 --- # New-Location ## SYNOPSIS -Add a new Model to Snipe-it asset system +Add a new Location to Snipe-it asset system ## SYNTAX @@ -25,13 +25,13 @@ Long description ### EXAMPLE 1 ``` -New-Model -name "DL380" -manufacturer_id 2 -fieldset_id 2 -category_id 1 +New-Location -name "Room 1" -address "123 Asset Street" -parent_id 14 ``` ## PARAMETERS ### -address -{{Fill address Description}} +Address line 1 of the location ```yaml Type: String @@ -46,7 +46,7 @@ Accept wildcard characters: False ``` ### -address2 -{{Fill address2 Description}} +Address line 2 of the location ```yaml Type: String @@ -76,7 +76,7 @@ Accept wildcard characters: False ``` ### -country -{{Fill country Description}} +Country of the location ```yaml Type: String @@ -121,7 +121,7 @@ Accept wildcard characters: False ``` ### -name -Name of the Asset Model +Name of the Location ```yaml Type: String @@ -151,7 +151,7 @@ Accept wildcard characters: False ``` ### -state -{{Fill state Description}} +Address State of the location ```yaml Type: String @@ -181,7 +181,7 @@ Accept wildcard characters: False ``` ### -zip -{{Fill zip Description}} +The zip code of the location ```yaml Type: String diff --git a/docs/New-Manufacturer.md b/docs/New-Manufacturer.md index 24c00c9..5d61fbd 100644 --- a/docs/New-Manufacturer.md +++ b/docs/New-Manufacturer.md @@ -1,7 +1,7 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS -online version: http://go.microsoft.com/fwlink/?LinkId=821589 +online version: schema: 2.0.0 --- diff --git a/docs/New-Model.md b/docs/New-Model.md index 58a2e17..18e13d8 100644 --- a/docs/New-Model.md +++ b/docs/New-Model.md @@ -1,7 +1,7 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS -online version: http://go.microsoft.com/fwlink/?LinkId=821589 +online version: schema: 2.0.0 --- @@ -106,7 +106,7 @@ Accept wildcard characters: False ``` ### -model_number -{{ Fill model_number Description }} +Model number of the Asset Model ```yaml Type: String diff --git a/docs/New-User.md b/docs/New-User.md index 4e4cc92..32ce142 100644 --- a/docs/New-User.md +++ b/docs/New-User.md @@ -1,14 +1,14 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS -online version: http://go.microsoft.com/fwlink/?LinkId=821589 +online version: schema: 2.0.0 --- # New-User ## SYNOPSIS -Short description +Creates a new user ## SYNTAX @@ -21,15 +21,17 @@ New-User [-first_name] [-last_name] [-username] [[-pa ``` ## DESCRIPTION -Long description +Creates a new user to Snipe-IT system ## EXAMPLES ### EXAMPLE 1 ``` -An example +New-user -fist_name It -lastname Snipe -username snipeit -activated $false -company_id 1 -location_id 1 -department_id 1 ``` +Creates new a new user who can't login to system + ## PARAMETERS ### -activated @@ -48,7 +50,7 @@ Accept wildcard characters: False ``` ### -apiKey -Parameter description +User's API Key for Snipeit, can be set using Set-Info command ```yaml Type: String @@ -63,7 +65,7 @@ Accept wildcard characters: False ``` ### -company_id -Parameter description +ID number of company users belogs to ```yaml Type: Int32 @@ -78,7 +80,7 @@ Accept wildcard characters: False ``` ### -department_id -Parameter description +ID number of department ```yaml Type: Int32 @@ -93,7 +95,7 @@ Accept wildcard characters: False ``` ### -email -Parameter description +email address ```yaml Type: String @@ -108,7 +110,7 @@ Accept wildcard characters: False ``` ### -employee_num -Parameter description +Employeenumber ```yaml Type: String @@ -123,7 +125,7 @@ Accept wildcard characters: False ``` ### -first_name -Parameter description +Users first name ```yaml Type: String @@ -138,7 +140,7 @@ Accept wildcard characters: False ``` ### -jobtitle -Parameter description +Users job tittle ```yaml Type: String @@ -153,7 +155,7 @@ Accept wildcard characters: False ``` ### -last_name -Parameter description +Users last name ```yaml Type: String @@ -183,7 +185,7 @@ Accept wildcard characters: False ``` ### -location_id -Parameter description +ID number of localtion ```yaml Type: Int32 @@ -198,7 +200,7 @@ Accept wildcard characters: False ``` ### -manager_id -Parameter description +ID number of manager ```yaml Type: Int32 @@ -213,7 +215,7 @@ Accept wildcard characters: False ``` ### -notes -Parameter description +User Notes ```yaml Type: String @@ -243,7 +245,7 @@ Accept wildcard characters: False ``` ### -phone -Parameter description +Phone number ```yaml Type: String @@ -258,7 +260,7 @@ Accept wildcard characters: False ``` ### -url -Parameter description +URL of Snipeit system, can be set using Set-Info command ```yaml Type: String @@ -273,7 +275,7 @@ Accept wildcard characters: False ``` ### -username -Parameter description +Username for user ```yaml Type: String diff --git a/docs/Remove-Asset.md b/docs/Remove-Asset.md index a66b6b4..4e9c4fd 100644 --- a/docs/Remove-Asset.md +++ b/docs/Remove-Asset.md @@ -23,13 +23,13 @@ Long description ### EXAMPLE 1 ``` -Remove-Asset -ID 44 -url $url -apiKey $secret -Verbose +Remove-Asset -ID 44 -Verbose ``` ## PARAMETERS ### -APIKey -{{ Fill APIKey Description }} +User's API Key for Snipeit, can be set using Set-Info command ```yaml Type: String @@ -59,7 +59,7 @@ Accept wildcard characters: False ``` ### -URL -{{ Fill URL Description }} +URL of Snipeit system, can be set using Set-Info command ```yaml Type: String diff --git a/docs/Remove-User.md b/docs/Remove-User.md index 52d3db8..5e28ac0 100644 --- a/docs/Remove-User.md +++ b/docs/Remove-User.md @@ -29,7 +29,7 @@ Remove-User -ID 44 -url $url -apiKey $secret -Verbose ## PARAMETERS ### -APIKey -{{ Fill APIKey Description }} +User's API Key for Snipeit, can be set using Set-Info command ```yaml Type: String @@ -59,7 +59,7 @@ Accept wildcard characters: False ``` ### -URL -{{ Fill URL Description }} +URL of Snipeit system, can be set using Set-Info command ```yaml Type: String diff --git a/docs/Set-Accessory.md b/docs/Set-Accessory.md index 2bd3450..1a6353e 100644 --- a/docs/Set-Accessory.md +++ b/docs/Set-Accessory.md @@ -8,33 +8,31 @@ schema: 2.0.0 # Set-Accessory ## SYNOPSIS -{{ Fill in the Synopsis }} +Updates accessory on Snipe-It system ## SYNTAX ``` Set-Accessory [-id] [[-name] ] [[-qty] ] [[-category_id] ] [[-company_id] ] [[-manufacturer_id] ] [[-order_number] ] [[-purchase_cost] ] - [[-purchase_date] ] [[-requestable] ] [[-supplier_id] ] [-url] + [[-purchase_date] ] [[-min_qty] ] [[-supplier_id] ] [-url] [-apiKey] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION -{{ Fill in the Description }} +Updates accessory on Snipe-It system ## EXAMPLES -### Example 1 -```powershell -PS C:\> {{ Add example code here }} +### EXAMPLE 1 +``` +Set-Accessory -id 1 -qty 3 ``` - -{{ Add example description here }} ## PARAMETERS ### -apiKey -{{ Fill apiKey Description }} +Users API Key for Snipeit, can be set using Set-Info command ```yaml Type: String @@ -42,29 +40,14 @@ Parameter Sets: (All) Aliases: Required: True -Position: 12 +Position: 13 Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -category_id -{{ Fill category_id Description }} - -```yaml -Type: Int32 -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -company_id -{{ Fill company_id Description }} +ID number of the category the accessory belongs to ```yaml Type: Int32 @@ -73,7 +56,22 @@ Aliases: Required: False Position: 4 -Default value: None +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -company_id +ID Number of the company the accessory is assigned to + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 5 +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` @@ -87,92 +85,47 @@ Parameter Sets: (All) Aliases: Required: True -Position: 0 -Default value: None +Position: 1 +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` ### -manufacturer_id -{{ Fill manufacturer_id Description }} +ID number of the manufacturer for this accessory. ```yaml Type: Int32 Parameter Sets: (All) Aliases: -Required: False -Position: 5 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -name -{{ Fill name Description }} - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -order_number -{{ Fill order_number Description }} - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - Required: False Position: 6 -Default value: None +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` -### -purchase_cost -{{ Fill purchase_cost Description }} +### -min_qty +Min quantity of the accessory before alert is triggered ```yaml -Type: Single +Type: Boolean Parameter Sets: (All) Aliases: Required: False -Position: 7 -Default value: None +Position: 10 +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` -### -purchase_date -{{ Fill purchase_date Description }} +### -name +ID number of Accessory on Snipe-It system ```yaml -Type: DateTime -Parameter Sets: (All) -Aliases: - -Required: False -Position: 8 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -qty -{{ Fill qty Description }} - -```yaml -Type: Int32 +Type: String Parameter Sets: (All) Aliases: @@ -183,11 +136,41 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -requestable -{{ Fill requestable Description }} +### -order_number +Order number for this accessory. ```yaml -Type: Boolean +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 7 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -purchase_cost +Cost of item being purchased. + +```yaml +Type: Single +Parameter Sets: (All) +Aliases: + +Required: False +Position: 8 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -purchase_date +Date accessory was purchased + +```yaml +Type: DateTime Parameter Sets: (All) Aliases: @@ -198,8 +181,8 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -supplier_id -{{ Fill supplier_id Description }} +### -qty +Quantity of the accessory you have ```yaml Type: Int32 @@ -207,14 +190,29 @@ Parameter Sets: (All) Aliases: Required: False -Position: 10 -Default value: None +Position: 3 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -supplier_id +ID number of the supplier for this accessory + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 11 +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` ### -url -{{ Fill url Description }} +URL of Snipeit system, can be set using Set-Info command ```yaml Type: String @@ -222,7 +220,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 11 +Position: 12 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -264,11 +262,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### None - ## OUTPUTS -### System.Object ## NOTES ## RELATED LINKS diff --git a/docs/Set-Asset.md b/docs/Set-Asset.md index ae33fe7..056d650 100644 --- a/docs/Set-Asset.md +++ b/docs/Set-Asset.md @@ -1,14 +1,14 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS -online version: http://go.microsoft.com/fwlink/?LinkId=821589 +online version: schema: 2.0.0 --- # Set-Asset ## SYNOPSIS -Update a Asset in the Snipe-it asset system +Update a specific Asset in the Snipe-it asset system ## SYNTAX @@ -53,7 +53,8 @@ Accept wildcard characters: False ``` ### -archived -Whether or not the asset is archived. Archived assets cannot be checked out and do not show up in the deployable asset screens +Whether or not the asset is archived. +Archived assets cannot be checked out and do not show up in the deployable asset screens ```yaml Type: Boolean @@ -158,7 +159,7 @@ Accept wildcard characters: False ``` ### -Name -Name of the Asset +Asset name ```yaml Type: String diff --git a/docs/Set-AssetOwner.md b/docs/Set-AssetOwner.md index ddb6176..a67e54a 100644 --- a/docs/Set-AssetOwner.md +++ b/docs/Set-AssetOwner.md @@ -1,38 +1,37 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS -online version: http://go.microsoft.com/fwlink/?LinkId=821589 +online version: schema: 2.0.0 --- # Set-AssetOwner ## SYNOPSIS -{{Fill in the Synopsis}} +Checkout asset ## SYNTAX ``` -Set-AssetOwner [-id] [-assigned_id] [[-checkout_to_type] ] [-url] +Set-AssetOwner [-id] [-assigned_id] [[-checkout_to_type] ] [[-name] ] + [[-note] ] [[-expected_checkin] ] [[-checkout_at] ] [-url] [-apiKey] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION -{{Fill in the Description}} +Checkout asset to user/localtion/asset ## EXAMPLES -### Example 1 +### EXAMPLE 1 ``` -PS C:\> {{ Add example code here }} +Remove-User -ID 44 -url $url -apiKey $secret -Verbose ``` -{{ Add example description here }} - ## PARAMETERS ### -apiKey -{{Fill apiKey Description}} +User's API Key for Snipeit, can be set using Set-Info command ```yaml Type: String @@ -40,14 +39,74 @@ Parameter Sets: (All) Aliases: Required: True -Position: 4 +Position: 9 Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -assigned_id -{{Fill assigned_id Description}} +Id of target user , location or asset + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -checkout_at +Optional date to override the checkout time of now + +```yaml +Type: DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: 7 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -checkout_to_type +{{ Fill checkout_to_type Description }} + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: User +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -expected_checkin +Optional date the asset is expected to be checked in + +```yaml +Type: DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: 6 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -id +Unique ID For asset to checkout ```yaml Type: Int32 @@ -56,44 +115,46 @@ Aliases: Required: True Position: 1 -Default value: None +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` -### -checkout_to_type -{{Fill checkout_to_type Description}} +### -name +Optional new asset name. +This is useful for changing the asset's name on new checkout, +for example, an asset that was named "Anna's Macbook Pro" could be renamed on the fly +when it's checked out to Elizabeth, to "Beth's Macbook Pro" ```yaml Type: String Parameter Sets: (All) Aliases: -Accepted values: location, asset, user Required: False -Position: 2 +Position: 4 Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -id -{{Fill id Description}} +### -note +Notes about checkout ```yaml -Type: Int32 +Type: String Parameter Sets: (All) Aliases: -Required: True -Position: 0 +Required: False +Position: 5 Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -url -{{Fill url Description}} +URL of Snipeit system, can be set using Set-Info command ```yaml Type: String @@ -101,7 +162,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 3 +Position: 8 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -143,11 +204,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### None - ## OUTPUTS -### System.Object ## NOTES ## RELATED LINKS diff --git a/docs/Set-Component.md b/docs/Set-Component.md index 43370e3..21ec356 100644 --- a/docs/Set-Component.md +++ b/docs/Set-Component.md @@ -1,38 +1,37 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS -online version: http://go.microsoft.com/fwlink/?LinkId=821589 +online version: schema: 2.0.0 --- # Set-Component ## SYNOPSIS -{{Fill in the Synopsis}} +Updates component ## SYNTAX ``` -Set-Component [-id] [-qty] [-url] [-apiKey] [-WhatIf] [-Confirm] - [] +Set-Component [-id] [-qty] [[-name] ] [[-company_id] ] + [[-location_id] ] [[-purchase_date] ] [[-purchase_cost] ] [-url] + [-apiKey] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION -{{Fill in the Description}} +Updates component on Snipe-It system ## EXAMPLES -### Example 1 +### EXAMPLE 1 ``` -PS C:\> {{ Add example code here }} +An example ``` -{{ Add example description here }} - ## PARAMETERS ### -apiKey -{{Fill apiKey Description}} +User's API Key for Snipeit, can be set using Set-Info command ```yaml Type: String @@ -40,29 +39,29 @@ Parameter Sets: (All) Aliases: Required: True -Position: 3 +Position: 9 Default value: None Accept pipeline input: False Accept wildcard characters: False ``` +### -company_id +{{ Fill company_id Description }} + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -id -{{Fill id Description}} - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -qty -{{Fill qty Description}} +ID number of name ```yaml Type: String @@ -76,8 +75,68 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -url -{{Fill url Description}} +### -location_id +ID number of the location the accessory is assigned to + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 5 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -name +Component name + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -purchase_cost +Cost of item being purchased. + +```yaml +Type: Single +Parameter Sets: (All) +Aliases: + +Required: False +Position: 7 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -purchase_date +Date accessory was purchased + +```yaml +Type: DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: 6 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -qty +Quantity of the components you have ```yaml Type: String @@ -91,6 +150,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -url +URL of Snipeit system, can be set using Set-Info command + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 8 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Confirm Prompts you for confirmation before running the cmdlet. @@ -127,11 +201,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### None - ## OUTPUTS -### System.Object ## NOTES +General notes ## RELATED LINKS diff --git a/docs/Set-Info.md b/docs/Set-Info.md index e70ef64..514c5dd 100644 --- a/docs/Set-Info.md +++ b/docs/Set-Info.md @@ -1,14 +1,14 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS -online version: http://go.microsoft.com/fwlink/?LinkId=821589 +online version: schema: 2.0.0 --- # Set-Info ## SYNOPSIS -{{Fill in the Synopsis}} +Sets authetication information ## SYNTAX @@ -17,27 +17,40 @@ Set-Info [[-url] ] [[-apiKey] ] [] ``` ## DESCRIPTION -{{Fill in the Description}} +Set apikey and url user to connect Snipe-It system ## EXAMPLES -### Example 1 +### EXAMPLE 1 ``` -PS C:\> {{ Add example code here }} +Set-Info -url $url -apiKey -Verbose ``` -{{ Add example description here }} - ## PARAMETERS ### -apiKey -{{Fill apiKey Description}} +User's API Key for Snipeit, can be set using Set-Info command ```yaml Type: String Parameter Sets: (All) Aliases: +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -url +URL of Snipeit system, can be set using Set-Info command + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + Required: False Position: 1 Default value: None @@ -45,31 +58,13 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -url -{{Fill url Description}} - -```yaml -Type: Uri -Parameter Sets: (All) -Aliases: - -Required: False -Position: 0 -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 -### None - ## OUTPUTS -### System.Object ## NOTES ## RELATED LINKS diff --git a/docs/Set-License.md b/docs/Set-License.md index 2786d92..95fc2a2 100644 --- a/docs/Set-License.md +++ b/docs/Set-License.md @@ -8,7 +8,7 @@ schema: 2.0.0 # Set-License ## SYNOPSIS -{{ Fill in the Synopsis }} +Updates a licence ## SYNTAX @@ -22,21 +22,19 @@ Set-License [-id] [[-name] ] [[-seats] ] [[-category_id] ``` ## DESCRIPTION -{{ Fill in the Description }} +Updates licence on Snipe-It system ## EXAMPLES -### Example 1 -```powershell -PS C:\> {{ Add example code here }} +### EXAMPLE 1 +``` +Set-Licence -name "License" -seats 3 -company_id 1 ``` - -{{ Add example description here }} ## PARAMETERS ### -apiKey -{{ Fill apiKey Description }} +Users API Key for Snipeit, can be set using Set-Info command ```yaml Type: String @@ -44,7 +42,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 19 +Position: 20 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -59,62 +57,32 @@ Parameter Sets: (All) Aliases: Required: False -Position: 3 -Default value: None +Position: 4 +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` ### -company_id -{{ Fill company_id Description }} +Id number of company license belongs to ```yaml Type: Int32 Parameter Sets: (All) Aliases: -Required: False -Position: 4 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -expiration_date -{{ Fill expiration_date Description }} - -```yaml -Type: DateTime -Parameter Sets: (All) -Aliases: - Required: False Position: 5 -Default value: None +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` -### -id -{{ Fill id Description }} +### -expiration_date +Date of license expiration ```yaml -Type: Int32 -Parameter Sets: (All) -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -license_email -{{ Fill license_email Description }} - -```yaml -Type: MailAddress +Type: DateTime Parameter Sets: (All) Aliases: @@ -125,11 +93,26 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -license_name -{{ Fill license_name Description }} +### -id +ID number of licence ```yaml -Type: String +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -license_email +Email address associated with license + +```yaml +Type: MailAddress Parameter Sets: (All) Aliases: @@ -140,11 +123,11 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -maintained -{{ Fill maintained Description }} +### -license_name +Name of license contact person ```yaml -Type: Boolean +Type: String Parameter Sets: (All) Aliases: @@ -155,8 +138,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -maintained +Maintained status of license + +```yaml +Type: Boolean +Parameter Sets: (All) +Aliases: + +Required: False +Position: 9 +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -manufacturer_id -{{ Fill manufacturer_id Description }} +ID number of manufacturer of license. ```yaml Type: Int32 @@ -164,14 +162,14 @@ Parameter Sets: (All) Aliases: Required: False -Position: 9 -Default value: None +Position: 10 +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` ### -name -{{ Fill name Description }} +Name of license ```yaml Type: String @@ -179,29 +177,14 @@ Parameter Sets: (All) Aliases: Required: False -Position: 1 +Position: 2 Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -notes -{{ Fill notes Description }} - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 10 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -order_number -{{ Fill order_number Description }} +License Notes ```yaml Type: String @@ -215,11 +198,11 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -purchase_cost -{{ Fill purchase_cost Description }} +### -order_number +Order number of license purchase ```yaml -Type: Single +Type: String Parameter Sets: (All) Aliases: @@ -230,26 +213,26 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -purchase_date -{{ Fill purchase_date Description }} +### -purchase_cost +Cost of license ```yaml -Type: DateTime +Type: Single Parameter Sets: (All) Aliases: Required: False Position: 13 -Default value: None +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` -### -reassignable -{{ Fill reassignable Description }} +### -purchase_date +Date of license purchase ```yaml -Type: Boolean +Type: DateTime Parameter Sets: (All) Aliases: @@ -260,44 +243,44 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -seats -{{ Fill seats Description }} +### -reassignable +Is license reassignable? ```yaml -Type: Int32 -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -serial -{{ Fill serial Description }} - -```yaml -Type: String +Type: Boolean Parameter Sets: (All) Aliases: Required: False Position: 15 -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` -### -supplier_id -{{ Fill supplier_id Description }} +### -seats +Number of license seats owned. ```yaml Type: Int32 Parameter Sets: (All) Aliases: +Required: False +Position: 3 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -serial +Serialnumber of license + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + Required: False Position: 16 Default value: None @@ -305,8 +288,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -supplier_id +ID number of license supplier + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 17 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -termination_date -{{ Fill termination_date Description }} +Termination date for license. ```yaml Type: DateTime @@ -314,14 +312,14 @@ Parameter Sets: (All) Aliases: Required: False -Position: 17 +Position: 18 Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -url -{{ Fill url Description }} +URL of Snipeit system, can be set using Set-Info command ```yaml Type: String @@ -329,7 +327,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 18 +Position: 19 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -371,11 +369,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### None - ## OUTPUTS -### System.Object ## NOTES ## RELATED LINKS diff --git a/docs/Set-Model.md b/docs/Set-Model.md index d68c438..2e9df08 100644 --- a/docs/Set-Model.md +++ b/docs/Set-Model.md @@ -8,7 +8,7 @@ schema: 2.0.0 # Set-Model ## SYNOPSIS -{{ Fill in the Synopsis }} +Updates Model on Snipe-it asset system ## SYNTAX @@ -19,21 +19,19 @@ Set-Model [-id] [[-name] ] [[-model_number] ] [[-categor ``` ## DESCRIPTION -{{ Fill in the Description }} +Updates Model on Snipe-it asset system ## EXAMPLES -### Example 1 -```powershell -PS C:\> {{ Add example code here }} +### EXAMPLE 1 +``` +New-Model -name "DL380" -manufacturer_id 2 -fieldset_id 2 -category_id 1 ``` - -{{ Add example description here }} ## PARAMETERS ### -apiKey -{{ Fill apiKey Description }} +Users API Key for Snipeit, can be set using Set-Info command ```yaml Type: String @@ -41,14 +39,14 @@ Parameter Sets: (All) Aliases: Required: True -Position: 8 +Position: 9 Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -category_id -{{ Fill category_id Description }} +Category ID that the asset belongs to this can be got using Get-Category ```yaml Type: Int32 @@ -56,8 +54,8 @@ Parameter Sets: (All) Aliases: Required: False -Position: 3 -Default value: None +Position: 4 +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` @@ -71,8 +69,8 @@ Parameter Sets: (All) Aliases: fieldset_id Required: False -Position: 6 -Default value: None +Position: 7 +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` @@ -86,14 +84,14 @@ Parameter Sets: (All) Aliases: Required: False -Position: 5 -Default value: None +Position: 6 +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` ### -id -{{ Fill id Description }} +ID number of the Asset Model ```yaml Type: Int32 @@ -101,14 +99,14 @@ Parameter Sets: (All) Aliases: Required: True -Position: 0 -Default value: None +Position: 1 +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` ### -manufacturer_id -{{ Fill manufacturer_id Description }} +Manufacturer ID that the asset belongs to this can be got using Get-Manufacturer ```yaml Type: Int32 @@ -116,14 +114,29 @@ Parameter Sets: (All) Aliases: Required: False -Position: 4 -Default value: None +Position: 5 +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` ### -model_number -{{ Fill model_number Description }} +Model number of the Asset Model + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -name +Name of the Asset Model ```yaml Type: String @@ -137,23 +150,8 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -name -{{ Fill name Description }} - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -url -{{ Fill url Description }} +URL of Snipeit system, can be set using Set-Info command ```yaml Type: String @@ -161,7 +159,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 7 +Position: 8 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -203,11 +201,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### None - ## OUTPUTS -### System.Object ## NOTES ## RELATED LINKS diff --git a/docs/Set-User.md b/docs/Set-User.md index 1de998d..edc4d23 100644 --- a/docs/Set-User.md +++ b/docs/Set-User.md @@ -1,14 +1,14 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS -online version: http://go.microsoft.com/fwlink/?LinkId=821589 +online version: schema: 2.0.0 --- # Set-User ## SYNOPSIS -Short description +Creates a new user ## SYNTAX @@ -21,19 +21,21 @@ Set-User [-id] [[-first_name] ] [[-last_name] ] [[-userN ``` ## DESCRIPTION -Long description +Creates a new user to Snipe-IT system ## EXAMPLES ### EXAMPLE 1 ``` -An example +Update-user -id 3 -fist_name It -lastname Snipe -username snipeit -activated $false -company_id 1 -location_id 1 -department_id 1 ``` +Updates user with id 3 + ## PARAMETERS ### -activated -Parameter description +{{ Fill activated Description }} ```yaml Type: Boolean @@ -48,7 +50,7 @@ Accept wildcard characters: False ``` ### -apiKey -Parameter description +User's API Key for Snipeit, can be set using Set-Info command ```yaml Type: String @@ -63,7 +65,7 @@ Accept wildcard characters: False ``` ### -company_id -Parameter description +ID number of company users belogs to ```yaml Type: Int32 @@ -78,7 +80,7 @@ Accept wildcard characters: False ``` ### -department_id -Parameter description +ID number of department ```yaml Type: Int32 @@ -93,7 +95,7 @@ Accept wildcard characters: False ``` ### -email -Parameter description +email address ```yaml Type: String @@ -108,7 +110,7 @@ Accept wildcard characters: False ``` ### -employee_num -Parameter description +Employeenumber ```yaml Type: String @@ -123,7 +125,7 @@ Accept wildcard characters: False ``` ### -first_name -Parameter description +Users first name ```yaml Type: String @@ -138,7 +140,7 @@ Accept wildcard characters: False ``` ### -id -Parameter description +{{ Fill id Description }} ```yaml Type: Int32 @@ -153,7 +155,7 @@ Accept wildcard characters: False ``` ### -jobtitle -Parameter description +Users job tittle ```yaml Type: String @@ -168,7 +170,7 @@ Accept wildcard characters: False ``` ### -last_name -Parameter description +Users last name ```yaml Type: String @@ -183,7 +185,7 @@ Accept wildcard characters: False ``` ### -location_id -Parameter description +ID number of localtion ```yaml Type: Int32 @@ -198,7 +200,7 @@ Accept wildcard characters: False ``` ### -manager_id -Parameter description +ID number of manager ```yaml Type: Int32 @@ -213,7 +215,7 @@ Accept wildcard characters: False ``` ### -notes -Parameter description +User Notes ```yaml Type: String @@ -228,7 +230,7 @@ Accept wildcard characters: False ``` ### -phone -Parameter description +Phone number ```yaml Type: String @@ -243,7 +245,7 @@ Accept wildcard characters: False ``` ### -url -Parameter description +URL of Snipeit system, can be set using Set-Info command ```yaml Type: String @@ -258,7 +260,7 @@ Accept wildcard characters: False ``` ### -userName -Parameter description +Username for user ```yaml Type: String diff --git a/docs/SnipeItPS.md b/docs/SnipeItPS.md index eea3b19..0367e90 100644 --- a/docs/SnipeItPS.md +++ b/docs/SnipeItPS.md @@ -11,29 +11,65 @@ Locale: {{ Update Locale }} {{ Fill in the Description }} ## SnipeitPS Cmdlets +### [Get-Accessory](Get-Accessory.md) +Gets a list of Snipe-it Accessories + +### [Get-Asset](Get-Asset.md) +Gets a list of Snipe-it Assets or specific asset + ### [Get-AssetMaintenance](Get-AssetMaintenance.md) -Gets a list of Snipe-it Assets +Lists Snipe-it Assets Maintenances + +### [Get-Category](Get-Category.md) +Gets a list of Snipe-it Categories + +### [Get-Company](Get-Company.md) +Gets a list of Snipe-it Companies + +### [Get-Component](Get-Component.md) +Gets a list of Snipe-it Components + +### [Get-CustomField](Get-CustomField.md) +Returns a list of all Snipe-IT custom fields + +### [Get-Department](Get-Department.md) +Gets a list of Snipe-it Departments + +### [Get-Fieldset](Get-Fieldset.md) +Gets a list of Snipe-it Fieldsets + +### [Get-Model](Get-Model.md) +Gets a list of Snipe-it Models + +### [Get-SnipeitLocation](Get-SnipeitLocation.md) +Gets a list of Snipe-it Locations + +### [Get-Status](Get-Status.md) +Gets a list of Snipe-it Status Labels ### [New-Asset](New-Asset.md) Add a new Asset to Snipe-it asset system ### [New-AssetMaintenance](New-AssetMaintenance.md) -{{ Fill in the Synopsis }} +Add a new Asset maintenence to Snipe-it asset system + +### [New-Category](New-Category.md) +Create a new Snipe-IT Category ### [New-Component](New-Component.md) -Short description +Create a new component ### [New-CustomField](New-CustomField.md) Add a new Custom Field to Snipe-it asset system ### [New-Department](New-Department.md) -Short description +Creates a department ### [New-License](New-License.md) -{{ Fill in the Synopsis }} +Creates a licence ### [New-Location](New-Location.md) -Add a new Model to Snipe-it asset system +Add a new Location to Snipe-it asset system ### [New-Manufacturer](New-Manufacturer.md) Add a new Manufacturer to Snipe-it asset system @@ -42,7 +78,7 @@ Add a new Manufacturer to Snipe-it asset system Add a new Model to Snipe-it asset system ### [New-User](New-User.md) -Short description +Creates a new user ### [Remove-Asset](Remove-Asset.md) Removes Asset to Snipe-it asset system @@ -51,29 +87,26 @@ Removes Asset to Snipe-it asset system Removes User from Snipe-it asset system ### [Set-Accessory](Set-Accessory.md) -{{ Fill in the Synopsis }} +Updates accessory on Snipe-It system ### [Set-Asset](Set-Asset.md) -Update a Asset in the Snipe-it asset system +Update a specific Asset in the Snipe-it asset system ### [Set-AssetOwner](Set-AssetOwner.md) -{{Fill in the Synopsis}} - -### [Set-Component](Set-Component.md) -{{Fill in the Synopsis}} +Checkout asset ### [Set-Info](Set-Info.md) -{{Fill in the Synopsis}} +Sets authetication information ### [Set-License](Set-License.md) -{{ Fill in the Synopsis }} +Updates a licence ### [Set-Model](Set-Model.md) -{{ Fill in the Synopsis }} +Updates Model on Snipe-it asset system ### [Set-SnipeitLocation](Set-SnipeitLocation.md) Updates Location in Snipe-it asset system ### [Set-User](Set-User.md) -Short description +Creates a new user