From d8652d0cbadae7dfb58ca428cc507363ffe10a98 Mon Sep 17 00:00:00 2001 From: Petri Asikainen Date: Sat, 12 Jun 2021 12:30:41 +0300 Subject: [PATCH 01/15] Remove new item types --- SnipeitPS/Public/Remove-SnipeitAccessory.ps1 | 55 ++++++++ SnipeitPS/Public/Remove-SnipeitAsset.ps1 | 44 +++---- .../Public/Remove-SnipeitAssetMaintenance.ps1 | 40 +++--- SnipeitPS/Public/Remove-SnipeitCategory.ps1 | 55 ++++++++ SnipeitPS/Public/Remove-SnipeitCompany.ps1 | 55 ++++++++ SnipeitPS/Public/Remove-SnipeitComponent.ps1 | 55 ++++++++ .../Public/Remove-SnipeitCustomField.ps1 | 55 ++++++++ SnipeitPS/Public/Remove-SnipeitDepartment.ps1 | 55 ++++++++ SnipeitPS/Public/Remove-SnipeitLicense.ps1 | 55 ++++++++ SnipeitPS/Public/Remove-SnipeitLocation.ps1 | 55 ++++++++ .../Public/Remove-SnipeitManufacturer.ps1 | 55 ++++++++ SnipeitPS/Public/Remove-SnipeitModel.ps1 | 55 ++++++++ SnipeitPS/Public/Remove-SnipeitUser.ps1 | 39 +++--- SnipeitPS/SnipeitPS.psd1 | 12 +- docs/Get-SnipeitAsset.md | 58 +++++++-- docs/New-SnipeitAsset.md | 2 +- docs/Remove-SnipeitAccessory.md | 122 ++++++++++++++++++ docs/Remove-SnipeitAsset.md | 16 ++- docs/Remove-SnipeitCompany.md | 122 ++++++++++++++++++ docs/Remove-SnipeitComponent.md | 122 ++++++++++++++++++ docs/Remove-SnipeitCustomField.md | 122 ++++++++++++++++++ docs/Remove-SnipeitDepartment.md | 122 ++++++++++++++++++ docs/Remove-SnipeitLicense.md | 122 ++++++++++++++++++ docs/Remove-SnipeitLocation.md | 122 ++++++++++++++++++ docs/Remove-SnipeitManufacturer.md | 122 ++++++++++++++++++ docs/Remove-SnipeitModel.md | 122 ++++++++++++++++++ docs/Remove-SnipeitUser.md | 4 +- docs/Set-SnipeitAsset.md | 2 +- docs/SnipeitPS.md | 27 ++++ 29 files changed, 1811 insertions(+), 81 deletions(-) create mode 100644 SnipeitPS/Public/Remove-SnipeitAccessory.ps1 create mode 100644 SnipeitPS/Public/Remove-SnipeitCategory.ps1 create mode 100644 SnipeitPS/Public/Remove-SnipeitCompany.ps1 create mode 100644 SnipeitPS/Public/Remove-SnipeitComponent.ps1 create mode 100644 SnipeitPS/Public/Remove-SnipeitCustomField.ps1 create mode 100644 SnipeitPS/Public/Remove-SnipeitDepartment.ps1 create mode 100644 SnipeitPS/Public/Remove-SnipeitLicense.ps1 create mode 100644 SnipeitPS/Public/Remove-SnipeitLocation.ps1 create mode 100644 SnipeitPS/Public/Remove-SnipeitManufacturer.ps1 create mode 100644 SnipeitPS/Public/Remove-SnipeitModel.ps1 create mode 100644 docs/Remove-SnipeitAccessory.md create mode 100644 docs/Remove-SnipeitCompany.md create mode 100644 docs/Remove-SnipeitComponent.md create mode 100644 docs/Remove-SnipeitCustomField.md create mode 100644 docs/Remove-SnipeitDepartment.md create mode 100644 docs/Remove-SnipeitLicense.md create mode 100644 docs/Remove-SnipeitLocation.md create mode 100644 docs/Remove-SnipeitManufacturer.md create mode 100644 docs/Remove-SnipeitModel.md diff --git a/SnipeitPS/Public/Remove-SnipeitAccessory.ps1 b/SnipeitPS/Public/Remove-SnipeitAccessory.ps1 new file mode 100644 index 0000000..387ab01 --- /dev/null +++ b/SnipeitPS/Public/Remove-SnipeitAccessory.ps1 @@ -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 + } + } +} diff --git a/SnipeitPS/Public/Remove-SnipeitAsset.ps1 b/SnipeitPS/Public/Remove-SnipeitAsset.ps1 index 064ef48..47811e7 100644 --- a/SnipeitPS/Public/Remove-SnipeitAsset.ps1 +++ b/SnipeitPS/Public/Remove-SnipeitAsset.ps1 @@ -2,7 +2,7 @@ .SYNOPSIS Removes Asset from Snipe-it asset system .DESCRIPTION - Removes Asset from Snipe-it asset system + Removes asset or multiple assets from Snipe-it asset system .PARAMETER ID Unique ID For Asset to be removed .PARAMETER url @@ -13,6 +13,9 @@ .EXAMPLE Remove-SnipeitAsset -ID 44 -Verbose + + .EXAMPLE + Get-SnipeitAsset -serial 123456789 | Remove-SnipeitAsset #> function Remove-SnipeitAsset () @@ -23,34 +26,31 @@ function Remove-SnipeitAsset () )] Param( - [parameter(mandatory = $true)] - [int]$id, + [parameter(mandatory = $true,ValueFromPipelineByPropertyName)] + [int[]]$id, [parameter(mandatory = $true)] [string]$URL, [parameter(mandatory = $true)] [string]$APIKey ) - - Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name - - $Values = @{ - "ID" = $id + begin { + Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name } + process { + foreach($asset_id in $id){ + $Parameters = @{ + Uri = "$url/api/v1/hardware/$asset_id" + Method = 'Delete' + Body = '{}' + Token = $apiKey + } - $Body = $Values | ConvertTo-Json - - $Parameters = @{ - Uri = "$url/api/v1/hardware/$ID" - Method = 'Delete' - Body = $Body - Token = $apiKey + If ($PSCmdlet.ShouldProcess("ShouldProcess?")) + { + $result = Invoke-SnipeitMethod @Parameters + } + $result + } } - - If ($PSCmdlet.ShouldProcess("ShouldProcess?")) - { - $result = Invoke-SnipeitMethod @Parameters - } - - $result } diff --git a/SnipeitPS/Public/Remove-SnipeitAssetMaintenance.ps1 b/SnipeitPS/Public/Remove-SnipeitAssetMaintenance.ps1 index c3993e1..ed450f7 100644 --- a/SnipeitPS/Public/Remove-SnipeitAssetMaintenance.ps1 +++ b/SnipeitPS/Public/Remove-SnipeitAssetMaintenance.ps1 @@ -3,7 +3,7 @@ function Remove-SnipeitAssetMaintenance { .SYNOPSIS Remove asset maintenance from Snipe-it asset system .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 Unique ID of the asset maintenance to be removed .PARAMETER url @@ -21,8 +21,8 @@ function Remove-SnipeitAssetMaintenance { )] param ( # Asset maintenance ID - [Parameter(Mandatory = $true)] - [int] + [Parameter(Mandatory = $true,ValueFromPipelineByPropertyName)] + [int[]] $id, # Snipeit URL @@ -35,26 +35,24 @@ function Remove-SnipeitAssetMaintenance { [string] $apiKey ) - - Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name - - $Values = @{ - "ID" = $id + begin { + Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name } + 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 = @{ - Uri = "$url/api/v1/maintenances/$ID" - Method = 'Delete' - Body = $Body - Token = $apiKey + $result + } } - - If ($PSCmdlet.ShouldProcess("ShouldProcess?")) - { - $result = Invoke-SnipeitMethod @Parameters - } - - $result } diff --git a/SnipeitPS/Public/Remove-SnipeitCategory.ps1 b/SnipeitPS/Public/Remove-SnipeitCategory.ps1 new file mode 100644 index 0000000..ee864a4 --- /dev/null +++ b/SnipeitPS/Public/Remove-SnipeitCategory.ps1 @@ -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-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($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 + } + } +} diff --git a/SnipeitPS/Public/Remove-SnipeitCompany.ps1 b/SnipeitPS/Public/Remove-SnipeitCompany.ps1 new file mode 100644 index 0000000..d9b4758 --- /dev/null +++ b/SnipeitPS/Public/Remove-SnipeitCompany.ps1 @@ -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 + } + } +} diff --git a/SnipeitPS/Public/Remove-SnipeitComponent.ps1 b/SnipeitPS/Public/Remove-SnipeitComponent.ps1 new file mode 100644 index 0000000..9788674 --- /dev/null +++ b/SnipeitPS/Public/Remove-SnipeitComponent.ps1 @@ -0,0 +1,55 @@ +<# + .SYNOPSIS + Removes component from Snipe-it asset system + .DESCRIPTION + Removes comoponent or multiple components from Snipe-it asset system + .PARAMETER ID + 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 + } + } +} diff --git a/SnipeitPS/Public/Remove-SnipeitCustomField.ps1 b/SnipeitPS/Public/Remove-SnipeitCustomField.ps1 new file mode 100644 index 0000000..291eac4 --- /dev/null +++ b/SnipeitPS/Public/Remove-SnipeitCustomField.ps1 @@ -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 + } + } +} diff --git a/SnipeitPS/Public/Remove-SnipeitDepartment.ps1 b/SnipeitPS/Public/Remove-SnipeitDepartment.ps1 new file mode 100644 index 0000000..7d0ed95 --- /dev/null +++ b/SnipeitPS/Public/Remove-SnipeitDepartment.ps1 @@ -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($depatment_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 + } + } +} diff --git a/SnipeitPS/Public/Remove-SnipeitLicense.ps1 b/SnipeitPS/Public/Remove-SnipeitLicense.ps1 new file mode 100644 index 0000000..094435c --- /dev/null +++ b/SnipeitPS/Public/Remove-SnipeitLicense.ps1 @@ -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 + } + } +} diff --git a/SnipeitPS/Public/Remove-SnipeitLocation.ps1 b/SnipeitPS/Public/Remove-SnipeitLocation.ps1 new file mode 100644 index 0000000..d0bfa94 --- /dev/null +++ b/SnipeitPS/Public/Remove-SnipeitLocation.ps1 @@ -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 + } + } +} diff --git a/SnipeitPS/Public/Remove-SnipeitManufacturer.ps1 b/SnipeitPS/Public/Remove-SnipeitManufacturer.ps1 new file mode 100644 index 0000000..40a87ca --- /dev/null +++ b/SnipeitPS/Public/Remove-SnipeitManufacturer.ps1 @@ -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 + } + } +} diff --git a/SnipeitPS/Public/Remove-SnipeitModel.ps1 b/SnipeitPS/Public/Remove-SnipeitModel.ps1 new file mode 100644 index 0000000..788710f --- /dev/null +++ b/SnipeitPS/Public/Remove-SnipeitModel.ps1 @@ -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 + } + } +} diff --git a/SnipeitPS/Public/Remove-SnipeitUser.ps1 b/SnipeitPS/Public/Remove-SnipeitUser.ps1 index 78fe42c..ca254bf 100644 --- a/SnipeitPS/Public/Remove-SnipeitUser.ps1 +++ b/SnipeitPS/Public/Remove-SnipeitUser.ps1 @@ -2,7 +2,7 @@ .SYNOPSIS Removes User from Snipe-it asset system .DESCRIPTION - Long description + Removes Uuser or users from Snipe-it asset system .PARAMETER ID Unique ID For User to be removed @@ -24,7 +24,7 @@ function Remove-SnipeitUser () )] Param( - [parameter(mandatory = $true)] + [parameter(mandatory = $true,ValueFromPipelineByPropertyName)] [int]$id, [parameter(mandatory = $true)] [string]$URL, @@ -32,26 +32,25 @@ function Remove-SnipeitUser () [string]$APIKey ) - - Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name - - $Values = @{ - "ID" = $id + begin{ + Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name } - $Body = $Values | ConvertTo-Json + process { + foreach($user_id in $id) { + $Parameters = @{ + Uri = "$url/api/v1/users/$user_id" + Method = 'Delete' + Body = '{}' + Token = $apiKey + } - $Parameters = @{ - Uri = "$url/api/v1/users/$ID" - Method = 'Delete' - Body = $Body - Token = $apiKey + If ($PSCmdlet.ShouldProcess("ShouldProcess?")) + { + $result = Invoke-SnipeitMethod @Parameters + } + + $result + } } - - If ($PSCmdlet.ShouldProcess("ShouldProcess?")) - { - $result = Invoke-SnipeitMethod @Parameters - } - - $result } diff --git a/SnipeitPS/SnipeitPS.psd1 b/SnipeitPS/SnipeitPS.psd1 index 7cf5bfb..d9daa74 100644 --- a/SnipeitPS/SnipeitPS.psd1 +++ b/SnipeitPS/SnipeitPS.psd1 @@ -115,7 +115,17 @@ FunctionsToExport = @( 'Set-SnipeitAccessoryOwner', 'Get-SnipeitAccessoryOwner', 'Reset-SnipeitAccessoryOwner', - 'Get-SnipeitActivity' + 'Get-SnipeitActivity', + 'Remove-SnipeitAccessory', + 'Remove-SnipeitCategory', + 'Remove-SnipeitCompany', + 'Remove-SnipeitComponent', + 'Remove-SnipeitCustomField', + 'Remove-SnipeitDepartment', + 'Remove-SnipeitLicense', + 'Remove-SnipeitLocation', + 'Remove-SnipeitManufacturer', + 'Remove-SnipeitModel' ) diff --git a/docs/Get-SnipeitAsset.md b/docs/Get-SnipeitAsset.md index 092af5c..66e3724 100644 --- a/docs/Get-SnipeitAsset.md +++ b/docs/Get-SnipeitAsset.md @@ -12,7 +12,7 @@ Gets a list of Snipe-it Assets or specific asset ## SYNTAX -### Search +### Search (Default) ``` Get-SnipeitAsset [-search ] [-order_number ] [-model_id ] [-category_id ] [-manufacturer_id ] [-company_id ] [-location_id ] [-depreciation_id ] @@ -35,6 +35,18 @@ Get-SnipeitAsset [-asset_tag ] -url -apiKey [] -url -apiKey [] ``` +### Assets due auditing soon +``` +Get-SnipeitAsset [-audit_due] [-sort ] [-order ] [-limit ] [-offset ] [-all] + -url -apiKey [] +``` + +### Assets overdue for auditing +``` +Get-SnipeitAsset [-audit_overdue] [-sort ] [-order ] [-limit ] [-offset ] [-all] + -url -apiKey [] +``` + ## DESCRIPTION {{ Fill in the Description }} @@ -67,7 +79,7 @@ A return all results, works with -offset and other parameters ```yaml Type: SwitchParameter -Parameter Sets: Search +Parameter Sets: Search, Assets due auditing soon, Assets overdue for auditing Aliases: Required: False @@ -107,6 +119,36 @@ Accept pipeline input: 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 Optionally restrict asset results to this category ID @@ -174,7 +216,7 @@ Defines batch size for -all ```yaml Type: Int32 -Parameter Sets: Search +Parameter Sets: Search, Assets due auditing soon, Assets overdue for auditing Aliases: Required: False @@ -234,7 +276,7 @@ Offset to use ```yaml Type: Int32 -Parameter Sets: Search +Parameter Sets: Search, Assets due auditing soon, Assets overdue for auditing Aliases: Required: False @@ -249,12 +291,12 @@ Specify the order (asc or desc) you wish to order by on your sort column ```yaml Type: String -Parameter Sets: Search +Parameter Sets: Search, Assets due auditing soon, Assets overdue for auditing Aliases: Required: False Position: Named -Default value: Desc +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` @@ -324,12 +366,12 @@ Specify the column name you wish to sort by ```yaml Type: String -Parameter Sets: Search +Parameter Sets: Search, Assets due auditing soon, Assets overdue for auditing Aliases: Required: False Position: Named -Default value: Created_at +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/docs/New-SnipeitAsset.md b/docs/New-SnipeitAsset.md index bd77a0b..34bef7c 100644 --- a/docs/New-SnipeitAsset.md +++ b/docs/New-SnipeitAsset.md @@ -39,7 +39,7 @@ Specifying asset tag when creating asset ### 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. ``` diff --git a/docs/Remove-SnipeitAccessory.md b/docs/Remove-SnipeitAccessory.md new file mode 100644 index 0000000..51ea7a9 --- /dev/null +++ b/docs/Remove-SnipeitAccessory.md @@ -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] [-URL] [-APIKey] [-WhatIf] [-Confirm] + [] +``` + +## 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 diff --git a/docs/Remove-SnipeitAsset.md b/docs/Remove-SnipeitAsset.md index f0dee8d..8ee957a 100644 --- a/docs/Remove-SnipeitAsset.md +++ b/docs/Remove-SnipeitAsset.md @@ -13,11 +13,12 @@ Removes Asset from Snipe-it asset system ## SYNTAX ``` -Remove-SnipeitAsset [-id] [-URL] [-APIKey] [-WhatIf] [-Confirm] [] +Remove-SnipeitAsset [-id] [-URL] [-APIKey] [-WhatIf] [-Confirm] + [] ``` ## DESCRIPTION -Removes Asset from Snipe-it asset system +Removes asset or multiple assets from Snipe-it asset system ## EXAMPLES @@ -26,6 +27,11 @@ Removes Asset from Snipe-it asset system Remove-SnipeitAsset -ID 44 -Verbose ``` +### EXAMPLE 2 +``` +Get-SnipeitAsset -serial 123456789 | Remove-SnipeitAsset +``` + ## PARAMETERS ### -APIKey @@ -47,14 +53,14 @@ Accept wildcard characters: False Unique ID For Asset to be removed ```yaml -Type: Int32 +Type: Int32[] Parameter Sets: (All) Aliases: Required: True Position: 1 -Default value: 0 -Accept pipeline input: False +Default value: None +Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` diff --git a/docs/Remove-SnipeitCompany.md b/docs/Remove-SnipeitCompany.md new file mode 100644 index 0000000..e771629 --- /dev/null +++ b/docs/Remove-SnipeitCompany.md @@ -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] [-URL] [-APIKey] [-WhatIf] [-Confirm] + [] +``` + +## DESCRIPTION +Removes Company or multiple Companies from Snipe-it asset system + +## EXAMPLES + +### EXAMPLE 1 +``` +Remove-SnipeitCompany -ID 44 -Verbose +``` + +### EXAMPLE 2 +``` +Get-SnipeitCompany -search "some corp" | 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 diff --git a/docs/Remove-SnipeitComponent.md b/docs/Remove-SnipeitComponent.md new file mode 100644 index 0000000..d664225 --- /dev/null +++ b/docs/Remove-SnipeitComponent.md @@ -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] [-URL] [-APIKey] [-WhatIf] [-Confirm] + [] +``` + +## DESCRIPTION +Removes comoponent 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 +Unique ID For component to be removed + +```yaml +Type: Int32[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -URL +URL of Snipeit system, can be set using Set-SnipeitInfo command + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS diff --git a/docs/Remove-SnipeitCustomField.md b/docs/Remove-SnipeitCustomField.md new file mode 100644 index 0000000..fa21c51 --- /dev/null +++ b/docs/Remove-SnipeitCustomField.md @@ -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] [-URL] [-APIKey] [-WhatIf] [-Confirm] + [] +``` + +## 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 diff --git a/docs/Remove-SnipeitDepartment.md b/docs/Remove-SnipeitDepartment.md new file mode 100644 index 0000000..5f61818 --- /dev/null +++ b/docs/Remove-SnipeitDepartment.md @@ -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] [-URL] [-APIKey] [-WhatIf] [-Confirm] + [] +``` + +## DESCRIPTION +Removes department or multiple departments from Snipe-it asset system + +## EXAMPLES + +### EXAMPLE 1 +``` +Remove-SnipeitDepartment -ID 44 -Verbose +``` + +### EXAMPLE 2 +``` +Get-SnipeitDepartment -search 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 diff --git a/docs/Remove-SnipeitLicense.md b/docs/Remove-SnipeitLicense.md new file mode 100644 index 0000000..e778b67 --- /dev/null +++ b/docs/Remove-SnipeitLicense.md @@ -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] [-URL] [-APIKey] [-WhatIf] [-Confirm] + [] +``` + +## 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 diff --git a/docs/Remove-SnipeitLocation.md b/docs/Remove-SnipeitLocation.md new file mode 100644 index 0000000..a7e8d11 --- /dev/null +++ b/docs/Remove-SnipeitLocation.md @@ -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] [-URL] [-APIKey] [-WhatIf] [-Confirm] + [] +``` + +## 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 diff --git a/docs/Remove-SnipeitManufacturer.md b/docs/Remove-SnipeitManufacturer.md new file mode 100644 index 0000000..2995b69 --- /dev/null +++ b/docs/Remove-SnipeitManufacturer.md @@ -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] [-URL] [-APIKey] [-WhatIf] [-Confirm] + [] +``` + +## DESCRIPTION +Removes manufacturer or multiple manufacturers from Snipe-it asset system + +## EXAMPLES + +### EXAMPLE 1 +``` +Remove-SnipeitManufacturer -ID 44 -Verbose +``` + +### EXAMPLE 2 +``` +Get-SnipeitManufacturer -search needle | 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 diff --git a/docs/Remove-SnipeitModel.md b/docs/Remove-SnipeitModel.md new file mode 100644 index 0000000..04592bd --- /dev/null +++ b/docs/Remove-SnipeitModel.md @@ -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] [-URL] [-APIKey] [-WhatIf] [-Confirm] + [] +``` + +## 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 diff --git a/docs/Remove-SnipeitUser.md b/docs/Remove-SnipeitUser.md index bcca3a0..850d37f 100644 --- a/docs/Remove-SnipeitUser.md +++ b/docs/Remove-SnipeitUser.md @@ -17,7 +17,7 @@ Remove-SnipeitUser [-id] [-URL] [-APIKey] [-WhatIf] [- ``` ## DESCRIPTION -Long description +Removes Uuser or users from Snipe-it asset system ## EXAMPLES @@ -54,7 +54,7 @@ Aliases: Required: True Position: 1 Default value: 0 -Accept pipeline input: False +Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` diff --git a/docs/Set-SnipeitAsset.md b/docs/Set-SnipeitAsset.md index da2abc7..c715cb4 100644 --- a/docs/Set-SnipeitAsset.md +++ b/docs/Set-SnipeitAsset.md @@ -33,7 +33,7 @@ Set-SnipeitAsset -id 1 -status_id 1 -model_id 1 -name "Machine1" ### 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 diff --git a/docs/SnipeitPS.md b/docs/SnipeitPS.md index c54370c..881a1d9 100644 --- a/docs/SnipeitPS.md +++ b/docs/SnipeitPS.md @@ -92,9 +92,36 @@ Add a new Model to Snipe-it asset system ### [New-SnipeitUser](New-SnipeitUser.md) Creates a new user +### [Remove-SnipeitAccessory](Remove-SnipeitAccessory.md) +Removes Accessory from Snipe-it asset system + ### [Remove-SnipeitAsset](Remove-SnipeitAsset.md) Removes Asset 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) Removes User from Snipe-it asset system From 3c45eceff95fdedcc3e08aea7a6438d5539e44c3 Mon Sep 17 00:00:00 2001 From: Petri Asikainen Date: Sat, 12 Jun 2021 12:34:54 +0300 Subject: [PATCH 02/15] change filename from plurar to singular --- .../{Set-SnipeitComponents.ps1 => Set-SnipeitComponent.ps1} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename SnipeitPS/Public/{Set-SnipeitComponents.ps1 => Set-SnipeitComponent.ps1} (100%) diff --git a/SnipeitPS/Public/Set-SnipeitComponents.ps1 b/SnipeitPS/Public/Set-SnipeitComponent.ps1 similarity index 100% rename from SnipeitPS/Public/Set-SnipeitComponents.ps1 rename to SnipeitPS/Public/Set-SnipeitComponent.ps1 From 211460cfb6324eee9e6ee88731003896ab5a3220 Mon Sep 17 00:00:00 2001 From: Petri Asikainen Date: Sat, 12 Jun 2021 13:00:35 +0300 Subject: [PATCH 03/15] corrected spelling --- SnipeitPS/Public/Remove-SnipeitComponent.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SnipeitPS/Public/Remove-SnipeitComponent.ps1 b/SnipeitPS/Public/Remove-SnipeitComponent.ps1 index 9788674..2dfd012 100644 --- a/SnipeitPS/Public/Remove-SnipeitComponent.ps1 +++ b/SnipeitPS/Public/Remove-SnipeitComponent.ps1 @@ -2,8 +2,8 @@ .SYNOPSIS Removes component from Snipe-it asset system .DESCRIPTION - Removes comoponent or multiple components from Snipe-it asset system - .PARAMETER ID + 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 From ac842e3d6a92a26857ceea259444b80c4a6d6719 Mon Sep 17 00:00:00 2001 From: Petri Asikainen Date: Sun, 13 Jun 2021 18:13:22 +0300 Subject: [PATCH 04/15] manage categories --- SnipeitPS/Public/New-SnipeitCategory.ps1 | 79 +++++++++--------- SnipeitPS/Public/Remove-SnipeitCategory.ps1 | 2 +- SnipeitPS/Public/Set-SnipeitCategory.ps1 | 90 +++++++++++++++++++++ 3 files changed, 130 insertions(+), 41 deletions(-) create mode 100644 SnipeitPS/Public/Set-SnipeitCategory.ps1 diff --git a/SnipeitPS/Public/New-SnipeitCategory.ps1 b/SnipeitPS/Public/New-SnipeitCategory.ps1 index 02aa68a..62ca0e9 100644 --- a/SnipeitPS/Public/New-SnipeitCategory.ps1 +++ b/SnipeitPS/Public/New-SnipeitCategory.ps1 @@ -8,11 +8,8 @@ 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 eula_text +This allows you to customize your EULAs for specific types of assets .PARAMETER use_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 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 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")] [string]$category_type, - [parameter(mandatory = $true)] - [string]$url, + [string]$eula_text, - [parameter(mandatory = $true)] - [string]$apiKey, [switch]$use_default_eula, [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 = @{ - "name" = $name - "category_type" = $category_type + $Values = . Get-ParameterValue -Parameters $MyInvocation.MyCommand.Parameters -BoundParameters $PSBoundParameters + + $Body = $Values | ConvertTo-Json; } - if ($use_default_eula) { - $Values += @{"use_default_eula" = $true} + process { + + $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 } diff --git a/SnipeitPS/Public/Remove-SnipeitCategory.ps1 b/SnipeitPS/Public/Remove-SnipeitCategory.ps1 index ee864a4..873858b 100644 --- a/SnipeitPS/Public/Remove-SnipeitCategory.ps1 +++ b/SnipeitPS/Public/Remove-SnipeitCategory.ps1 @@ -18,7 +18,7 @@ Get-SnipeitCategory -search something | Remove-SnipeitCategory #> -function Remove-SnipeitModel () +function Remove-SnipeitCategory () { [CmdletBinding( SupportsShouldProcess = $true, diff --git a/SnipeitPS/Public/Set-SnipeitCategory.ps1 b/SnipeitPS/Public/Set-SnipeitCategory.ps1 new file mode 100644 index 0000000..a1603e9 --- /dev/null +++ b/SnipeitPS/Public/Set-SnipeitCategory.ps1 @@ -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 + } + } +} From 621ee767093104a77ffedc85080c58c497ba1bf6 Mon Sep 17 00:00:00 2001 From: Petri Asikainen Date: Sun, 13 Jun 2021 18:17:05 +0300 Subject: [PATCH 05/15] add set-snipeitcompany --- SnipeitPS/Public/Set-SnipeitCompany.ps1 | 70 +++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 SnipeitPS/Public/Set-SnipeitCompany.ps1 diff --git a/SnipeitPS/Public/Set-SnipeitCompany.ps1 b/SnipeitPS/Public/Set-SnipeitCompany.ps1 new file mode 100644 index 0000000..050e20c --- /dev/null +++ b/SnipeitPS/Public/Set-SnipeitCompany.ps1 @@ -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/$companyid" + Method = 'Patch' + Body = $Body + Token = $apiKey + } + + If ($PSCmdlet.ShouldProcess("ShouldProcess?")) + { + $result = Invoke-SnipeitMethod @Parameters + } + + $result + } + } +} From b35230e3b8a63dfd151dc5337bbe252654b00d62 Mon Sep 17 00:00:00 2001 From: Petri Asikainen Date: Sun, 13 Jun 2021 18:29:14 +0300 Subject: [PATCH 06/15] get-set snipeitcustomfield --- SnipeitPS/Public/New-SnipeitCustomField.ps1 | 80 +++++++++++---- SnipeitPS/Public/Set-SnipeitCustomField.ps1 | 108 ++++++++++++++++++++ 2 files changed, 166 insertions(+), 22 deletions(-) create mode 100644 SnipeitPS/Public/Set-SnipeitCustomField.ps1 diff --git a/SnipeitPS/Public/New-SnipeitCustomField.ps1 b/SnipeitPS/Public/New-SnipeitCustomField.ps1 index d39807d..454394c 100644 --- a/SnipeitPS/Public/New-SnipeitCustomField.ps1 +++ b/SnipeitPS/Public/New-SnipeitCustomField.ps1 @@ -5,8 +5,29 @@ .DESCRIPTION Add a new Custom Field to Snipe-it asset system - .PARAMETER Name - Name of the Custom Field + .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 @@ -27,17 +48,25 @@ function New-SnipeitCustomField() Param( [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)] [string]$url, @@ -46,24 +75,31 @@ function New-SnipeitCustomField() [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 = @{ - Uri = "$url/api/v1/fields" - Method = 'post' - Body = $Body - Token = $apiKey + $Parameters = @{ + Uri = "$url/api/v1/fields" + Method = 'post' + Body = $Body + Token = $apiKey + } } - If ($PSCmdlet.ShouldProcess("ShouldProcess?")) - { - $result = Invoke-SnipeitMethod @Parameters - } + process{ + If ($PSCmdlet.ShouldProcess("ShouldProcess?")) + { + $result = Invoke-SnipeitMethod @Parameters + } - $result + $result + } } + diff --git a/SnipeitPS/Public/Set-SnipeitCustomField.ps1 b/SnipeitPS/Public/Set-SnipeitCustomField.ps1 new file mode 100644 index 0000000..de84f8d --- /dev/null +++ b/SnipeitPS/Public/Set-SnipeitCustomField.ps1 @@ -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 + } + } +} + From 1b5e5e5237afdb4a9bc20955e2df385a19a5d7a5 Mon Sep 17 00:00:00 2001 From: Petri Asikainen Date: Sun, 13 Jun 2021 18:30:14 +0300 Subject: [PATCH 07/15] Remove-SnipeitAssetmaintenence --- SnipeitPS/Public/Remove-SnipeitAssetMaintenance.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SnipeitPS/Public/Remove-SnipeitAssetMaintenance.ps1 b/SnipeitPS/Public/Remove-SnipeitAssetMaintenance.ps1 index ed450f7..10cc017 100644 --- a/SnipeitPS/Public/Remove-SnipeitAssetMaintenance.ps1 +++ b/SnipeitPS/Public/Remove-SnipeitAssetMaintenance.ps1 @@ -2,10 +2,13 @@ function Remove-SnipeitAssetMaintenance { <# .SYNOPSIS Remove asset maintenance from Snipe-it asset system + .DESCRIPTION Removes asset maintenance event or events from Snipe-it asset system by ID + .PARAMETER ID Unique ID of the asset maintenance to be removed + .PARAMETER url URL of Snipeit system, can be set using Set-SnipeitInfoeItInfo command From dfb271dbec0b7aeab1fc8f53fb147ce7b5e11e4e Mon Sep 17 00:00:00 2001 From: Petri Asikainen Date: Sun, 13 Jun 2021 18:32:42 +0300 Subject: [PATCH 08/15] set-snipeitcompany --- SnipeitPS/Public/Set-SnipeitCompany.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SnipeitPS/Public/Set-SnipeitCompany.ps1 b/SnipeitPS/Public/Set-SnipeitCompany.ps1 index 050e20c..4dcbb16 100644 --- a/SnipeitPS/Public/Set-SnipeitCompany.ps1 +++ b/SnipeitPS/Public/Set-SnipeitCompany.ps1 @@ -53,7 +53,7 @@ function Set-SnipeitCompany() process{ foreach($company_id in $id){ $Parameters = @{ - Uri = "$url/api/v1/companies/$companyid" + Uri = "$url/api/v1/companies/$company_id" Method = 'Patch' Body = $Body Token = $apiKey From 83eb3638895593a6feaef4fb8f8bbe67fe73b602 Mon Sep 17 00:00:00 2001 From: Petri Asikainen Date: Sun, 13 Jun 2021 18:35:43 +0300 Subject: [PATCH 09/15] set-snipeitcomponent --- SnipeitPS/Public/Set-SnipeitComponent.ps1 | 43 +++++++++++++---------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/SnipeitPS/Public/Set-SnipeitComponent.ps1 b/SnipeitPS/Public/Set-SnipeitComponent.ps1 index e43466e..97115d9 100644 --- a/SnipeitPS/Public/Set-SnipeitComponent.ps1 +++ b/SnipeitPS/Public/Set-SnipeitComponent.ps1 @@ -49,8 +49,8 @@ function Set-SnipeitComponent() )] Param( - [parameter(mandatory = $true)] - [int]$id, + [parameter(mandatory = $true,ValueFromPipelineByPropertyName)] + [int[]]$id, [parameter(mandatory = $true)] [int]$qty, @@ -74,28 +74,33 @@ function Set-SnipeitComponent() [parameter(mandatory = $true)] [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']) { - $values['purchase_date'] = $values['purchase_date'].ToString("yyyy-MM-dd") + $Body = $values | ConvertTo-Json; } - $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 = @{ - Uri = "$url/api/v1/components/$id" - Method = 'Patch' - Body = $Body - Token = $apiKey + If ($PSCmdlet.ShouldProcess("ShouldProcess?")) + { + $result = Invoke-SnipeitMethod @Parameters + } + + $result + } } - - If ($PSCmdlet.ShouldProcess("ShouldProcess?")) - { - $result = Invoke-SnipeitMethod @Parameters - } - - $result } From cd86c6749d44188e44943e304a39799ae69dbfbe Mon Sep 17 00:00:00 2001 From: Petri Asikainen Date: Sun, 13 Jun 2021 18:41:27 +0300 Subject: [PATCH 10/15] set and remove snipeitdepartment --- SnipeitPS/Public/Remove-SnipeitDepartment.ps1 | 2 +- SnipeitPS/Public/Set-SnipeitDepartment.ps1 | 85 +++++++++++++++++++ 2 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 SnipeitPS/Public/Set-SnipeitDepartment.ps1 diff --git a/SnipeitPS/Public/Remove-SnipeitDepartment.ps1 b/SnipeitPS/Public/Remove-SnipeitDepartment.ps1 index 7d0ed95..8bf9daa 100644 --- a/SnipeitPS/Public/Remove-SnipeitDepartment.ps1 +++ b/SnipeitPS/Public/Remove-SnipeitDepartment.ps1 @@ -37,7 +37,7 @@ function Remove-SnipeitDepartment () begin { } process { - foreach($depatment_id in $id){ + foreach($department_id in $id){ $Parameters = @{ Uri = "$url/api/v1/departments/$department_id" Method = 'Delete' diff --git a/SnipeitPS/Public/Set-SnipeitDepartment.ps1 b/SnipeitPS/Public/Set-SnipeitDepartment.ps1 new file mode 100644 index 0000000..8a66063 --- /dev/null +++ b/SnipeitPS/Public/Set-SnipeitDepartment.ps1 @@ -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 + } + } +} + From 528367cbd65112d3a82ee0a75a7cb2be5814215e Mon Sep 17 00:00:00 2001 From: Petri Asikainen Date: Sun, 13 Jun 2021 18:43:58 +0300 Subject: [PATCH 11/15] set-snipeitlicence --- SnipeitPS/Public/Set-SnipeitLicense.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SnipeitPS/Public/Set-SnipeitLicense.ps1 b/SnipeitPS/Public/Set-SnipeitLicense.ps1 index 3664841..9f1d1c7 100644 --- a/SnipeitPS/Public/Set-SnipeitLicense.ps1 +++ b/SnipeitPS/Public/Set-SnipeitLicense.ps1 @@ -129,6 +129,7 @@ function Set-SnipeitLicense() { [parameter(mandatory = $true)] [string]$apiKey ) + begin{ Test-SnipeitAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name @@ -148,6 +149,7 @@ function Set-SnipeitLicense() { $Body = $Values | ConvertTo-Json; } + process { foreach($license_id in $id){ $Parameters = @{ From e8d52ab59cbc1ba517eeb58c5f4c6240ec9828aa Mon Sep 17 00:00:00 2001 From: Petri Asikainen Date: Sun, 13 Jun 2021 18:44:43 +0300 Subject: [PATCH 12/15] some formating --- SnipeitPS/Public/Set-SnipeitUser.ps1 | 5 ----- 1 file changed, 5 deletions(-) diff --git a/SnipeitPS/Public/Set-SnipeitUser.ps1 b/SnipeitPS/Public/Set-SnipeitUser.ps1 index e4cebd7..124acf7 100644 --- a/SnipeitPS/Public/Set-SnipeitUser.ps1 +++ b/SnipeitPS/Public/Set-SnipeitUser.ps1 @@ -80,13 +80,10 @@ function Set-SnipeitUser() { [string]$userName, - [string]$jobtitle, - [string]$email, - [string]$phone, [int]$company_id, @@ -97,12 +94,10 @@ function Set-SnipeitUser() { [int]$manager_id, - [string]$employee_num, [bool]$activated, - [string]$notes, [parameter(mandatory = $true)] From 3a0b1d853aeef68ad60c1c41912e368bd9c7e388 Mon Sep 17 00:00:00 2001 From: Petri Asikainen Date: Sun, 13 Jun 2021 18:54:12 +0300 Subject: [PATCH 13/15] set-snipeitstatus --- SnipeitPS/Public/Set-SnipeitStatus.ps1 | 83 ++++++++++++++++++++++++++ SnipeitPS/SnipeitPS.psd1 | 53 +++++++++------- 2 files changed, 113 insertions(+), 23 deletions(-) create mode 100644 SnipeitPS/Public/Set-SnipeitStatus.ps1 diff --git a/SnipeitPS/Public/Set-SnipeitStatus.ps1 b/SnipeitPS/Public/Set-SnipeitStatus.ps1 new file mode 100644 index 0000000..54ee8d8 --- /dev/null +++ b/SnipeitPS/Public/Set-SnipeitStatus.ps1 @@ -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 + } + } +} diff --git a/SnipeitPS/SnipeitPS.psd1 b/SnipeitPS/SnipeitPS.psd1 index d9daa74..d24b9a9 100644 --- a/SnipeitPS/SnipeitPS.psd1 +++ b/SnipeitPS/SnipeitPS.psd1 @@ -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. FunctionsToExport = @( + 'Get-SnipeitAccessory', + 'Get-SnipeitAccessoryOwner', + 'Get-SnipeitActivity', 'Get-SnipeitAsset', 'Get-SnipeitAssetMaintenance', 'Get-SnipeitCategory', @@ -78,45 +81,30 @@ FunctionsToExport = @( 'Get-SnipeitCustomField', 'Get-SnipeitDepartment', 'Get-SnipeitFieldset', + 'Get-SnipeitLicense', + 'Get-SnipeitLicenseSeat', 'Get-SnipeitLocation', 'Get-SnipeitManufacturer', 'Get-SnipeitModel', 'Get-SnipeitStatus', 'Get-SnipeitSupplier', 'Get-SnipeitUser', + 'New-SnipeitAccessory', 'New-SnipeitAsset', 'New-SnipeitAssetMaintenance', + 'New-SnipeItAudit', 'New-SnipeitCategory', 'New-SnipeitComponent', 'New-SnipeitCustomField', 'New-SnipeitDepartment', 'New-SnipeitLicense', - 'Set-SnipeitLicense', - 'Get-SnipeitLicense', - 'Get-SnipeitLicenseSeat', - 'Set-SnipeitLicenseSeat', 'New-SnipeitLocation', 'New-SnipeitManufacturer', 'New-SnipeitModel', 'New-SnipeitUser', - 'Set-SnipeitAsset', - 'Set-SnipeitAssetOwner', - 'Set-SnipeitComponent', - 'Set-SnipeitModel', - 'Set-SnipeitInfo', - 'Set-SnipeitUser', - 'Set-SnipeitLocation', - 'Add-SnipeitAccessory', - 'Set-SnipeitAccessory', - 'Get-SnipeitAccessory', - 'Remove-SnipeitAsset', - 'Remove-SnipeitUser', - 'Update-SnipeitAlias', - 'Set-SnipeitAccessoryOwner', - 'Get-SnipeitAccessoryOwner', - 'Reset-SnipeitAccessoryOwner', - 'Get-SnipeitActivity', 'Remove-SnipeitAccessory', + 'Remove-SnipeitAsset', + 'Remove-SnipeitAssetMaintenance', 'Remove-SnipeitCategory', 'Remove-SnipeitCompany', 'Remove-SnipeitComponent', @@ -125,8 +113,27 @@ FunctionsToExport = @( 'Remove-SnipeitLicense', 'Remove-SnipeitLocation', 'Remove-SnipeitManufacturer', - 'Remove-SnipeitModel' - + 'Remove-SnipeitModel', + 'Remove-SnipeitUser', + 'Reset-SnipeitAccessoryOwner', + 'Reset-SnipeitAssetOwner', + 'Set-SnipeitAccessory', + 'Set-SnipeitAccessoryOwner', + 'Set-SnipeitAsset', + 'Set-SnipeitAssetOwner', + 'Set-SnipeitCategory' + 'Set-SnipeitCompany' + 'Set-SnipeitComponent', + 'Set-SnipeitCustomField', + 'Set-SnipeitDepartment', + 'Set-SnipeitInfo', + 'Set-SnipeitLicense', + 'Set-SnipeitLicenseSeat', + 'Set-SnipeitLocation', + 'Set-SnipeitModel', + 'Set-SnipeitStatus', + 'Set-SnipeitUser', + 'Update-SnipeitAlias' ) # 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. From 6254b82e3a84709d771ff0abcfe7a204ac6888c8 Mon Sep 17 00:00:00 2001 From: Petri Asikainen Date: Mon, 14 Jun 2021 00:19:47 +0300 Subject: [PATCH 14/15] updated docs for v1.6.x --- CHANGELOG.md | 26 +++ SnipeitPS/SnipeitPS.psd1 | 2 +- appveyor.yml | 2 +- docs/New-SnipeitAccessory.md | 269 +++++++++++++++++++++++++ docs/New-SnipeitAudit.md | 132 ++++++++++++ docs/New-SnipeitCategory.md | 24 ++- docs/New-SnipeitCustomField.md | 97 ++++++--- docs/Remove-SnipeitAssetMaintenance.md | 117 +++++++++++ docs/Remove-SnipeitCategory.md | 122 +++++++++++ docs/Remove-SnipeitCompany.md | 2 +- docs/Remove-SnipeitComponent.md | 4 +- docs/Remove-SnipeitDepartment.md | 2 +- docs/Remove-SnipeitManufacturer.md | 2 +- docs/Reset-SnipeitAssetOwner.md | 162 +++++++++++++++ docs/Set-SnipeitCategory.md | 208 +++++++++++++++++++ docs/Set-SnipeitCompany.md | 133 ++++++++++++ docs/Set-SnipeitCustomField.md | 239 ++++++++++++++++++++++ docs/Set-SnipeitDepartment.md | 193 ++++++++++++++++++ docs/Set-SnipeitStatus.md | 213 ++++++++++++++++++++ docs/SnipeitPS.md | 30 +++ 20 files changed, 1935 insertions(+), 44 deletions(-) create mode 100644 docs/New-SnipeitAccessory.md create mode 100644 docs/New-SnipeitAudit.md create mode 100644 docs/Remove-SnipeitAssetMaintenance.md create mode 100644 docs/Remove-SnipeitCategory.md create mode 100644 docs/Reset-SnipeitAssetOwner.md create mode 100644 docs/Set-SnipeitCategory.md create mode 100644 docs/Set-SnipeitCompany.md create mode 100644 docs/Set-SnipeitCustomField.md create mode 100644 docs/Set-SnipeitDepartment.md create mode 100644 docs/Set-SnipeitStatus.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f8459a..7333372 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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/), 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 ## Piping input diff --git a/SnipeitPS/SnipeitPS.psd1 b/SnipeitPS/SnipeitPS.psd1 index d24b9a9..a4828f5 100644 --- a/SnipeitPS/SnipeitPS.psd1 +++ b/SnipeitPS/SnipeitPS.psd1 @@ -12,7 +12,7 @@ RootModule = 'SnipeitPS' # Version number of this module. -ModuleVersion = '1.5' +ModuleVersion = '1.6' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/appveyor.yml b/appveyor.yml index fe7d763..c5a6038 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,7 +14,7 @@ environment: PSGalleryAPIKey: secure: UdM6qhf5B0G8liHhUrwWERCZr44iSqmg4jUq0lwlTjZs4KyeoiwnBzdej0phqIAm -version: 1.5.{build} +version: 1.6.{build} # Don't rebuild when I tag a release on GitHub skip_tags: true diff --git a/docs/New-SnipeitAccessory.md b/docs/New-SnipeitAccessory.md new file mode 100644 index 0000000..a9e27c1 --- /dev/null +++ b/docs/New-SnipeitAccessory.md @@ -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] [-qty] [-category_id] [[-company_id] ] + [[-manufacturer_id] ] [[-order_number] ] [[-purchase_cost] ] + [[-purchase_date] ] [[-min_qty] ] [[-supplier_id] ] [[-location_id] ] + [-url] [-apiKey] [-WhatIf] [-Confirm] [] +``` + +## 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 diff --git a/docs/New-SnipeitAudit.md b/docs/New-SnipeitAudit.md new file mode 100644 index 0000000..5925779 --- /dev/null +++ b/docs/New-SnipeitAudit.md @@ -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] [[-location_id] ] [-url] [-apiKey] [-WhatIf] + [-Confirm] [] +``` + +## 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 diff --git a/docs/New-SnipeitCategory.md b/docs/New-SnipeitCategory.md index e5091da..beaa7dc 100644 --- a/docs/New-SnipeitCategory.md +++ b/docs/New-SnipeitCategory.md @@ -13,8 +13,9 @@ Create a new Snipe-IT Category ## SYNTAX ``` -New-SnipeitCategory [-name] [-category_type] [-url] [-apiKey] - [-use_default_eula] [-require_acceptance] [-checkin_email] [-WhatIf] [-Confirm] [] +New-SnipeitCategory [-name] [-category_type] [[-eula_text] ] [-use_default_eula] + [-require_acceptance] [-checkin_email] [-url] [-apiKey] [-WhatIf] [-Confirm] + [] ``` ## DESCRIPTION @@ -38,7 +39,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 4 +Position: 5 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -74,6 +75,21 @@ 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: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -name Name of new category to be created @@ -113,7 +129,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 3 +Position: 4 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/New-SnipeitCustomField.md b/docs/New-SnipeitCustomField.md index 3c3dab4..e30a6ab 100644 --- a/docs/New-SnipeitCustomField.md +++ b/docs/New-SnipeitCustomField.md @@ -13,9 +13,9 @@ Add a new Custom Field to Snipe-it asset system ## SYNTAX ``` -New-SnipeitCustomField [-Name] [[-HelpText] ] [[-Element] ] [[-Format] ] - [[-field_encrypted] ] [[-CustomFormat] ] [-url] [-apiKey] [-WhatIf] - [-Confirm] [] +New-SnipeitCustomField [-name] [[-help_text] ] [-element] [-format] + [[-field_values] ] [[-field_encrypted] ] [[-show_in_email] ] + [[-custom_format] ] [-url] [-apiKey] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -39,44 +39,45 @@ Parameter Sets: (All) Aliases: 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 Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -CustomFormat -{{ Fill CustomFormat Description }} +### -element +Form field type that should be displayed. ```yaml Type: String Parameter Sets: (All) Aliases: -Required: False -Position: 6 +Required: True +Position: 3 Default value: None Accept pipeline input: 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 -{{ Fill field_encrypted Description }} +Whether the field should be encrypted. +(This can cause issues if you change it after the field was created.) ```yaml Type: Boolean @@ -84,14 +85,14 @@ Parameter Sets: (All) Aliases: Required: False -Position: 5 +Position: 6 Default value: False Accept pipeline input: False Accept wildcard characters: False ``` -### -Format -{{ Fill Format Description }} +### -field_values +In the case of list boxes, etc, this should be a list of the options available ```yaml Type: String @@ -99,14 +100,29 @@ Parameter Sets: (All) Aliases: Required: False -Position: 4 -Default value: ANY +Position: 5 +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -HelpText -{{ Fill HelpText Description }} +### -format +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 Type: String @@ -120,8 +136,8 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Name -Name of the Custom Field +### -name +The field's name, which is also the form label ```yaml Type: String @@ -135,6 +151,21 @@ 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: 7 +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -url URL of Snipeit system, can be set using Set-SnipeitInfo command @@ -144,7 +175,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 7 +Position: 9 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/Remove-SnipeitAssetMaintenance.md b/docs/Remove-SnipeitAssetMaintenance.md new file mode 100644 index 0000000..75f5e2f --- /dev/null +++ b/docs/Remove-SnipeitAssetMaintenance.md @@ -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] [-url] [-apiKey] [-WhatIf] [-Confirm] + [] +``` + +## 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 diff --git a/docs/Remove-SnipeitCategory.md b/docs/Remove-SnipeitCategory.md new file mode 100644 index 0000000..34734d6 --- /dev/null +++ b/docs/Remove-SnipeitCategory.md @@ -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] [-URL] [-APIKey] [-WhatIf] [-Confirm] + [] +``` + +## 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 diff --git a/docs/Remove-SnipeitCompany.md b/docs/Remove-SnipeitCompany.md index e771629..b1609af 100644 --- a/docs/Remove-SnipeitCompany.md +++ b/docs/Remove-SnipeitCompany.md @@ -29,7 +29,7 @@ Remove-SnipeitCompany -ID 44 -Verbose ### EXAMPLE 2 ``` -Get-SnipeitCompany -search "some corp" | Remove-SnipeitCompany +Get-SnipeitCompany | | Where-object {$_.name -like '*some*'} | Remove-SnipeitCompany ``` ## PARAMETERS diff --git a/docs/Remove-SnipeitComponent.md b/docs/Remove-SnipeitComponent.md index d664225..0e68c5a 100644 --- a/docs/Remove-SnipeitComponent.md +++ b/docs/Remove-SnipeitComponent.md @@ -18,7 +18,7 @@ Remove-SnipeitComponent [-id] [-URL] [-APIKey] [-Wha ``` ## DESCRIPTION -Removes comoponent or multiple components from Snipe-it asset system +Removes component or multiple components from Snipe-it asset system ## EXAMPLES @@ -50,7 +50,7 @@ Accept wildcard characters: False ``` ### -id -Unique ID For component to be removed +{{ Fill id Description }} ```yaml Type: Int32[] diff --git a/docs/Remove-SnipeitDepartment.md b/docs/Remove-SnipeitDepartment.md index 5f61818..a2f99e3 100644 --- a/docs/Remove-SnipeitDepartment.md +++ b/docs/Remove-SnipeitDepartment.md @@ -29,7 +29,7 @@ Remove-SnipeitDepartment -ID 44 -Verbose ### EXAMPLE 2 ``` -Get-SnipeitDepartment -search head | Remove-SnipeitDepartment +Get-SnipeitDepartment | Where-object {$_.name -like '*head*'} | Remove-SnipeitDepartment ``` ## PARAMETERS diff --git a/docs/Remove-SnipeitManufacturer.md b/docs/Remove-SnipeitManufacturer.md index 2995b69..ab0a019 100644 --- a/docs/Remove-SnipeitManufacturer.md +++ b/docs/Remove-SnipeitManufacturer.md @@ -29,7 +29,7 @@ Remove-SnipeitManufacturer -ID 44 -Verbose ### EXAMPLE 2 ``` -Get-SnipeitManufacturer -search needle | Remove-SnipeitManufacturer +Get-SnipeitManufacturer | Where-object {$_.name -like '*something*'} | Remove-SnipeitManufacturer ``` ## PARAMETERS diff --git a/docs/Reset-SnipeitAssetOwner.md b/docs/Reset-SnipeitAssetOwner.md new file mode 100644 index 0000000..f901aeb --- /dev/null +++ b/docs/Reset-SnipeitAssetOwner.md @@ -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] [[-status_id] ] [[-location_id] ] [[-notes] ] + [-url] [-apiKey] [-WhatIf] [-Confirm] [] +``` + +## 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 diff --git a/docs/Set-SnipeitCategory.md b/docs/Set-SnipeitCategory.md new file mode 100644 index 0000000..a380ae5 --- /dev/null +++ b/docs/Set-SnipeitCategory.md @@ -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] [[-name] ] [[-category_type] ] [[-eula_text] ] + [[-use_default_eula] ] [[-require_acceptance] ] [[-checkin_email] ] [-url] + [-apiKey] [-WhatIf] [-Confirm] [] +``` + +## 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 diff --git a/docs/Set-SnipeitCompany.md b/docs/Set-SnipeitCompany.md new file mode 100644 index 0000000..53ee457 --- /dev/null +++ b/docs/Set-SnipeitCompany.md @@ -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] [-name] [-url] [-apiKey] [-WhatIf] [-Confirm] + [] +``` + +## 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 diff --git a/docs/Set-SnipeitCustomField.md b/docs/Set-SnipeitCustomField.md new file mode 100644 index 0000000..78fe1f3 --- /dev/null +++ b/docs/Set-SnipeitCustomField.md @@ -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] [[-name] ] [[-help_text] ] [-element] + [[-format] ] [[-field_values] ] [[-field_encrypted] ] [[-show_in_email] ] + [[-custom_format] ] [-url] [-apiKey] [-WhatIf] [-Confirm] [] +``` + +## 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 diff --git a/docs/Set-SnipeitDepartment.md b/docs/Set-SnipeitDepartment.md new file mode 100644 index 0000000..0c0e0ae --- /dev/null +++ b/docs/Set-SnipeitDepartment.md @@ -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] [[-name] ] [[-company_id] ] [[-location_id] ] + [[-manager_id] ] [[-notes] ] [-url] [-apiKey] [-WhatIf] [-Confirm] + [] +``` + +## 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 diff --git a/docs/Set-SnipeitStatus.md b/docs/Set-SnipeitStatus.md new file mode 100644 index 0000000..2e23b50 --- /dev/null +++ b/docs/Set-SnipeitStatus.md @@ -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] [[-name] ] [-type] [[-notes] ] [[-color] ] + [[-show_in_nav] ] [[-default_label] ] [-url] [-apiKey] [-WhatIf] + [-Confirm] [] +``` + +## 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 diff --git a/docs/SnipeitPS.md b/docs/SnipeitPS.md index 881a1d9..c9d02b2 100644 --- a/docs/SnipeitPS.md +++ b/docs/SnipeitPS.md @@ -59,12 +59,18 @@ Gets a list of Snipe-it Models ### [Get-SnipeitStatus](Get-SnipeitStatus.md) 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) Add a new Asset to Snipe-it asset system ### [New-SnipeitAssetMaintenance](New-SnipeitAssetMaintenance.md) 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) Create a new Snipe-IT Category @@ -98,6 +104,12 @@ Removes Accessory from Snipe-it asset system ### [Remove-SnipeitAsset](Remove-SnipeitAsset.md) 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 @@ -128,6 +140,9 @@ Removes User from Snipe-it asset system ### [Reset-SnipeitAccessoryOwner](Reset-SnipeitAccessoryOwner.md) Checkin accessories +### [Reset-SnipeitAssetOwner](Reset-SnipeitAssetOwner.md) +Checkin asset + ### [Set-SnipeitAccessory](Set-SnipeitAccessory.md) Updates accessory on Snipe-It system @@ -140,9 +155,21 @@ Update a specific Asset in the Snipe-it asset system ### [Set-SnipeitAssetOwner](Set-SnipeitAssetOwner.md) 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) 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) Sets authetication information @@ -158,6 +185,9 @@ Updates Location in Snipe-it asset system ### [Set-SnipeitModel](Set-SnipeitModel.md) Updates Model on Snipe-it asset system +### [Set-SnipeitStatus](Set-SnipeitStatus.md) +Sets Snipe-it Status Labels + ### [Set-SnipeitUser](Set-SnipeitUser.md) Creates a new user From bb00f1bc5ed80316d4cb2217b4dfa13c494c872c Mon Sep 17 00:00:00 2001 From: Petri Asikainen Date: Mon, 14 Jun 2021 00:21:12 +0300 Subject: [PATCH 15/15] updated docs for v1.6.x --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d3adc1d..294f257 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ Set-SnipeitInfo -URL 'https://asset.example.com' -apiKey 'tokenKey' ```powershell # Review the help at any time! +Get-Help about_SnipeitPS Get-Command -Module SnipeitPS Get-Help Get-SnipeitAsset -Full # or any other command ```