From d8652d0cbadae7dfb58ca428cc507363ffe10a98 Mon Sep 17 00:00:00 2001 From: Petri Asikainen Date: Sat, 12 Jun 2021 12:30:41 +0300 Subject: [PATCH] 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