Merge pull request #44 from MrCarter2959/master

Create Remove-Asset.ps1
This commit is contained in:
Stephen 2020-06-17 08:39:55 +01:00 committed by GitHub
commit e6360a0def
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 50 additions and 0 deletions

View 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
View file

@ -0,0 +1 @@
theme: jekyll-theme-cayman

1
docs/_config.yml Normal file
View file

@ -0,0 +1 @@
theme: jekyll-theme-architect