-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #160 from snazy2000/develop
Publish v.1.6
- Loading branch information
Showing
54 changed files
with
4,316 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.