Merge pull request #160 from snazy2000/develop

Publish v.1.6
This commit is contained in:
Petri Asikainen 2021-06-14 00:30:02 +03:00 committed by GitHub
commit 53b1560d83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
54 changed files with 4327 additions and 222 deletions

View file

@ -5,6 +5,32 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/), The format is based on [Keep a Changelog](http://keepachangelog.com/),
and this project adheres to [Semantic Versioning](http://semver.org/). and this project adheres to [Semantic Versioning](http://semver.org/).
# [v.1.6.x]
## Remove more things ja set some more
### New features
Added some set and remove functions. Pipelineinput supported
for all remove functions.
### New functions
- Remove-SnipeitAccessory
- Remove-SnipeitCategory
- Remove-SnipeitCompany
- Remove-SnipeitComponent
- Remove-SnipeitCustomField
- Remove-SnipeitDepartment
- Remove-SnipeitLicense
- Remove-SnipeitLocation
- Remove-SnipeitManufacturer
- Remove-SnipeitModel
- Set-SnipeitCategory
- Set-SnipeitCompany
- Set-SnipeitCustomField
- Set-SnipeitDepartment
- Set-SnipeitStatus
# [v1.5.x] - 2021-06-08 # [v1.5.x] - 2021-06-08
## Piping input ## Piping input

View file

@ -28,6 +28,7 @@ Set-SnipeitInfo -URL 'https://asset.example.com' -apiKey 'tokenKey'
```powershell ```powershell
# Review the help at any time! # Review the help at any time!
Get-Help about_SnipeitPS
Get-Command -Module SnipeitPS Get-Command -Module SnipeitPS
Get-Help Get-SnipeitAsset -Full # or any other command Get-Help Get-SnipeitAsset -Full # or any other command
``` ```

View file

@ -8,11 +8,8 @@ Name of new category to be created
.PARAMETER type .PARAMETER type
Type of new category to be created (asset, accessory, consumable, component, license) Type of new category to be created (asset, accessory, consumable, component, license)
.PARAMETER url .PARAMETER eula_text
URL of Snipeit system, can be set using Set-SnipeitInfo command This allows you to customize your EULAs for specific types of assets
.PARAMETER apiKey
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
.PARAMETER use_default_eula .PARAMETER use_default_eula
If switch is present, use the primary default EULA If switch is present, use the primary default EULA
@ -23,6 +20,12 @@ If switch is present, require users to confirm acceptance of assets in this cate
.PARAMETER checkin_email .PARAMETER checkin_email
If switch is present, send email to user on checkin/checkout If switch is present, send email to user on checkin/checkout
.PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command
.PARAMETER apiKey
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
.EXAMPLE .EXAMPLE
New-SnipeitCategory -name "Laptops" -category_type asset -url "Snipe-IT URL here..." -apiKey "API key here..." New-SnipeitCategory -name "Laptops" -category_type asset -url "Snipe-IT URL here..." -apiKey "API key here..."
#> #>
@ -42,51 +45,47 @@ function New-SnipeitCategory()
[ValidateSet("asset", "accessory", "consumable", "component", "license")] [ValidateSet("asset", "accessory", "consumable", "component", "license")]
[string]$category_type, [string]$category_type,
[parameter(mandatory = $true)] [string]$eula_text,
[string]$url,
[parameter(mandatory = $true)]
[string]$apiKey,
[switch]$use_default_eula, [switch]$use_default_eula,
[switch]$require_acceptance, [switch]$require_acceptance,
[switch]$checkin_email [switch]$checkin_email,
[parameter(mandatory = $true)]
[string]$url,
[parameter(mandatory = $true)]
[string]$apiKey
) )
begin {
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name if($eula_text -and $use_default_eula){
throw 'Dont use -use_defalt_eula if -eula_text is set'
}
$Values = @{ $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
"name" = $name
"category_type" = $category_type $Body = $Values | ConvertTo-Json;
} }
if ($use_default_eula) { process {
$Values += @{"use_default_eula" = $true}
$Parameters = @{
Uri = "$url/api/v1/categories"
Method = 'POST'
Body = $Body
Token = $apiKey
}
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
{
$result = Invoke-SnipeitMethod @Parameters
}
$result
} }
if ($require_acceptance) {
$Values += @{"require_acceptance" = $true}
}
if ($checkin_email) {
$Values += @{"checkin_email" = $true}
}
$Body = $Values | ConvertTo-Json;
$Parameters = @{
Uri = "$url/api/v1/categories"
Method = 'POST'
Body = $Body
Token = $apiKey
}
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
{
$result = Invoke-SnipeitMethod @Parameters
}
$result
} }

View file

@ -5,8 +5,29 @@
.DESCRIPTION .DESCRIPTION
Add a new Custom Field to Snipe-it asset system Add a new Custom Field to Snipe-it asset system
.PARAMETER Name .PARAMETER name
Name of the Custom Field The field's name, which is also the form label
.PARAMETER element
Form field type that should be displayed.
.PARAMETER field_values
In the case of list boxes, etc, this should be a list of the options available
.PARAMETER show_in_email
Whether or not to show the custom field in email notifications
.PARAMETER format
How the field should be validated
.PARAMETER custom_format
In the case of format 'CUSTOM REGEX', this should be validation regex this field
.PARAMETER field_encrypted
Whether the field should be encrypted. (This can cause issues if you change it after the field was created.)
.PARAMETER help_text
Any additional text you wish to display under the new form field to make it clearer what the gauges should be.
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -27,17 +48,25 @@ function New-SnipeitCustomField()
Param( Param(
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$Name, [string]$name,
[string]$HelpText, [string]$help_text,
[string]$Element = "text", [parameter(mandatory = $true)]
[ValidateSet('text','textarea','listbox','checkbox','radio')]
[string]$element ,
[string]$Format = "ANY", [parameter(mandatory = $true)]
[ValidateSet('ANY','CUSTOM REGEX','ALPHA','ALPHA-DASH','NUMERIC','ALPHA-NUMERIC','EMAIL','DATE','URL','IP','IPV4','IPV6','MAC','BOOLEAN')]
[string]$format,
[bool]$field_encrypted, [string]$field_values,
[string]$CustomFormat, [bool]$field_encrypted=$false,
[bool]$show_in_email=$false,
[string]$custom_format,
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$url, [string]$url,
@ -46,24 +75,31 @@ function New-SnipeitCustomField()
[string]$apiKey [string]$apiKey
) )
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name begin {
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
if ($format -eq 'CUSTOM REGEX' -and (-not $custom_format)) {
throw "Please specify regex validation with -custom_format when using -format 'CUSTOM REGEX'"
}
$Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
#Convert Values to JSON format $Body = $Values | ConvertTo-Json;
$Body = $Values | ConvertTo-Json;
$Parameters = @{ $Parameters = @{
Uri = "$url/api/v1/fields" Uri = "$url/api/v1/fields"
Method = 'post' Method = 'post'
Body = $Body Body = $Body
Token = $apiKey Token = $apiKey
}
} }
If ($PSCmdlet.ShouldProcess("ShouldProcess?")) process{
{ If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
$result = Invoke-SnipeitMethod @Parameters {
} $result = Invoke-SnipeitMethod @Parameters
}
$result $result
}
} }

View file

@ -0,0 +1,55 @@
<#
.SYNOPSIS
Removes Accessory from Snipe-it asset system
.DESCRIPTION
Removes Accessory or multiple Accessoriers from Snipe-it asset system
.PARAMETER ID
Unique ID For accessory to be removed
.PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command
.PARAMETER apiKey
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
.EXAMPLE
Remove-SnipeitAccessory -ID 44 -Verbose
.EXAMPLE
Get-SnipeitAccessory -search needle | Remove-SnipeitAccessory
#>
function Remove-SnipeitAccessory ()
{
[CmdletBinding(
SupportsShouldProcess = $true,
ConfirmImpact = "Low"
)]
Param(
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]]$id,
[parameter(mandatory = $true)]
[string]$URL,
[parameter(mandatory = $true)]
[string]$APIKey
)
begin {
}
process {
foreach($accessory_id in $id){
$Parameters = @{
Uri = "$url/api/v1/accessories/$accessory_id"
Method = 'Delete'
Body = '{}'
Token = $apiKey
}
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
{
$result = Invoke-SnipeitMethod @Parameters
}
$result
}
}
}

View file

@ -2,7 +2,7 @@
.SYNOPSIS .SYNOPSIS
Removes Asset from Snipe-it asset system Removes Asset from Snipe-it asset system
.DESCRIPTION .DESCRIPTION
Removes Asset from Snipe-it asset system Removes asset or multiple assets from Snipe-it asset system
.PARAMETER ID .PARAMETER ID
Unique ID For Asset to be removed Unique ID For Asset to be removed
.PARAMETER url .PARAMETER url
@ -13,6 +13,9 @@
.EXAMPLE .EXAMPLE
Remove-SnipeitAsset -ID 44 -Verbose Remove-SnipeitAsset -ID 44 -Verbose
.EXAMPLE
Get-SnipeitAsset -serial 123456789 | Remove-SnipeitAsset
#> #>
function Remove-SnipeitAsset () function Remove-SnipeitAsset ()
@ -23,34 +26,31 @@ function Remove-SnipeitAsset ()
)] )]
Param( Param(
[parameter(mandatory = $true)] [parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int]$id, [int[]]$id,
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$URL, [string]$URL,
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$APIKey [string]$APIKey
) )
begin {
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = @{
"ID" = $id
} }
process {
foreach($asset_id in $id){
$Parameters = @{
Uri = "$url/api/v1/hardware/$asset_id"
Method = 'Delete'
Body = '{}'
Token = $apiKey
}
$Body = $Values | ConvertTo-Json If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
{
$Parameters = @{ $result = Invoke-SnipeitMethod @Parameters
Uri = "$url/api/v1/hardware/$ID" }
Method = 'Delete' $result
Body = $Body }
Token = $apiKey
} }
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
{
$result = Invoke-SnipeitMethod @Parameters
}
$result
} }

View file

@ -2,10 +2,13 @@ function Remove-SnipeitAssetMaintenance {
<# <#
.SYNOPSIS .SYNOPSIS
Remove asset maintenance from Snipe-it asset system Remove asset maintenance from Snipe-it asset system
.DESCRIPTION .DESCRIPTION
Removes asset maintenance event from Snipe-it asset system by ID Removes asset maintenance event or events from Snipe-it asset system by ID
.PARAMETER ID .PARAMETER ID
Unique ID of the asset maintenance to be removed Unique ID of the asset maintenance to be removed
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfoeItInfo command URL of Snipeit system, can be set using Set-SnipeitInfoeItInfo command
@ -21,8 +24,8 @@ function Remove-SnipeitAssetMaintenance {
)] )]
param ( param (
# Asset maintenance ID # Asset maintenance ID
[Parameter(Mandatory = $true)] [Parameter(Mandatory = $true,ValueFromPipelineByPropertyName)]
[int] [int[]]
$id, $id,
# Snipeit URL # Snipeit URL
@ -35,26 +38,24 @@ function Remove-SnipeitAssetMaintenance {
[string] [string]
$apiKey $apiKey
) )
begin {
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = @{
"ID" = $id
} }
process {
foreach($maintenance_id in $id){
$Parameters = @{
Uri = "$url/api/v1/maintenances/$maintenance_id"
Method = 'Delete'
Body = '{}'
Token = $apiKey
}
$Body = $Values | ConvertTo-Json If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
{
$result = Invoke-SnipeitMethod @Parameters
}
$Parameters = @{ $result
Uri = "$url/api/v1/maintenances/$ID" }
Method = 'Delete'
Body = $Body
Token = $apiKey
} }
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
{
$result = Invoke-SnipeitMethod @Parameters
}
$result
} }

View file

@ -0,0 +1,55 @@
<#
.SYNOPSIS
Removes category from Snipe-it asset system
.DESCRIPTION
Removes category or multiple categories from Snipe-it asset system
.PARAMETER ID
Unique ID For categoryto be removed
.PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command
.PARAMETER apiKey
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
.EXAMPLE
Remove-SnipeitCategory -ID 44 -Verbose
.EXAMPLE
Get-SnipeitCategory -search something | Remove-SnipeitCategory
#>
function Remove-SnipeitCategory ()
{
[CmdletBinding(
SupportsShouldProcess = $true,
ConfirmImpact = "Low"
)]
Param(
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]]$id,
[parameter(mandatory = $true)]
[string]$URL,
[parameter(mandatory = $true)]
[string]$APIKey
)
begin {
}
process {
foreach($category_id in $id){
$Parameters = @{
Uri = "$url/api/v1/categories/$category_id"
Method = 'Delete'
Body = '{}'
Token = $apiKey
}
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
{
$result = Invoke-SnipeitMethod @Parameters
}
$result
}
}
}

View file

@ -0,0 +1,55 @@
<#
.SYNOPSIS
Removes Company from Snipe-it asset system
.DESCRIPTION
Removes Company or multiple Companies from Snipe-it asset system
.PARAMETER ID
Unique ID For Company to be removed
.PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command
.PARAMETER apiKey
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
.EXAMPLE
Remove-SnipeitCompany -ID 44 -Verbose
.EXAMPLE
Get-SnipeitCompany | | Where-object {$_.name -like '*some*'} | Remove-SnipeitCompany
#>
function Remove-SnipeitCompany ()
{
[CmdletBinding(
SupportsShouldProcess = $true,
ConfirmImpact = "Low"
)]
Param(
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]]$id,
[parameter(mandatory = $true)]
[string]$URL,
[parameter(mandatory = $true)]
[string]$APIKey
)
begin {
}
process {
foreach($company_id in $id){
$Parameters = @{
Uri = "$url/api/v1/companies/$company_id"
Method = 'Delete'
Body = '{}'
Token = $apiKey
}
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
{
$result = Invoke-SnipeitMethod @Parameters
}
$result
}
}
}

View file

@ -0,0 +1,55 @@
<#
.SYNOPSIS
Removes component from Snipe-it asset system
.DESCRIPTION
Removes component or multiple components from Snipe-it asset system
.PARAMETER IDs
Unique ID For component to be removed
.PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command
.PARAMETER apiKey
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
.EXAMPLE
Remove-SnipeitComponent -ID 44 -Verbose
.EXAMPLE
Get-SnipeitComponent -search 123456789 | Remove-SnipeitComponent
#>
function Remove-SnipeitComponent ()
{
[CmdletBinding(
SupportsShouldProcess = $true,
ConfirmImpact = "Low"
)]
Param(
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]]$id,
[parameter(mandatory = $true)]
[string]$URL,
[parameter(mandatory = $true)]
[string]$APIKey
)
begin {
}
process {
foreach($component_id in $id){
$Parameters = @{
Uri = "$url/api/v1/components/$component_id"
Method = 'Delete'
Body = '{}'
Token = $apiKey
}
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
{
$result = Invoke-SnipeitMethod @Parameters
}
$result
}
}
}

View file

@ -0,0 +1,55 @@
<#
.SYNOPSIS
Removes custom field from Snipe-it asset system
.DESCRIPTION
Removes custom field or multiple fields from Snipe-it asset system
.PARAMETER ID
Unique ID For field to be removed
.PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command
.PARAMETER apiKey
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
.EXAMPLE
Remove-SnipeitCustomField -ID 44 -Verbose
.EXAMPLE
Get-SnipeitCustomField | Where-object {$_.name -like '*address*'} | Remove-SnipeitCustomField
#>
function Remove-SnipeitCustomField ()
{
[CmdletBinding(
SupportsShouldProcess = $true,
ConfirmImpact = "Low"
)]
Param(
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]]$id,
[parameter(mandatory = $true)]
[string]$URL,
[parameter(mandatory = $true)]
[string]$APIKey
)
begin {
}
process {
foreach($field_id in $id){
$Parameters = @{
Uri = "$url/api/v1/fields/$field_id"
Method = 'Delete'
Body = '{}'
Token = $apiKey
}
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
{
$result = Invoke-SnipeitMethod @Parameters
}
$result
}
}
}

View file

@ -0,0 +1,55 @@
<#
.SYNOPSIS
Removes department from Snipe-it asset system
.DESCRIPTION
Removes department or multiple departments from Snipe-it asset system
.PARAMETER ID
Unique ID For department to be removed
.PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command
.PARAMETER apiKey
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
.EXAMPLE
Remove-SnipeitDepartment -ID 44 -Verbose
.EXAMPLE
Get-SnipeitDepartment | Where-object {$_.name -like '*head*'} | Remove-SnipeitDepartment
#>
function Remove-SnipeitDepartment ()
{
[CmdletBinding(
SupportsShouldProcess = $true,
ConfirmImpact = "Low"
)]
Param(
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]]$id,
[parameter(mandatory = $true)]
[string]$URL,
[parameter(mandatory = $true)]
[string]$APIKey
)
begin {
}
process {
foreach($department_id in $id){
$Parameters = @{
Uri = "$url/api/v1/departments/$department_id"
Method = 'Delete'
Body = '{}'
Token = $apiKey
}
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
{
$result = Invoke-SnipeitMethod @Parameters
}
$result
}
}
}

View file

@ -0,0 +1,55 @@
<#
.SYNOPSIS
Removes licence from Snipe-it asset system
.DESCRIPTION
Removes licence or multiple licenses from Snipe-it asset system
.PARAMETER ID
Unique ID For licence to be removed
.PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command
.PARAMETER apiKey
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
.EXAMPLE
Remove-SnipeitLicence -ID 44 -Verbose
.EXAMPLE
Get-SnipeitLicence -product_key 123456789 | Remove-SnipeitLicense
#>
function Remove-SnipeitLicense ()
{
[CmdletBinding(
SupportsShouldProcess = $true,
ConfirmImpact = "Low"
)]
Param(
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]]$id,
[parameter(mandatory = $true)]
[string]$URL,
[parameter(mandatory = $true)]
[string]$APIKey
)
begin {
}
process {
foreach($license_id in $id){
$Parameters = @{
Uri = "$url/api/v1/licenses/$license_id"
Method = 'Delete'
Body = '{}'
Token = $apiKey
}
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
{
$result = Invoke-SnipeitMethod @Parameters
}
$result
}
}
}

View file

@ -0,0 +1,55 @@
<#
.SYNOPSIS
Removes Location from Snipe-it asset system
.DESCRIPTION
Removes localtion or multiple locations from Snipe-it asset system
.PARAMETER ID
Unique ID For location to be removed
.PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command
.PARAMETER apiKey
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
.EXAMPLE
Remove-SnipeitLocation -ID 44 -Verbose
.EXAMPLE
Get-SnipeitLocation -city Arkham | Remove-SnipeitLocation
#>
function Remove-SnipeitLocation ()
{
[CmdletBinding(
SupportsShouldProcess = $true,
ConfirmImpact = "Low"
)]
Param(
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]]$id,
[parameter(mandatory = $true)]
[string]$URL,
[parameter(mandatory = $true)]
[string]$APIKey
)
begin {
}
process {
foreach($location_id in $id){
$Parameters = @{
Uri = "$url/api/v1/locations/$asset_id"
Method = 'Delete'
Body = '{}'
Token = $apiKey
}
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
{
$result = Invoke-SnipeitMethod @Parameters
}
$result
}
}
}

View file

@ -0,0 +1,55 @@
<#
.SYNOPSIS
Removes manufacturer from Snipe-it asset system
.DESCRIPTION
Removes manufacturer or multiple manufacturers from Snipe-it asset system
.PARAMETER ID
Unique ID For manufacturer to be removed
.PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command
.PARAMETER apiKey
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
.EXAMPLE
Remove-SnipeitManufacturer -ID 44 -Verbose
.EXAMPLE
Get-SnipeitManufacturer | Where-object {$_.name -like '*something*'} | Remove-SnipeitManufacturer
#>
function Remove-SnipeitManufacturer ()
{
[CmdletBinding(
SupportsShouldProcess = $true,
ConfirmImpact = "Low"
)]
Param(
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]]$id,
[parameter(mandatory = $true)]
[string]$URL,
[parameter(mandatory = $true)]
[string]$APIKey
)
begin {
}
process {
foreach($manufacturer_id in $id){
$Parameters = @{
Uri = "$url/api/v1/manufacturers/$manufacturer_id_id"
Method = 'Delete'
Body = '{}'
Token = $apiKey
}
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
{
$result = Invoke-SnipeitMethod @Parameters
}
$result
}
}
}

View file

@ -0,0 +1,55 @@
<#
.SYNOPSIS
Removes Asset model from Snipe-it asset system
.DESCRIPTION
Removes asset model or multiple assets models from Snipe-it asset system
.PARAMETER ID
Unique ID For Model to be removed
.PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command
.PARAMETER apiKey
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
.EXAMPLE
Remove-SnipeitModel -ID 44 -Verbose
.EXAMPLE
Get-SnipeitModel -search needle | Remove-SnipeitModel
#>
function Remove-SnipeitModel ()
{
[CmdletBinding(
SupportsShouldProcess = $true,
ConfirmImpact = "Low"
)]
Param(
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]]$id,
[parameter(mandatory = $true)]
[string]$URL,
[parameter(mandatory = $true)]
[string]$APIKey
)
begin {
}
process {
foreach($model_id in $id){
$Parameters = @{
Uri = "$url/api/v1/models/$model_id"
Method = 'Delete'
Body = '{}'
Token = $apiKey
}
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
{
$result = Invoke-SnipeitMethod @Parameters
}
$result
}
}
}

View file

@ -2,7 +2,7 @@
.SYNOPSIS .SYNOPSIS
Removes User from Snipe-it asset system Removes User from Snipe-it asset system
.DESCRIPTION .DESCRIPTION
Long description Removes Uuser or users from Snipe-it asset system
.PARAMETER ID .PARAMETER ID
Unique ID For User to be removed Unique ID For User to be removed
@ -24,7 +24,7 @@ function Remove-SnipeitUser ()
)] )]
Param( Param(
[parameter(mandatory = $true)] [parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int]$id, [int]$id,
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$URL, [string]$URL,
@ -32,26 +32,25 @@ function Remove-SnipeitUser ()
[string]$APIKey [string]$APIKey
) )
begin{
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = @{
"ID" = $id
} }
$Body = $Values | ConvertTo-Json process {
foreach($user_id in $id) {
$Parameters = @{
Uri = "$url/api/v1/users/$user_id"
Method = 'Delete'
Body = '{}'
Token = $apiKey
}
$Parameters = @{ If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
Uri = "$url/api/v1/users/$ID" {
Method = 'Delete' $result = Invoke-SnipeitMethod @Parameters
Body = $Body }
Token = $apiKey
$result
}
} }
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
{
$result = Invoke-SnipeitMethod @Parameters
}
$result
} }

View file

@ -0,0 +1,90 @@
<#
.SYNOPSIS
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-SnipeitInfo command
.PARAMETER apiKey
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
.PARAMETER use_default_eula
If switch is present, use the primary default EULA
.PARAMETER eula_text
This allows you to customize your EULAs for specific types of assets
.PARAMETER require_acceptance
If switch is present, require users to confirm acceptance of assets in this category
.PARAMETER checkin_email
Should the user be emailed the EULA and/or an acceptance confirmation email when this item is checked in?
.EXAMPLE
Set-SnipeitCategory -id 4 -name "Laptops"
#>
function Set-SnipeitCategory()
{
[CmdletBinding(
SupportsShouldProcess = $true,
ConfirmImpact = "Low"
)]
Param(
[parameter(mandatory = $true)]
[int[]]$id,
[string]$name,
[ValidateSet("asset", "accessory", "consumable", "component", "license")]
[string]$category_type,
[string]$eula_text,
[bool]$use_default_eula,
[bool]$require_acceptance,
[bool]$checkin_email,
[parameter(mandatory = $true)]
[string]$url,
[parameter(mandatory = $true)]
[string]$apiKey
)
begin {
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
$Body = $Values | ConvertTo-Json;
}
process {
foreach($category_id in $id){
$Parameters = @{
Uri = "$url/api/v1/categories/$category_id"
Method = 'Put'
Body = $Body
Token = $apiKey
}
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
{
$result = Invoke-SnipeitMethod @Parameters
}
$result
}
}
}

View file

@ -0,0 +1,70 @@
<#
.SYNOPSIS
Updates company name
.DESCRIPTION
Updates companyt name on Snipe-It system
.PARAMETER id
ID number of company
.PARAMETER name
Company name
.PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command
.PARAMETER apiKey
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
.EXAMPLE
An example
.NOTES
General notes
#>
function Set-SnipeitCompany()
{
[CmdletBinding(
SupportsShouldProcess = $true,
ConfirmImpact = "Medium"
)]
Param(
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]]$id,
[parameter(mandatory = $true)]
[string]$name,
[parameter(mandatory = $true)]
[string]$url,
[parameter(mandatory = $true)]
[string]$apiKey
)
begin{
$values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
$Body = $values | ConvertTo-Json;
}
process{
foreach($company_id in $id){
$Parameters = @{
Uri = "$url/api/v1/companies/$company_id"
Method = 'Patch'
Body = $Body
Token = $apiKey
}
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
{
$result = Invoke-SnipeitMethod @Parameters
}
$result
}
}
}

View file

@ -49,8 +49,8 @@ function Set-SnipeitComponent()
)] )]
Param( Param(
[parameter(mandatory = $true)] [parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int]$id, [int[]]$id,
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[int]$qty, [int]$qty,
@ -74,28 +74,33 @@ function Set-SnipeitComponent()
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$apiKey [string]$apiKey
) )
begin {
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name $values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
$values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters if ($values['purchase_date']) {
$values['purchase_date'] = $values['purchase_date'].ToString("yyyy-MM-dd")
}
if ($values['purchase_date']) { $Body = $values | ConvertTo-Json;
$values['purchase_date'] = $values['purchase_date'].ToString("yyyy-MM-dd")
} }
$Body = $values | ConvertTo-Json; process {
foreach($component_id in $id){
$Parameters = @{
Uri = "$url/api/v1/components/$component_id"
Method = 'Patch'
Body = $Body
Token = $apiKey
}
$Parameters = @{ If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
Uri = "$url/api/v1/components/$id" {
Method = 'Patch' $result = Invoke-SnipeitMethod @Parameters
Body = $Body }
Token = $apiKey
$result
}
} }
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
{
$result = Invoke-SnipeitMethod @Parameters
}
$result
} }

View file

@ -0,0 +1,108 @@
<#
.SYNOPSIS
Add a new Custom Field to Snipe-it asset system
.DESCRIPTION
Add a new Custom Field to Snipe-it asset system
.PARAMETER name
The field's name, which is also the form label
.PARAMETER element
Form field type that should be displayed.
.PARAMETER field_values
In the case of list boxes, etc, this should be a list of the options available
.PARAMETER show_in_email
Whether or not to show the custom field in email notifications
.PARAMETER format
How the field should be validated
.PARAMETER custom_format
In the case of format 'CUSTOM REGEX', this should be validation regex this field
.PARAMETER field_encrypted
Whether the field should be encrypted. (This can cause issues if you change it after the field was created.)
.PARAMETER help_text
Any additional text you wish to display under the new form field to make it clearer what the gauges should be.
.PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command
.PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-SnipeitInfo command
.EXAMPLE
New-SnipeitCustomField -Name "AntivirusInstalled" -Format "BOOLEAN" -HelpText "Is AntiVirus installed on Asset"
#>
function Set-SnipeitCustomField()
{
[CmdletBinding(
SupportsShouldProcess = $true,
ConfirmImpact = "Low"
)]
Param(
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]]$id,
[string]$name,
[string]$help_text,
[parameter(Mandatory=$true)]
[ValidateSet('text','textarea','listbox','checkbox','radio')]
[string]$element ,
[ValidateSet('ANY','CUSTOM REGEX','ALPHA','ALPHA-DASH','NUMERIC','ALPHA-NUMERIC','EMAIL','DATE','URL','IP','IPV4','IPV6','MAC','BOOLEAN')]
[string]$format,
[string]$field_values,
[bool]$field_encrypted,
[bool]$show_in_email,
[string]$custom_format,
[parameter(mandatory = $true)]
[string]$url,
[parameter(mandatory = $true)]
[string]$apiKey
)
begin {
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
if ($format -eq 'CUSTOM REGEX' -and (-not $custom_format)) {
throw "Please specify regex validation with -custom_format when using -format 'CUSTOM REGEX'"
}
$Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
$Body = $Values | ConvertTo-Json;
}
process{
foreach($field_id in $id) {
$Parameters = @{
Uri = "$url/api/v1/fields/$field_id"
Method = 'Put'
Body = $Body
Token = $apiKey
}
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
{
$result = Invoke-SnipeitMethod @Parameters
}
$result
}
}
}

View file

@ -0,0 +1,85 @@
<#
.SYNOPSIS
Updates a department
.DESCRIPTION
Updates the department on Snipe-It system
.PARAMETER id
Id number of Department
.PARAMETER name
Department Name
.PARAMETER company_id
ID number of company
.PARAMETER location_id
ID number of location
.PARAMETER manager_id
ID number of manager
.PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command
.PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-SnipeitInfo command
.EXAMPLE
Set-SnipeitDepartment -id 4 -manager_id 3
#>
function Set-SnipeitDepartment() {
[CmdletBinding(
SupportsShouldProcess = $true,
ConfirmImpact = "Low"
)]
Param(
[parameter(mandatory = $true,ValueFromPipelineByPropertyName)]
[int[]]$id,
[string]$name,
[int]$company_id,
[int]$location_id,
[int]$manager_id,
[string]$notes,
[parameter(mandatory = $true)]
[string]$url,
[parameter(mandatory = $true)]
[string]$apiKey
)
begin {
$Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
$Body = $Values | ConvertTo-Json;
}
process {
foreach ($department_id in $id) {
$Parameters = @{
Uri = "$url/api/v1/departments/$department_id"
Method = 'Put'
Body = $Body
Token = $apiKey
}
If ($PSCmdlet.ShouldProcess("ShouldProcess?")) {
$result = Invoke-SnipeitMethod @Parameters
}
$result
}
}
}

View file

@ -129,6 +129,7 @@ function Set-SnipeitLicense() {
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$apiKey [string]$apiKey
) )
begin{ begin{
Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
@ -148,6 +149,7 @@ function Set-SnipeitLicense() {
$Body = $Values | ConvertTo-Json; $Body = $Values | ConvertTo-Json;
} }
process { process {
foreach($license_id in $id){ foreach($license_id in $id){
$Parameters = @{ $Parameters = @{

View file

@ -0,0 +1,83 @@
<#
.SYNOPSIS
Sets Snipe-it Status Labels
.PARAMETER id
A id of specific Status Label
.PARAMETER color
Hex code showing what color the status label should be on the pie chart in the dashboard
.PARAMETER show_in_nav
1 or 0 - determine whether the status label should show in the left-side nav of the web GUI
.PARAMETER default_label
1 or 0 - determine whether it should be bubbled up to the top of the list of available statuses
.PARAMETER url
URL of Snipeit system, can be set using Set-SnipeitInfo command
.PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-SnipeitInfo command
.EXAMPLE
Get-SnipeitStatus -search "Ready to Deploy"
.EXAMPLE
Set-SnipeitStatus -id 3 -name 'Waiting for arrival' -type pending
#>
function Set-SnipeitStatus()
{
[CmdletBinding(
SupportsShouldProcess = $true,
ConfirmImpact = "Medium"
)]
Param(
[parameter(Mandatory=$true,ValueFromPipelineByPropertyName)]
[int[]]$id,
[string]$name,
[parameter(Mandatory=$true)]
[ValidateSet('deployable','undeployable','pending','archived')]
[string]$type,
[string]$notes,
[string]$color,
[bool]$show_in_nav,
[bool]$default_label,
[parameter(mandatory = $true)]
[string]$url,
[parameter(mandatory = $true)]
[string]$apiKey
)
begin {
$Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters
$Body = $Values | ConvertTo-Json
}
process {
foreach($status_id in $id) {
$Parameters = @{
Uri = "$url/api/v1/statuslabels/$status_id"
Method = 'Put'
Body = $Body
Token = $apiKey
}
If ($PSCmdlet.ShouldProcess("ShouldProcess?")) {
$result = Invoke-SnipeitMethod @Parameters
}
$result
}
}
}

View file

@ -80,13 +80,10 @@ function Set-SnipeitUser() {
[string]$userName, [string]$userName,
[string]$jobtitle, [string]$jobtitle,
[string]$email, [string]$email,
[string]$phone, [string]$phone,
[int]$company_id, [int]$company_id,
@ -97,12 +94,10 @@ function Set-SnipeitUser() {
[int]$manager_id, [int]$manager_id,
[string]$employee_num, [string]$employee_num,
[bool]$activated, [bool]$activated,
[string]$notes, [string]$notes,
[parameter(mandatory = $true)] [parameter(mandatory = $true)]

View file

@ -12,7 +12,7 @@
RootModule = 'SnipeitPS' RootModule = 'SnipeitPS'
# Version number of this module. # Version number of this module.
ModuleVersion = '1.5' ModuleVersion = '1.6'
# Supported PSEditions # Supported PSEditions
# CompatiblePSEditions = @() # CompatiblePSEditions = @()
@ -70,6 +70,9 @@ PowerShellVersion = '3.0'
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = @( FunctionsToExport = @(
'Get-SnipeitAccessory',
'Get-SnipeitAccessoryOwner',
'Get-SnipeitActivity',
'Get-SnipeitAsset', 'Get-SnipeitAsset',
'Get-SnipeitAssetMaintenance', 'Get-SnipeitAssetMaintenance',
'Get-SnipeitCategory', 'Get-SnipeitCategory',
@ -78,45 +81,59 @@ FunctionsToExport = @(
'Get-SnipeitCustomField', 'Get-SnipeitCustomField',
'Get-SnipeitDepartment', 'Get-SnipeitDepartment',
'Get-SnipeitFieldset', 'Get-SnipeitFieldset',
'Get-SnipeitLicense',
'Get-SnipeitLicenseSeat',
'Get-SnipeitLocation', 'Get-SnipeitLocation',
'Get-SnipeitManufacturer', 'Get-SnipeitManufacturer',
'Get-SnipeitModel', 'Get-SnipeitModel',
'Get-SnipeitStatus', 'Get-SnipeitStatus',
'Get-SnipeitSupplier', 'Get-SnipeitSupplier',
'Get-SnipeitUser', 'Get-SnipeitUser',
'New-SnipeitAccessory',
'New-SnipeitAsset', 'New-SnipeitAsset',
'New-SnipeitAssetMaintenance', 'New-SnipeitAssetMaintenance',
'New-SnipeItAudit',
'New-SnipeitCategory', 'New-SnipeitCategory',
'New-SnipeitComponent', 'New-SnipeitComponent',
'New-SnipeitCustomField', 'New-SnipeitCustomField',
'New-SnipeitDepartment', 'New-SnipeitDepartment',
'New-SnipeitLicense', 'New-SnipeitLicense',
'Set-SnipeitLicense',
'Get-SnipeitLicense',
'Get-SnipeitLicenseSeat',
'Set-SnipeitLicenseSeat',
'New-SnipeitLocation', 'New-SnipeitLocation',
'New-SnipeitManufacturer', 'New-SnipeitManufacturer',
'New-SnipeitModel', 'New-SnipeitModel',
'New-SnipeitUser', 'New-SnipeitUser',
'Remove-SnipeitAccessory',
'Remove-SnipeitAsset',
'Remove-SnipeitAssetMaintenance',
'Remove-SnipeitCategory',
'Remove-SnipeitCompany',
'Remove-SnipeitComponent',
'Remove-SnipeitCustomField',
'Remove-SnipeitDepartment',
'Remove-SnipeitLicense',
'Remove-SnipeitLocation',
'Remove-SnipeitManufacturer',
'Remove-SnipeitModel',
'Remove-SnipeitUser',
'Reset-SnipeitAccessoryOwner',
'Reset-SnipeitAssetOwner',
'Set-SnipeitAccessory',
'Set-SnipeitAccessoryOwner',
'Set-SnipeitAsset', 'Set-SnipeitAsset',
'Set-SnipeitAssetOwner', 'Set-SnipeitAssetOwner',
'Set-SnipeitCategory'
'Set-SnipeitCompany'
'Set-SnipeitComponent', 'Set-SnipeitComponent',
'Set-SnipeitModel', 'Set-SnipeitCustomField',
'Set-SnipeitDepartment',
'Set-SnipeitInfo', 'Set-SnipeitInfo',
'Set-SnipeitUser', 'Set-SnipeitLicense',
'Set-SnipeitLicenseSeat',
'Set-SnipeitLocation', 'Set-SnipeitLocation',
'Add-SnipeitAccessory', 'Set-SnipeitModel',
'Set-SnipeitAccessory', 'Set-SnipeitStatus',
'Get-SnipeitAccessory', 'Set-SnipeitUser',
'Remove-SnipeitAsset', 'Update-SnipeitAlias'
'Remove-SnipeitUser',
'Update-SnipeitAlias',
'Set-SnipeitAccessoryOwner',
'Get-SnipeitAccessoryOwner',
'Reset-SnipeitAccessoryOwner',
'Get-SnipeitActivity'
) )
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.

View file

@ -14,7 +14,7 @@ environment:
PSGalleryAPIKey: PSGalleryAPIKey:
secure: UdM6qhf5B0G8liHhUrwWERCZr44iSqmg4jUq0lwlTjZs4KyeoiwnBzdej0phqIAm secure: UdM6qhf5B0G8liHhUrwWERCZr44iSqmg4jUq0lwlTjZs4KyeoiwnBzdej0phqIAm
version: 1.5.{build} version: 1.6.{build}
# Don't rebuild when I tag a release on GitHub # Don't rebuild when I tag a release on GitHub
skip_tags: true skip_tags: true

View file

@ -12,7 +12,7 @@ Gets a list of Snipe-it Assets or specific asset
## SYNTAX ## SYNTAX
### Search ### Search (Default)
``` ```
Get-SnipeitAsset [-search <String>] [-order_number <String>] [-model_id <Int32>] [-category_id <Int32>] Get-SnipeitAsset [-search <String>] [-order_number <String>] [-model_id <Int32>] [-category_id <Int32>]
[-manufacturer_id <Int32>] [-company_id <Int32>] [-location_id <Int32>] [-depreciation_id <Int32>] [-manufacturer_id <Int32>] [-company_id <Int32>] [-location_id <Int32>] [-depreciation_id <Int32>]
@ -35,6 +35,18 @@ Get-SnipeitAsset [-asset_tag <String>] -url <String> -apiKey <String> [<CommonPa
Get-SnipeitAsset [-serial <String>] -url <String> -apiKey <String> [<CommonParameters>] Get-SnipeitAsset [-serial <String>] -url <String> -apiKey <String> [<CommonParameters>]
``` ```
### Assets due auditing soon
```
Get-SnipeitAsset [-audit_due] [-sort <String>] [-order <String>] [-limit <Int32>] [-offset <Int32>] [-all]
-url <String> -apiKey <String> [<CommonParameters>]
```
### Assets overdue for auditing
```
Get-SnipeitAsset [-audit_overdue] [-sort <String>] [-order <String>] [-limit <Int32>] [-offset <Int32>] [-all]
-url <String> -apiKey <String> [<CommonParameters>]
```
## DESCRIPTION ## DESCRIPTION
{{ Fill in the Description }} {{ Fill in the Description }}
@ -67,7 +79,7 @@ A return all results, works with -offset and other parameters
```yaml ```yaml
Type: SwitchParameter Type: SwitchParameter
Parameter Sets: Search Parameter Sets: Search, Assets due auditing soon, Assets overdue for auditing
Aliases: Aliases:
Required: False Required: False
@ -107,6 +119,36 @@ Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
``` ```
### -audit_due
Retrieve a list of assets that are due for auditing soon.
```yaml
Type: SwitchParameter
Parameter Sets: Assets due auditing soon
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -audit_overdue
Retrieve a list of assets that are overdue for auditing.
```yaml
Type: SwitchParameter
Parameter Sets: Assets overdue for auditing
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -category_id ### -category_id
Optionally restrict asset results to this category ID Optionally restrict asset results to this category ID
@ -174,7 +216,7 @@ Defines batch size for -all
```yaml ```yaml
Type: Int32 Type: Int32
Parameter Sets: Search Parameter Sets: Search, Assets due auditing soon, Assets overdue for auditing
Aliases: Aliases:
Required: False Required: False
@ -234,7 +276,7 @@ Offset to use
```yaml ```yaml
Type: Int32 Type: Int32
Parameter Sets: Search Parameter Sets: Search, Assets due auditing soon, Assets overdue for auditing
Aliases: Aliases:
Required: False Required: False
@ -249,12 +291,12 @@ Specify the order (asc or desc) you wish to order by on your sort column
```yaml ```yaml
Type: String Type: String
Parameter Sets: Search Parameter Sets: Search, Assets due auditing soon, Assets overdue for auditing
Aliases: Aliases:
Required: False Required: False
Position: Named Position: Named
Default value: Desc Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
``` ```
@ -324,12 +366,12 @@ Specify the column name you wish to sort by
```yaml ```yaml
Type: String Type: String
Parameter Sets: Search Parameter Sets: Search, Assets due auditing soon, Assets overdue for auditing
Aliases: Aliases:
Required: False Required: False
Position: Named Position: Named
Default value: Created_at Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
``` ```

View file

@ -0,0 +1,269 @@
---
external help file: SnipeitPS-help.xml
Module Name: SnipeitPS
online version:
schema: 2.0.0
---
# New-SnipeitAccessory
## SYNOPSIS
Creates new accessory on Snipe-It system
## SYNTAX
```
New-SnipeitAccessory [-name] <String> [-qty] <Int32> [-category_id] <Int32> [[-company_id] <Int32>]
[[-manufacturer_id] <Int32>] [[-order_number] <String>] [[-purchase_cost] <Single>]
[[-purchase_date] <DateTime>] [[-min_qty] <Int32>] [[-supplier_id] <Int32>] [[-location_id] <Int32>]
[-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
```
## DESCRIPTION
Creates new accessory on Snipe-It system
## EXAMPLES
### EXAMPLE 1
```
New-SnipeitAccessory -name "Accessory" -qty 3 -category_id 1
```
## PARAMETERS
### -apiKey
Users API Key for Snipeit, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 13
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -category_id
ID number of the category the accessory belongs to
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: True
Position: 3
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: 4
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -location_id
ID number of the location the accessory is assigned to
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 11
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -manufacturer_id
ID number of the manufacturer for this accessory.
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -min_qty
Min quantity of the accessory before alert is triggered
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 9
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -name
Accessory name
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -order_number
Order number for this accessory.
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 6
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: 8
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -qty
Quantity of the accessory you have
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
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: 10
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -url
URL of Snipeit system, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 12
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Confirm
Prompts you for confirmation before running the cmdlet.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS

View file

@ -39,7 +39,7 @@ Specifying asset tag when creating asset
### EXAMPLE 3 ### EXAMPLE 3
``` ```
New-SnipeitAsset -status_id 1 -model_id 1 -name "Machine1" -CustomValues = @{ "_snipeit_os_5" = "Windows 10 Pro" } New-SnipeitAsset -status_id 1 -model_id 1 -name "Machine1" -customfields = @{ "_snipeit_os_5" = "Windows 10 Pro" }
Using customfields when creating asset. Using customfields when creating asset.
``` ```

132
docs/New-SnipeitAudit.md Normal file
View file

@ -0,0 +1,132 @@
---
external help file: SnipeitPS-help.xml
Module Name: SnipeitPS
online version:
schema: 2.0.0
---
# New-SnipeitAudit
## SYNOPSIS
Add a new Audit to Snipe-it asset system
## SYNTAX
```
New-SnipeitAudit [-tag] <String> [[-location_id] <Int32>] [-url] <String> [-apiKey] <String> [-WhatIf]
[-Confirm] [<CommonParameters>]
```
## DESCRIPTION
Long description
## EXAMPLES
### EXAMPLE 1
```
New-SnipeitAudit -tag 1 -location_id 1
```
## PARAMETERS
### -apiKey
{{ Fill apiKey Description }}
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -location_id
ID of the location you want to associate with the audit
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -tag
The asset tag of the asset you wish to audit
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -url
{{ Fill url Description }}
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Confirm
Prompts you for confirmation before running the cmdlet.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS

View file

@ -13,8 +13,9 @@ Create a new Snipe-IT Category
## SYNTAX ## SYNTAX
``` ```
New-SnipeitCategory [-name] <String> [-category_type] <String> [-url] <String> [-apiKey] <String> New-SnipeitCategory [-name] <String> [-category_type] <String> [[-eula_text] <String>] [-use_default_eula]
[-use_default_eula] [-require_acceptance] [-checkin_email] [-WhatIf] [-Confirm] [<CommonParameters>] [-require_acceptance] [-checkin_email] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm]
[<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -38,7 +39,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 4 Position: 5
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
@ -74,6 +75,21 @@ Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
``` ```
### -eula_text
This allows you to customize your EULAs for specific types of assets
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -name ### -name
Name of new category to be created Name of new category to be created
@ -113,7 +129,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 3 Position: 4
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False

View file

@ -13,9 +13,9 @@ Add a new Custom Field to Snipe-it asset system
## SYNTAX ## SYNTAX
``` ```
New-SnipeitCustomField [-Name] <String> [[-HelpText] <String>] [[-Element] <String>] [[-Format] <String>] New-SnipeitCustomField [-name] <String> [[-help_text] <String>] [-element] <String> [-format] <String>
[[-field_encrypted] <Boolean>] [[-CustomFormat] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [[-field_values] <String>] [[-field_encrypted] <Boolean>] [[-show_in_email] <Boolean>]
[-Confirm] [<CommonParameters>] [[-custom_format] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -39,44 +39,45 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 10
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -custom_format
In the case of format 'CUSTOM REGEX', this should be validation regex this field
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 8 Position: 8
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
``` ```
### -CustomFormat ### -element
{{ Fill CustomFormat Description }} Form field type that should be displayed.
```yaml ```yaml
Type: String Type: String
Parameter Sets: (All) Parameter Sets: (All)
Aliases: Aliases:
Required: False Required: True
Position: 6 Position: 3
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
``` ```
### -Element
{{ Fill Element Description }}
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: Text
Accept pipeline input: False
Accept wildcard characters: False
```
### -field_encrypted ### -field_encrypted
{{ Fill field_encrypted Description }} Whether the field should be encrypted.
(This can cause issues if you change it after the field was created.)
```yaml ```yaml
Type: Boolean Type: Boolean
@ -84,14 +85,14 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: False Required: False
Position: 5 Position: 6
Default value: False Default value: False
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
``` ```
### -Format ### -field_values
{{ Fill Format Description }} In the case of list boxes, etc, this should be a list of the options available
```yaml ```yaml
Type: String Type: String
@ -99,14 +100,29 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: False Required: False
Position: 4 Position: 5
Default value: ANY Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
``` ```
### -HelpText ### -format
{{ Fill HelpText Description }} How the field should be validated
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -help_text
Any additional text you wish to display under the new form field to make it clearer what the gauges should be.
```yaml ```yaml
Type: String Type: String
@ -120,8 +136,8 @@ Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
``` ```
### -Name ### -name
Name of the Custom Field The field's name, which is also the form label
```yaml ```yaml
Type: String Type: String
@ -135,6 +151,21 @@ Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
``` ```
### -show_in_email
Whether or not to show the custom field in email notifications
```yaml
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: 7
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -url ### -url
URL of Snipeit system, can be set using Set-SnipeitInfo command URL of Snipeit system, can be set using Set-SnipeitInfo command
@ -144,7 +175,7 @@ Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 7 Position: 9
Default value: None Default value: None
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False

View file

@ -0,0 +1,122 @@
---
external help file: SnipeitPS-help.xml
Module Name: SnipeitPS
online version:
schema: 2.0.0
---
# Remove-SnipeitAccessory
## SYNOPSIS
Removes Accessory from Snipe-it asset system
## SYNTAX
```
Remove-SnipeitAccessory [-id] <Int32[]> [-URL] <String> [-APIKey] <String> [-WhatIf] [-Confirm]
[<CommonParameters>]
```
## DESCRIPTION
Removes Accessory or multiple Accessoriers from Snipe-it asset system
## EXAMPLES
### EXAMPLE 1
```
Remove-SnipeitAccessory -ID 44 -Verbose
```
### EXAMPLE 2
```
Get-SnipeitAccessory -search needle | Remove-SnipeitAccessory
```
## PARAMETERS
### -APIKey
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -id
Unique ID For accessory to be removed
```yaml
Type: Int32[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -URL
URL of Snipeit system, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Confirm
Prompts you for confirmation before running the cmdlet.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS

View file

@ -13,11 +13,12 @@ Removes Asset from Snipe-it asset system
## SYNTAX ## SYNTAX
``` ```
Remove-SnipeitAsset [-id] <Int32> [-URL] <String> [-APIKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>] Remove-SnipeitAsset [-id] <Int32[]> [-URL] <String> [-APIKey] <String> [-WhatIf] [-Confirm]
[<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
Removes Asset from Snipe-it asset system Removes asset or multiple assets from Snipe-it asset system
## EXAMPLES ## EXAMPLES
@ -26,6 +27,11 @@ Removes Asset from Snipe-it asset system
Remove-SnipeitAsset -ID 44 -Verbose Remove-SnipeitAsset -ID 44 -Verbose
``` ```
### EXAMPLE 2
```
Get-SnipeitAsset -serial 123456789 | Remove-SnipeitAsset
```
## PARAMETERS ## PARAMETERS
### -APIKey ### -APIKey
@ -47,14 +53,14 @@ Accept wildcard characters: False
Unique ID For Asset to be removed Unique ID For Asset to be removed
```yaml ```yaml
Type: Int32 Type: Int32[]
Parameter Sets: (All) Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 1 Position: 1
Default value: 0 Default value: None
Accept pipeline input: False Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False Accept wildcard characters: False
``` ```

View file

@ -0,0 +1,117 @@
---
external help file: SnipeitPS-help.xml
Module Name: SnipeitPS
online version:
schema: 2.0.0
---
# Remove-SnipeitAssetMaintenance
## SYNOPSIS
Remove asset maintenance from Snipe-it asset system
## SYNTAX
```
Remove-SnipeitAssetMaintenance [-id] <Int32[]> [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm]
[<CommonParameters>]
```
## DESCRIPTION
Removes asset maintenance event or events from Snipe-it asset system by ID
## EXAMPLES
### EXAMPLE 1
```
Remove-SnipeitAssetMaintenance -ID 44 -url $url -apiKey $secret -Verbose
```
## PARAMETERS
### -apiKey
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -id
Unique ID of the asset maintenance to be removed
```yaml
Type: Int32[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -url
URL of Snipeit system, can be set using Set-SnipeitInfoeItInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Confirm
Prompts you for confirmation before running the cmdlet.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS

View file

@ -0,0 +1,122 @@
---
external help file: SnipeitPS-help.xml
Module Name: SnipeitPS
online version:
schema: 2.0.0
---
# Remove-SnipeitCategory
## SYNOPSIS
Removes category from Snipe-it asset system
## SYNTAX
```
Remove-SnipeitCategory [-id] <Int32[]> [-URL] <String> [-APIKey] <String> [-WhatIf] [-Confirm]
[<CommonParameters>]
```
## DESCRIPTION
Removes category or multiple categories from Snipe-it asset system
## EXAMPLES
### EXAMPLE 1
```
Remove-SnipeitCategory -ID 44 -Verbose
```
### EXAMPLE 2
```
Get-SnipeitCategory -search something | Remove-SnipeitCategory
```
## PARAMETERS
### -APIKey
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -id
Unique ID For categoryto be removed
```yaml
Type: Int32[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -URL
URL of Snipeit system, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Confirm
Prompts you for confirmation before running the cmdlet.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS

View file

@ -0,0 +1,122 @@
---
external help file: SnipeitPS-help.xml
Module Name: SnipeitPS
online version:
schema: 2.0.0
---
# Remove-SnipeitCompany
## SYNOPSIS
Removes Company from Snipe-it asset system
## SYNTAX
```
Remove-SnipeitCompany [-id] <Int32[]> [-URL] <String> [-APIKey] <String> [-WhatIf] [-Confirm]
[<CommonParameters>]
```
## DESCRIPTION
Removes Company or multiple Companies from Snipe-it asset system
## EXAMPLES
### EXAMPLE 1
```
Remove-SnipeitCompany -ID 44 -Verbose
```
### EXAMPLE 2
```
Get-SnipeitCompany | | Where-object {$_.name -like '*some*'} | Remove-SnipeitCompany
```
## PARAMETERS
### -APIKey
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -id
Unique ID For Company to be removed
```yaml
Type: Int32[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -URL
URL of Snipeit system, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Confirm
Prompts you for confirmation before running the cmdlet.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS

View file

@ -0,0 +1,122 @@
---
external help file: SnipeitPS-help.xml
Module Name: SnipeitPS
online version:
schema: 2.0.0
---
# Remove-SnipeitComponent
## SYNOPSIS
Removes component from Snipe-it asset system
## SYNTAX
```
Remove-SnipeitComponent [-id] <Int32[]> [-URL] <String> [-APIKey] <String> [-WhatIf] [-Confirm]
[<CommonParameters>]
```
## DESCRIPTION
Removes component or multiple components from Snipe-it asset system
## EXAMPLES
### EXAMPLE 1
```
Remove-SnipeitComponent -ID 44 -Verbose
```
### EXAMPLE 2
```
Get-SnipeitComponent -search 123456789 | Remove-SnipeitComponent
```
## PARAMETERS
### -APIKey
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -id
{{ Fill id Description }}
```yaml
Type: Int32[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -URL
URL of Snipeit system, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Confirm
Prompts you for confirmation before running the cmdlet.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS

View file

@ -0,0 +1,122 @@
---
external help file: SnipeitPS-help.xml
Module Name: SnipeitPS
online version:
schema: 2.0.0
---
# Remove-SnipeitCustomField
## SYNOPSIS
Removes custom field from Snipe-it asset system
## SYNTAX
```
Remove-SnipeitCustomField [-id] <Int32[]> [-URL] <String> [-APIKey] <String> [-WhatIf] [-Confirm]
[<CommonParameters>]
```
## DESCRIPTION
Removes custom field or multiple fields from Snipe-it asset system
## EXAMPLES
### EXAMPLE 1
```
Remove-SnipeitCustomField -ID 44 -Verbose
```
### EXAMPLE 2
```
Get-SnipeitCustomField | Where-object {$_.name -like '*address*'} | Remove-SnipeitCustomField
```
## PARAMETERS
### -APIKey
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -id
Unique ID For field to be removed
```yaml
Type: Int32[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -URL
URL of Snipeit system, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Confirm
Prompts you for confirmation before running the cmdlet.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS

View file

@ -0,0 +1,122 @@
---
external help file: SnipeitPS-help.xml
Module Name: SnipeitPS
online version:
schema: 2.0.0
---
# Remove-SnipeitDepartment
## SYNOPSIS
Removes department from Snipe-it asset system
## SYNTAX
```
Remove-SnipeitDepartment [-id] <Int32[]> [-URL] <String> [-APIKey] <String> [-WhatIf] [-Confirm]
[<CommonParameters>]
```
## DESCRIPTION
Removes department or multiple departments from Snipe-it asset system
## EXAMPLES
### EXAMPLE 1
```
Remove-SnipeitDepartment -ID 44 -Verbose
```
### EXAMPLE 2
```
Get-SnipeitDepartment | Where-object {$_.name -like '*head*'} | Remove-SnipeitDepartment
```
## PARAMETERS
### -APIKey
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -id
Unique ID For department to be removed
```yaml
Type: Int32[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -URL
URL of Snipeit system, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Confirm
Prompts you for confirmation before running the cmdlet.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS

View file

@ -0,0 +1,122 @@
---
external help file: SnipeitPS-help.xml
Module Name: SnipeitPS
online version:
schema: 2.0.0
---
# Remove-SnipeitLicense
## SYNOPSIS
Removes licence from Snipe-it asset system
## SYNTAX
```
Remove-SnipeitLicense [-id] <Int32[]> [-URL] <String> [-APIKey] <String> [-WhatIf] [-Confirm]
[<CommonParameters>]
```
## DESCRIPTION
Removes licence or multiple licenses from Snipe-it asset system
## EXAMPLES
### EXAMPLE 1
```
Remove-SnipeitLicence -ID 44 -Verbose
```
### EXAMPLE 2
```
Get-SnipeitLicence -product_key 123456789 | Remove-SnipeitLicense
```
## PARAMETERS
### -APIKey
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -id
Unique ID For licence to be removed
```yaml
Type: Int32[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -URL
URL of Snipeit system, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Confirm
Prompts you for confirmation before running the cmdlet.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS

View file

@ -0,0 +1,122 @@
---
external help file: SnipeitPS-help.xml
Module Name: SnipeitPS
online version:
schema: 2.0.0
---
# Remove-SnipeitLocation
## SYNOPSIS
Removes Location from Snipe-it asset system
## SYNTAX
```
Remove-SnipeitLocation [-id] <Int32[]> [-URL] <String> [-APIKey] <String> [-WhatIf] [-Confirm]
[<CommonParameters>]
```
## DESCRIPTION
Removes localtion or multiple locations from Snipe-it asset system
## EXAMPLES
### EXAMPLE 1
```
Remove-SnipeitLocation -ID 44 -Verbose
```
### EXAMPLE 2
```
Get-SnipeitLocation -city Arkham | Remove-SnipeitLocation
```
## PARAMETERS
### -APIKey
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -id
Unique ID For location to be removed
```yaml
Type: Int32[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -URL
URL of Snipeit system, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Confirm
Prompts you for confirmation before running the cmdlet.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS

View file

@ -0,0 +1,122 @@
---
external help file: SnipeitPS-help.xml
Module Name: SnipeitPS
online version:
schema: 2.0.0
---
# Remove-SnipeitManufacturer
## SYNOPSIS
Removes manufacturer from Snipe-it asset system
## SYNTAX
```
Remove-SnipeitManufacturer [-id] <Int32[]> [-URL] <String> [-APIKey] <String> [-WhatIf] [-Confirm]
[<CommonParameters>]
```
## DESCRIPTION
Removes manufacturer or multiple manufacturers from Snipe-it asset system
## EXAMPLES
### EXAMPLE 1
```
Remove-SnipeitManufacturer -ID 44 -Verbose
```
### EXAMPLE 2
```
Get-SnipeitManufacturer | Where-object {$_.name -like '*something*'} | Remove-SnipeitManufacturer
```
## PARAMETERS
### -APIKey
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -id
Unique ID For manufacturer to be removed
```yaml
Type: Int32[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -URL
URL of Snipeit system, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Confirm
Prompts you for confirmation before running the cmdlet.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS

122
docs/Remove-SnipeitModel.md Normal file
View file

@ -0,0 +1,122 @@
---
external help file: SnipeitPS-help.xml
Module Name: SnipeitPS
online version:
schema: 2.0.0
---
# Remove-SnipeitModel
## SYNOPSIS
Removes Asset model from Snipe-it asset system
## SYNTAX
```
Remove-SnipeitModel [-id] <Int32[]> [-URL] <String> [-APIKey] <String> [-WhatIf] [-Confirm]
[<CommonParameters>]
```
## DESCRIPTION
Removes asset model or multiple assets models from Snipe-it asset system
## EXAMPLES
### EXAMPLE 1
```
Remove-SnipeitModel -ID 44 -Verbose
```
### EXAMPLE 2
```
Get-SnipeitModel -search needle | Remove-SnipeitModel
```
## PARAMETERS
### -APIKey
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -id
Unique ID For Model to be removed
```yaml
Type: Int32[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -URL
URL of Snipeit system, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Confirm
Prompts you for confirmation before running the cmdlet.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS

View file

@ -17,7 +17,7 @@ Remove-SnipeitUser [-id] <Int32> [-URL] <String> [-APIKey] <String> [-WhatIf] [-
``` ```
## DESCRIPTION ## DESCRIPTION
Long description Removes Uuser or users from Snipe-it asset system
## EXAMPLES ## EXAMPLES
@ -54,7 +54,7 @@ Aliases:
Required: True Required: True
Position: 1 Position: 1
Default value: 0 Default value: 0
Accept pipeline input: False Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False Accept wildcard characters: False
``` ```

View file

@ -0,0 +1,162 @@
---
external help file: SnipeitPS-help.xml
Module Name: SnipeitPS
online version:
schema: 2.0.0
---
# Reset-SnipeitAssetOwner
## SYNOPSIS
Checkin asset
## SYNTAX
```
Reset-SnipeitAssetOwner [-id] <Int32> [[-status_id] <Int32>] [[-location_id] <Int32>] [[-notes] <String>]
[-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
```
## DESCRIPTION
Checks asset in from current user/localtion/asset
## EXAMPLES
### EXAMPLE 1
```
Remove-SnipeitUser -ID 44 -url $url -apiKey $secret -Verbose
```
## PARAMETERS
### -apiKey
User's API Key for Snipeit, can be set using Set-SnipeitInfoeItInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -id
Unique ID For asset to checkin
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -location_id
Location id to change asset location to
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -notes
Notes about checkin
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -status_id
Change asset status to
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -url
URL of Snipeit system, can be set using Set-SnipeitInfoeItInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Confirm
Prompts you for confirmation before running the cmdlet.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS

View file

@ -33,7 +33,7 @@ Set-SnipeitAsset -id 1 -status_id 1 -model_id 1 -name "Machine1"
### EXAMPLE 2 ### EXAMPLE 2
``` ```
Set-SnipeitAsset -id 1 -status_id 1 -model_id 1 -name "Machine1" -CustomValues = @{ "_snipeit_os_5 = "Windows 10 Pro" } Set-SnipeitAsset -id 1 -name "Machine1" -customfields = @{ "_snipeit_os_5" = "Windows 10 Pro" ; "_snipeit_os_version" = "1909" }
``` ```
### EXAMPLE 3 ### EXAMPLE 3

208
docs/Set-SnipeitCategory.md Normal file
View file

@ -0,0 +1,208 @@
---
external help file: SnipeitPS-help.xml
Module Name: SnipeitPS
online version:
schema: 2.0.0
---
# Set-SnipeitCategory
## SYNOPSIS
Create a new Snipe-IT Category
## SYNTAX
```
Set-SnipeitCategory [-id] <Int32[]> [[-name] <String>] [[-category_type] <String>] [[-eula_text] <String>]
[[-use_default_eula] <Boolean>] [[-require_acceptance] <Boolean>] [[-checkin_email] <Boolean>] [-url] <String>
[-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### EXAMPLE 1
```
Set-SnipeitCategory -id 4 -name "Laptops"
```
## PARAMETERS
### -apiKey
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 9
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -category_type
{{ Fill category_type Description }}
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -checkin_email
Should the user be emailed the EULA and/or an acceptance confirmation email when this item is checked in?
```yaml
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: 7
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -eula_text
This allows you to customize your EULAs for specific types of assets
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -id
{{ Fill id Description }}
```yaml
Type: Int32[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -name
Name of new category to be created
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -require_acceptance
If switch is present, require users to confirm acceptance of assets in this category
```yaml
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: 6
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -url
URL of Snipeit system, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 8
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -use_default_eula
If switch is present, use the primary default EULA
```yaml
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -Confirm
Prompts you for confirmation before running the cmdlet.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS

133
docs/Set-SnipeitCompany.md Normal file
View file

@ -0,0 +1,133 @@
---
external help file: SnipeitPS-help.xml
Module Name: SnipeitPS
online version:
schema: 2.0.0
---
# Set-SnipeitCompany
## SYNOPSIS
Updates company name
## SYNTAX
```
Set-SnipeitCompany [-id] <Int32[]> [-name] <String> [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm]
[<CommonParameters>]
```
## DESCRIPTION
Updates companyt name on Snipe-It system
## EXAMPLES
### EXAMPLE 1
```
An example
```
## PARAMETERS
### -apiKey
User's API Key for Snipeit, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -id
ID number of company
```yaml
Type: Int32[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -name
Company name
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -url
URL of Snipeit system, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Confirm
Prompts you for confirmation before running the cmdlet.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
General notes
## RELATED LINKS

View file

@ -0,0 +1,239 @@
---
external help file: SnipeitPS-help.xml
Module Name: SnipeitPS
online version:
schema: 2.0.0
---
# Set-SnipeitCustomField
## SYNOPSIS
Add a new Custom Field to Snipe-it asset system
## SYNTAX
```
Set-SnipeitCustomField [-id] <Int32[]> [[-name] <String>] [[-help_text] <String>] [-element] <String>
[[-format] <String>] [[-field_values] <String>] [[-field_encrypted] <Boolean>] [[-show_in_email] <Boolean>]
[[-custom_format] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
```
## DESCRIPTION
Add a new Custom Field to Snipe-it asset system
## EXAMPLES
### EXAMPLE 1
```
New-SnipeitCustomField -Name "AntivirusInstalled" -Format "BOOLEAN" -HelpText "Is AntiVirus installed on Asset"
```
## PARAMETERS
### -apiKey
Users API Key for Snipeit, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 11
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -custom_format
In the case of format 'CUSTOM REGEX', this should be validation regex this field
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 9
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -element
Form field type that should be displayed.
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -field_encrypted
Whether the field should be encrypted.
(This can cause issues if you change it after the field was created.)
```yaml
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: 7
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -field_values
In the case of list boxes, etc, this should be a list of the options available
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -format
How the field should be validated
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -help_text
Any additional text you wish to display under the new form field to make it clearer what the gauges should be.
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -id
{{ Fill id Description }}
```yaml
Type: Int32[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -name
The field's name, which is also the form label
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -show_in_email
Whether or not to show the custom field in email notifications
```yaml
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: 8
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -url
URL of Snipeit system, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 10
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Confirm
Prompts you for confirmation before running the cmdlet.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS

View file

@ -0,0 +1,193 @@
---
external help file: SnipeitPS-help.xml
Module Name: SnipeitPS
online version:
schema: 2.0.0
---
# Set-SnipeitDepartment
## SYNOPSIS
Updates a department
## SYNTAX
```
Set-SnipeitDepartment [-id] <Int32[]> [[-name] <String>] [[-company_id] <Int32>] [[-location_id] <Int32>]
[[-manager_id] <Int32>] [[-notes] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm]
[<CommonParameters>]
```
## DESCRIPTION
Updates the department on Snipe-It system
## EXAMPLES
### EXAMPLE 1
```
Set-SnipeitDepartment -id 4 -manager_id 3
```
## PARAMETERS
### -apiKey
Users API Key for Snipeit, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 8
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -company_id
ID number of company
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -id
Id number of Department
```yaml
Type: Int32[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -location_id
ID number of location
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -manager_id
ID number of manager
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -name
Department Name
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
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: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -url
URL of Snipeit system, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 7
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Confirm
Prompts you for confirmation before running the cmdlet.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS

213
docs/Set-SnipeitStatus.md Normal file
View file

@ -0,0 +1,213 @@
---
external help file: SnipeitPS-help.xml
Module Name: SnipeitPS
online version:
schema: 2.0.0
---
# Set-SnipeitStatus
## SYNOPSIS
Sets Snipe-it Status Labels
## SYNTAX
```
Set-SnipeitStatus [-id] <Int32[]> [[-name] <String>] [-type] <String> [[-notes] <String>] [[-color] <String>]
[[-show_in_nav] <Boolean>] [[-default_label] <Boolean>] [-url] <String> [-apiKey] <String> [-WhatIf]
[-Confirm] [<CommonParameters>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### EXAMPLE 1
```
Get-SnipeitStatus -search "Ready to Deploy"
```
### EXAMPLE 2
```
Set-SnipeitStatus -id 3 -name 'Waiting for arrival' -type pending
```
## PARAMETERS
### -apiKey
Users API Key for Snipeit, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 9
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -color
Hex code showing what color the status label should be on the pie chart in the dashboard
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -default_label
1 or 0 - determine whether it should be bubbled up to the top of the list of available statuses
```yaml
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: 7
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -id
A id of specific Status Label
```yaml
Type: Int32[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -name
{{ Fill name Description }}
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
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: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -show_in_nav
1 or 0 - determine whether the status label should show in the left-side nav of the web GUI
```yaml
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: 6
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -type
{{ Fill type Description }}
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -url
URL of Snipeit system, can be set using Set-SnipeitInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 8
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Confirm
Prompts you for confirmation before running the cmdlet.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS

View file

@ -59,12 +59,18 @@ Gets a list of Snipe-it Models
### [Get-SnipeitStatus](Get-SnipeitStatus.md) ### [Get-SnipeitStatus](Get-SnipeitStatus.md)
Gets a list of Snipe-it Status Labels Gets a list of Snipe-it Status Labels
### [New-SnipeitAccessory](New-SnipeitAccessory.md)
Creates new accessory on Snipe-It system
### [New-SnipeitAsset](New-SnipeitAsset.md) ### [New-SnipeitAsset](New-SnipeitAsset.md)
Add a new Asset to Snipe-it asset system Add a new Asset to Snipe-it asset system
### [New-SnipeitAssetMaintenance](New-SnipeitAssetMaintenance.md) ### [New-SnipeitAssetMaintenance](New-SnipeitAssetMaintenance.md)
Add a new Asset maintenence to Snipe-it asset system Add a new Asset maintenence to Snipe-it asset system
### [New-SnipeitAudit](New-SnipeitAudit.md)
Add a new Audit to Snipe-it asset system
### [New-SnipeitCategory](New-SnipeitCategory.md) ### [New-SnipeitCategory](New-SnipeitCategory.md)
Create a new Snipe-IT Category Create a new Snipe-IT Category
@ -92,15 +98,51 @@ Add a new Model to Snipe-it asset system
### [New-SnipeitUser](New-SnipeitUser.md) ### [New-SnipeitUser](New-SnipeitUser.md)
Creates a new user Creates a new user
### [Remove-SnipeitAccessory](Remove-SnipeitAccessory.md)
Removes Accessory from Snipe-it asset system
### [Remove-SnipeitAsset](Remove-SnipeitAsset.md) ### [Remove-SnipeitAsset](Remove-SnipeitAsset.md)
Removes Asset from Snipe-it asset system Removes Asset from Snipe-it asset system
### [Remove-SnipeitAssetMaintenance](Remove-SnipeitAssetMaintenance.md)
Remove asset maintenance from Snipe-it asset system
### [Remove-SnipeitCategory](Remove-SnipeitCategory.md)
Removes category from Snipe-it asset system
### [Remove-SnipeitCompany](Remove-SnipeitCompany.md)
Removes Company from Snipe-it asset system
### [Remove-SnipeitComponent](Remove-SnipeitComponent.md)
Removes component from Snipe-it asset system
### [Remove-SnipeitCustomField](Remove-SnipeitCustomField.md)
Removes custom field from Snipe-it asset system
### [Remove-SnipeitDepartment](Remove-SnipeitDepartment.md)
Removes department from Snipe-it asset system
### [Remove-SnipeitLicense](Remove-SnipeitLicense.md)
Removes licence from Snipe-it asset system
### [Remove-SnipeitLocation](Remove-SnipeitLocation.md)
Removes Location from Snipe-it asset system
### [Remove-SnipeitManufacturer](Remove-SnipeitManufacturer.md)
Removes manufacturer from Snipe-it asset system
### [Remove-SnipeitModel](Remove-SnipeitModel.md)
Removes Asset model from Snipe-it asset system
### [Remove-SnipeitUser](Remove-SnipeitUser.md) ### [Remove-SnipeitUser](Remove-SnipeitUser.md)
Removes User from Snipe-it asset system Removes User from Snipe-it asset system
### [Reset-SnipeitAccessoryOwner](Reset-SnipeitAccessoryOwner.md) ### [Reset-SnipeitAccessoryOwner](Reset-SnipeitAccessoryOwner.md)
Checkin accessories Checkin accessories
### [Reset-SnipeitAssetOwner](Reset-SnipeitAssetOwner.md)
Checkin asset
### [Set-SnipeitAccessory](Set-SnipeitAccessory.md) ### [Set-SnipeitAccessory](Set-SnipeitAccessory.md)
Updates accessory on Snipe-It system Updates accessory on Snipe-It system
@ -113,9 +155,21 @@ Update a specific Asset in the Snipe-it asset system
### [Set-SnipeitAssetOwner](Set-SnipeitAssetOwner.md) ### [Set-SnipeitAssetOwner](Set-SnipeitAssetOwner.md)
Checkout asset Checkout asset
### [Set-SnipeitCategory](Set-SnipeitCategory.md)
Create a new Snipe-IT Category
### [Set-SnipeitCompany](Set-SnipeitCompany.md)
Updates company name
### [Set-SnipeitComponent](Set-SnipeitComponent.md) ### [Set-SnipeitComponent](Set-SnipeitComponent.md)
Updates component Updates component
### [Set-SnipeitCustomField](Set-SnipeitCustomField.md)
Add a new Custom Field to Snipe-it asset system
### [Set-SnipeitDepartment](Set-SnipeitDepartment.md)
Updates a department
### [Set-SnipeitInfo](Set-SnipeitInfo.md) ### [Set-SnipeitInfo](Set-SnipeitInfo.md)
Sets authetication information Sets authetication information
@ -131,6 +185,9 @@ Updates Location in Snipe-it asset system
### [Set-SnipeitModel](Set-SnipeitModel.md) ### [Set-SnipeitModel](Set-SnipeitModel.md)
Updates Model on Snipe-it asset system Updates Model on Snipe-it asset system
### [Set-SnipeitStatus](Set-SnipeitStatus.md)
Sets Snipe-it Status Labels
### [Set-SnipeitUser](Set-SnipeitUser.md) ### [Set-SnipeitUser](Set-SnipeitUser.md)
Creates a new user Creates a new user