mirror of
https://github.com/snazy2000/SnipeitPS.git
synced 2025-12-13 18:02:30 +00:00
Merge pull request #44 from MrCarter2959/master
Create Remove-Asset.ps1
This commit is contained in:
commit
e6360a0def
3 changed files with 50 additions and 0 deletions
48
SnipeitPS/Public/Remove-Asset.ps1
Normal file
48
SnipeitPS/Public/Remove-Asset.ps1
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Removes Asset to Snipe-it asset system
|
||||||
|
.DESCRIPTION
|
||||||
|
Long description
|
||||||
|
.PARAMETER ID
|
||||||
|
Unique ID For Asset to be removed
|
||||||
|
.EXAMPLE
|
||||||
|
Remove-Asset -ID 44 -url $url -apiKey $secret -Verbose
|
||||||
|
#>
|
||||||
|
|
||||||
|
function Remove-Asset ()
|
||||||
|
{
|
||||||
|
[CmdletBinding(
|
||||||
|
SupportsShouldProcess = $true,
|
||||||
|
ConfirmImpact = "Low"
|
||||||
|
)]
|
||||||
|
|
||||||
|
Param(
|
||||||
|
[parameter(mandatory = $true)]
|
||||||
|
[string]$ID,
|
||||||
|
[parameter(mandatory = $true)]
|
||||||
|
[string]$URL,
|
||||||
|
[parameter(mandatory = $true)]
|
||||||
|
[string]$APIKey
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
$Values = @{
|
||||||
|
"ID" = $Name
|
||||||
|
}
|
||||||
|
|
||||||
|
$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
|
||||||
|
}
|
||||||
1
_config.yml
Normal file
1
_config.yml
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
theme: jekyll-theme-cayman
|
||||||
1
docs/_config.yml
Normal file
1
docs/_config.yml
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
theme: jekyll-theme-architect
|
||||||
Loading…
Add table
Reference in a new issue