mirror of
https://github.com/snazy2000/SnipeitPS.git
synced 2025-12-13 01:42:29 +00:00
Update docks and reworked some scripts
This commit is contained in:
parent
c860da790f
commit
4515fe0834
34 changed files with 782 additions and 706 deletions
|
|
@ -9,10 +9,10 @@ URL of Snipeit system, can be set using Set-Info command
|
|||
Users API Key for Snipeit, can be set using Set-Info command
|
||||
|
||||
.EXAMPLE
|
||||
Get-Asset -url "https://assets.dip.co.uk" -token "token..."
|
||||
Get-Asset -url "https://assets.example.com" -token "token..."
|
||||
|
||||
.EXAMPLE
|
||||
Get-Asset -url "https://assets.dip.co.uk" -token "token..." | Where-Object {$_.name -eq "SUPPORT23" }
|
||||
Get-Asset -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "MyMachine" }
|
||||
|
||||
#>
|
||||
|
||||
|
|
@ -26,9 +26,13 @@ function Get-Asset()
|
|||
[string]$apiKey
|
||||
)
|
||||
|
||||
$result = Invoke-Method -URi "$url/api/v1/hardware" `
|
||||
-Method GET `
|
||||
-Token $apiKey
|
||||
$Parameters = @{
|
||||
Uri = "$url/api/v1/hardware"
|
||||
Method = 'Get'
|
||||
Token = $apiKey
|
||||
}
|
||||
|
||||
$result = Invoke-Method @Parameters
|
||||
|
||||
$result
|
||||
}
|
||||
38
SnipeitPS/Public/Get-Category.ps1
Normal file
38
SnipeitPS/Public/Get-Category.ps1
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<#
|
||||
.SYNOPSIS
|
||||
# Gets a list of Snipe-it Categories
|
||||
|
||||
.PARAMETER url
|
||||
URL of Snipeit system, can be set using Set-Info command
|
||||
|
||||
.PARAMETER apiKey
|
||||
Users API Key for Snipeit, can be set using Set-Info command
|
||||
|
||||
.EXAMPLE
|
||||
Get-Category -url "https://assets.example.com" -token "token..."
|
||||
|
||||
.EXAMPLE
|
||||
Get-Category -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "Laptop" }
|
||||
|
||||
#>
|
||||
|
||||
function Get-Category()
|
||||
{
|
||||
Param(
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$url,
|
||||
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$apiKey
|
||||
)
|
||||
|
||||
$Parameters = @{
|
||||
Uri = "$url/api/v1/categories"
|
||||
Method = 'Get'
|
||||
Token = $apiKey
|
||||
}
|
||||
|
||||
$result = Invoke-Method @Parameters
|
||||
|
||||
$result
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
function Get-Category()
|
||||
{
|
||||
Param(
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$url,
|
||||
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$apiKey
|
||||
)
|
||||
|
||||
$result = Invoke-Method -URi "$url/api/v1/categories" `
|
||||
-Method GET `
|
||||
-Token $apiKey
|
||||
|
||||
$result
|
||||
}
|
||||
38
SnipeitPS/Public/Get-Component.ps1
Normal file
38
SnipeitPS/Public/Get-Component.ps1
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<#
|
||||
.SYNOPSIS
|
||||
# Gets a list of Snipe-it Components
|
||||
|
||||
.PARAMETER url
|
||||
URL of Snipeit system, can be set using Set-Info command
|
||||
|
||||
.PARAMETER apiKey
|
||||
Users API Key for Snipeit, can be set using Set-Info command
|
||||
|
||||
.EXAMPLE
|
||||
Get-Component -url "https://assets.example.com" -token "token..."
|
||||
|
||||
.EXAMPLE
|
||||
Get-Component -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "Memory" }
|
||||
|
||||
#>
|
||||
|
||||
function Get-Component()
|
||||
{
|
||||
Param(
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$url,
|
||||
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$apiKey
|
||||
)
|
||||
|
||||
$Parameters = @{
|
||||
Uri = "$url/api/v1/components"
|
||||
Method = 'Get'
|
||||
Token = $apiKey
|
||||
}
|
||||
|
||||
$result = Invoke-Method @Parameters
|
||||
|
||||
$result
|
||||
}
|
||||
|
|
@ -1,124 +0,0 @@
|
|||
function Get-Component()
|
||||
{
|
||||
Param(
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$url,
|
||||
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$apiKey
|
||||
)
|
||||
|
||||
$result = Invoke-Method -URi "$url/api/v1/components" `
|
||||
-Method GET `
|
||||
-Token $apiKey
|
||||
|
||||
$result
|
||||
}
|
||||
|
||||
function New-Component()
|
||||
{
|
||||
[CmdletBinding(
|
||||
SupportsShouldProcess=$true,
|
||||
ConfirmImpact="High"
|
||||
)]
|
||||
|
||||
Param(
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$name,
|
||||
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$category_id,
|
||||
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$qty,
|
||||
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$url,
|
||||
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$apiKey
|
||||
)
|
||||
|
||||
$Values = @{
|
||||
"name" = $name
|
||||
"category_id" = $category_id
|
||||
"qty" = $qty
|
||||
}
|
||||
|
||||
$Body = $Values | ConvertTo-Json;
|
||||
|
||||
$Parameters = @{
|
||||
Uri = "$url/api/v1/components"
|
||||
Method = 'POST'
|
||||
Body = $Body
|
||||
Token = $apiKey
|
||||
}
|
||||
|
||||
If ($PSCmdlet.ShouldProcess()) {
|
||||
$result = Invoke-Method @Parameters
|
||||
}
|
||||
|
||||
$result
|
||||
}
|
||||
|
||||
function Set-Component()
|
||||
{
|
||||
[CmdletBinding(
|
||||
SupportsShouldProcess=$true,
|
||||
ConfirmImpact="High"
|
||||
)]
|
||||
|
||||
Param(
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$id,
|
||||
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$qty,
|
||||
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$url,
|
||||
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$apiKey
|
||||
)
|
||||
|
||||
$Values = @{
|
||||
"qty" = $qty
|
||||
}
|
||||
|
||||
$Body = $Values | ConvertTo-Json;
|
||||
|
||||
$Parameters = @{
|
||||
Uri = "$url/api/v1/components/$component_id"
|
||||
Method = 'Patch'
|
||||
Body = $Body
|
||||
Token = $apiKey
|
||||
}
|
||||
|
||||
If ($PSCmdlet.ShouldProcess()) {
|
||||
$result = Invoke-Method @Parameters
|
||||
}
|
||||
|
||||
$result
|
||||
}
|
||||
|
||||
<#
|
||||
Checkout does not exsit yet :(
|
||||
|
||||
function Checkout-Component($component_id, $asset_id = "")
|
||||
{
|
||||
$Values = @{
|
||||
"asset_id" = $asset_id
|
||||
}
|
||||
|
||||
$Body = $Values | ConvertTo-Json;
|
||||
|
||||
$Manufacturers = Invoke-RestMethod -Uri "http://assets.dip.co.uk/api/v1/hardware/$component_id/checkout" `
|
||||
-Method Post `
|
||||
-Header $headers `
|
||||
-Body $Body `
|
||||
-ContentType "application/json" `
|
||||
-UserAgent "DI Script/0.1"
|
||||
|
||||
return $Manufacturers
|
||||
}#>
|
||||
38
SnipeitPS/Public/Get-Manufacturer.ps1
Normal file
38
SnipeitPS/Public/Get-Manufacturer.ps1
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<#
|
||||
.SYNOPSIS
|
||||
# Gets a list of Snipe-it Manufacturers
|
||||
|
||||
.PARAMETER url
|
||||
URL of Snipeit system, can be set using Set-Info command
|
||||
|
||||
.PARAMETER apiKey
|
||||
Users API Key for Snipeit, can be set using Set-Info command
|
||||
|
||||
.EXAMPLE
|
||||
Get-Manufacturer -url "https://assets.example.com" -token "token..."
|
||||
|
||||
.EXAMPLE
|
||||
Get-Manufacturer -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "HP" }
|
||||
|
||||
#>
|
||||
|
||||
function Get-Manufacturer()
|
||||
{
|
||||
Param(
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$url,
|
||||
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$apiKey
|
||||
)
|
||||
|
||||
$Parameters = @{
|
||||
Uri = "$url/api/v1/manufacturers"
|
||||
Method = 'Get'
|
||||
Token = $apiKey
|
||||
}
|
||||
|
||||
$result = Invoke-Method @Parameters
|
||||
|
||||
$result
|
||||
}
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
function Get-Manufacturer()
|
||||
{
|
||||
Param(
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$url,
|
||||
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$apiKey
|
||||
)
|
||||
|
||||
$result = Invoke-Method -URi "$url/api/v1/manufacturers" `
|
||||
-Method GET `
|
||||
-Token $apiKey
|
||||
|
||||
$result
|
||||
}
|
||||
|
||||
function New-Manufacturer()
|
||||
{
|
||||
[CmdletBinding(
|
||||
SupportsShouldProcess=$true,
|
||||
ConfirmImpact="High"
|
||||
)]
|
||||
|
||||
Param(
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$Name,
|
||||
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$url,
|
||||
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$apiKey
|
||||
)
|
||||
|
||||
|
||||
$Values = @{
|
||||
"name" = $Name
|
||||
}
|
||||
|
||||
#Convert Values to JSON format
|
||||
$Body = $Values | ConvertTo-Json;
|
||||
|
||||
$Parameters = @{
|
||||
Uri = "$url/api/v1/manufacturers"
|
||||
Method = 'post'
|
||||
Body = $Body
|
||||
Token = $apiKey
|
||||
}
|
||||
|
||||
If ($PSCmdlet.ShouldProcess()) {
|
||||
$result = Invoke-Method @Parameters
|
||||
}
|
||||
|
||||
$result
|
||||
}
|
||||
38
SnipeitPS/Public/Get-Model.ps1
Normal file
38
SnipeitPS/Public/Get-Model.ps1
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<#
|
||||
.SYNOPSIS
|
||||
# Gets a list of Snipe-it Models
|
||||
|
||||
.PARAMETER url
|
||||
URL of Snipeit system, can be set using Set-Info command
|
||||
|
||||
.PARAMETER apiKey
|
||||
Users API Key for Snipeit, can be set using Set-Info command
|
||||
|
||||
.EXAMPLE
|
||||
Get-Models -url "https://assets.example.com" -token "token..."
|
||||
|
||||
.EXAMPLE
|
||||
Get-Models -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "DL380" }
|
||||
|
||||
#>
|
||||
|
||||
function Get-Model()
|
||||
{
|
||||
Param(
|
||||
[parameter(mandatory = $true)]
|
||||
[string]$url,
|
||||
|
||||
[parameter(mandatory = $true)]
|
||||
[string]$apiKey
|
||||
)
|
||||
|
||||
$Parameters = @{
|
||||
Uri = "$url/api/v1/models"
|
||||
Method = 'Get'
|
||||
Token = $apiKey
|
||||
}
|
||||
|
||||
$result = Invoke-Method @Parameters
|
||||
|
||||
$result
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
function Get-Model()
|
||||
{
|
||||
Param(
|
||||
[parameter(mandatory = $true)]
|
||||
[string]$url,
|
||||
|
||||
[parameter(mandatory = $true)]
|
||||
[string]$apiKey
|
||||
)
|
||||
|
||||
$result = Invoke-Method -URi "$url/api/v1/models" `
|
||||
-Method GET `
|
||||
-Token $apiKey
|
||||
|
||||
$result
|
||||
}
|
||||
38
SnipeitPS/Public/Get-Status.ps1
Normal file
38
SnipeitPS/Public/Get-Status.ps1
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<#
|
||||
.SYNOPSIS
|
||||
# Gets a list of Snipe-it Status Labels
|
||||
|
||||
.PARAMETER url
|
||||
URL of Snipeit system, can be set using Set-Info command
|
||||
|
||||
.PARAMETER apiKey
|
||||
Users API Key for Snipeit, can be set using Set-Info command
|
||||
|
||||
.EXAMPLE
|
||||
Get-Status -url "https://assets.example.com" -token "token..."
|
||||
|
||||
.EXAMPLE
|
||||
Get-Status -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "Ready to Deploy" }
|
||||
|
||||
#>
|
||||
|
||||
function Get-Status()
|
||||
{
|
||||
Param(
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$url,
|
||||
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$apiKey
|
||||
)
|
||||
|
||||
$Parameters = @{
|
||||
Uri = "$url/api/v1/statuslabels"
|
||||
Method = 'Get'
|
||||
Token = $apiKey
|
||||
}
|
||||
|
||||
$result = Invoke-Method @Parameters
|
||||
|
||||
$result
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
function Get-Status()
|
||||
{
|
||||
Param(
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$url,
|
||||
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$apiKey
|
||||
)
|
||||
|
||||
$result = Invoke-Method -URi "$url/api/v1/statuslabels" `
|
||||
-Method GET `
|
||||
-Token $apiKey
|
||||
|
||||
$result
|
||||
}
|
||||
40
SnipeitPS/Public/Get-User.ps1
Normal file
40
SnipeitPS/Public/Get-User.ps1
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<#
|
||||
.SYNOPSIS
|
||||
# Gets a list of Snipe-it Users
|
||||
|
||||
.PARAMETER url
|
||||
URL of Snipeit system, can be set using Set-Info command
|
||||
|
||||
.PARAMETER apiKey
|
||||
Users API Key for Snipeit, can be set using Set-Info command
|
||||
|
||||
.EXAMPLE
|
||||
Get-User -url "https://assets.example.com" -token "token..."
|
||||
|
||||
.EXAMPLE
|
||||
Get-User -url "https://assets.example.com" -token "token..." | Where-Object {$_.username -eq "stephenm" }
|
||||
|
||||
#>
|
||||
function Get-User()
|
||||
{
|
||||
Param(
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$url,
|
||||
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$apiKey
|
||||
)
|
||||
|
||||
$Parameters = @{
|
||||
Uri = "$url/api/v1/users"
|
||||
Method = 'Get'
|
||||
GetParameters = @{
|
||||
limit = 999
|
||||
}
|
||||
Token = $apiKey
|
||||
}
|
||||
|
||||
$result = Invoke-Method @Parameters
|
||||
|
||||
$result
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
<#
|
||||
.SYNOPSIS
|
||||
# Gets a list of Snipe-it Users
|
||||
|
||||
.PARAMETER url
|
||||
URL of Snipeit system, can be set using Set-Info command
|
||||
|
||||
.PARAMETER apiKey
|
||||
Users API Key for Snipeit, can be set using Set-Info command
|
||||
|
||||
.EXAMPLE
|
||||
Get-Users -url "https://assets.dip.co.uk" -token "token..."
|
||||
|
||||
.EXAMPLE
|
||||
Get-Users -url "https://assets.dip.co.uk" -token "token..." | Where-Object {$_.username -eq "stephenm" }
|
||||
|
||||
#>
|
||||
function Get-User()
|
||||
{
|
||||
Param(
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$url,
|
||||
|
||||
[parameter(mandatory=$true)]
|
||||
[string]$apiKey
|
||||
)
|
||||
|
||||
$result = Invoke-Method -URi "$url/api/v1/users?limit=999" `
|
||||
-Method GET `
|
||||
-Token $apiKey
|
||||
|
||||
$result
|
||||
}
|
||||
|
|
@ -1,3 +1,38 @@
|
|||
<#
|
||||
.SYNOPSIS
|
||||
Add a new Asset to Snipe-it asset system
|
||||
|
||||
.DESCRIPTION
|
||||
Long description
|
||||
|
||||
.PARAMETER Tag
|
||||
Asset Tag for the Asset
|
||||
|
||||
.PARAMETER Name
|
||||
Name of the Asset
|
||||
|
||||
.PARAMETER Status_id
|
||||
Status ID of the asset, this can be got using Get-Status
|
||||
|
||||
.PARAMETER Model_id
|
||||
Model ID of the asset, this can be got using Get-Model
|
||||
|
||||
.PARAMETER url
|
||||
URL of Snipeit system, can be set using Set-Info command
|
||||
|
||||
.PARAMETER apiKey
|
||||
Users API Key for Snipeit, can be set using Set-Info command
|
||||
|
||||
.PARAMETER customfields
|
||||
Hastable of custom fields and extra fields that need passing through to Snipeit
|
||||
|
||||
.EXAMPLE
|
||||
New-Asset -status_id 1 -model_id 1 -name "Machine1"
|
||||
|
||||
.EXAMPLE
|
||||
New-Asset -status_id 1 -model_id 1 -name "Machine1" -CustomValues = @{ "_snipeit_os_5 = "Windows 10 Pro" }
|
||||
#>
|
||||
|
||||
function New-Asset()
|
||||
{
|
||||
[CmdletBinding(
|
||||
|
|
@ -6,6 +41,8 @@ function New-Asset()
|
|||
)]
|
||||
|
||||
Param(
|
||||
[string]$tag,
|
||||
|
||||
[parameter(mandatory = $true)]
|
||||
[string]$Name,
|
||||
|
||||
|
|
@ -25,6 +62,7 @@ function New-Asset()
|
|||
)
|
||||
|
||||
$Values = @{
|
||||
"asset_tag" = $tag
|
||||
"name" = $Name
|
||||
"status_id" = $status_id
|
||||
"model_id" = $model_id
|
||||
|
|
@ -1,3 +1,23 @@
|
|||
<#
|
||||
.SYNOPSIS
|
||||
Add a new Manufacturer to Snipe-it asset system
|
||||
|
||||
.DESCRIPTION
|
||||
Long description
|
||||
|
||||
.PARAMETER Name
|
||||
Name of the Manufacturer
|
||||
|
||||
.PARAMETER url
|
||||
URL of Snipeit system, can be set using Set-Info command
|
||||
|
||||
.PARAMETER apiKey
|
||||
Users API Key for Snipeit, can be set using Set-Info command
|
||||
|
||||
.EXAMPLE
|
||||
New-Manufacturer -name "HP"
|
||||
#>
|
||||
|
||||
function New-Manufacturer()
|
||||
{
|
||||
[CmdletBinding(
|
||||
|
|
@ -1,3 +1,32 @@
|
|||
<#
|
||||
.SYNOPSIS
|
||||
Add a new Model to Snipe-it asset system
|
||||
|
||||
.DESCRIPTION
|
||||
Long description
|
||||
|
||||
.PARAMETER name
|
||||
Name of the Asset Model
|
||||
|
||||
.PARAMETER category_id
|
||||
Category ID that the asset belongs to this can be got using Get-Category
|
||||
|
||||
.PARAMETER manufacturer_id
|
||||
Manufacturer ID that the asset belongs to this can be got using Get-Manufacturer
|
||||
|
||||
.PARAMETER fieldset_id
|
||||
Fieldset ID that the asset uses (Custom fields)
|
||||
|
||||
.PARAMETER url
|
||||
URL of Snipeit system, can be set using Set-Info command
|
||||
|
||||
.PARAMETER apiKey
|
||||
Users API Key for Snipeit, can be set using Set-Info command
|
||||
|
||||
.EXAMPLE
|
||||
New-Model -name "DL380" -manufacturer_id 2 -fieldset_id 2 -category_id 1
|
||||
#>
|
||||
|
||||
function New-Model()
|
||||
{
|
||||
[CmdletBinding(
|
||||
|
|
@ -1,3 +1,38 @@
|
|||
<#
|
||||
.SYNOPSIS
|
||||
Update a Asset in the Snipe-it asset system
|
||||
|
||||
.DESCRIPTION
|
||||
Long description
|
||||
|
||||
.PARAMETER id
|
||||
ID of the Asset
|
||||
|
||||
.PARAMETER Name
|
||||
Name of the Asset
|
||||
|
||||
.PARAMETER Status_id
|
||||
Status ID of the asset, this can be got using Get-Status
|
||||
|
||||
.PARAMETER Model_id
|
||||
Model ID of the asset, this can be got using Get-Model
|
||||
|
||||
.PARAMETER url
|
||||
URL of Snipeit system, can be set using Set-Info command
|
||||
|
||||
.PARAMETER apiKey
|
||||
Users API Key for Snipeit, can be set using Set-Info command
|
||||
|
||||
.PARAMETER customfields
|
||||
Hastable of custom fields and extra fields that need passing through to Snipeit
|
||||
|
||||
.EXAMPLE
|
||||
Set-Asset -id 1 -status_id 1 -model_id 1 -name "Machine1"
|
||||
|
||||
.EXAMPLE
|
||||
Set-Asset -id 1 -status_id 1 -model_id 1 -name "Machine1" -CustomValues = @{ "_snipeit_os_5 = "Windows 10 Pro" }
|
||||
#>
|
||||
|
||||
function Set-Asset()
|
||||
{
|
||||
[CmdletBinding(
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
$scriptRoot = $PSScriptRoot + '\public'
|
||||
|
||||
Get-ChildItem $scriptRoot *.psd1 | ForEach-Object {
|
||||
Get-ChildItem $scriptRoot *.ps1 | ForEach-Object {
|
||||
Import-Module $_.FullName
|
||||
}
|
||||
|
||||
$scriptRoot = $PSScriptRoot + '\private'
|
||||
|
||||
Get-ChildItem $scriptRoot *.psd1 | ForEach-Object {
|
||||
Get-ChildItem $scriptRoot *.ps1 | ForEach-Object {
|
||||
Import-Module $_.FullName
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,12 +23,12 @@ Get-Asset [-url] <String> [-apiKey] <String>
|
|||
|
||||
### -------------------------- EXAMPLE 1 --------------------------
|
||||
```
|
||||
Get-Asset -url "https://assets.dip.co.uk" -token "token..."
|
||||
Get-Asset -url "https://assets.example.com" -token "token..."
|
||||
```
|
||||
|
||||
### -------------------------- EXAMPLE 2 --------------------------
|
||||
```
|
||||
Get-Asset -url "https://assets.dip.co.uk" -token "token..." | Where-Object {$_.name -eq "SUPPORT23" }
|
||||
Get-Asset -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "MyMachine" }
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ schema: 2.0.0
|
|||
# Get-Category
|
||||
|
||||
## SYNOPSIS
|
||||
{{Fill in the Synopsis}}
|
||||
# Gets a list of Snipe-it Categories
|
||||
|
||||
## SYNTAX
|
||||
|
||||
|
|
@ -21,17 +21,20 @@ Get-Category [-url] <String> [-apiKey] <String>
|
|||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
### -------------------------- EXAMPLE 1 --------------------------
|
||||
```
|
||||
PS C:\> {{ Add example code here }}
|
||||
Get-Category -url "https://assets.example.com" -token "token..."
|
||||
```
|
||||
|
||||
{{ Add example description here }}
|
||||
### -------------------------- EXAMPLE 2 --------------------------
|
||||
```
|
||||
Get-Category -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "Laptop" }
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -apiKey
|
||||
{{Fill apiKey Description}}
|
||||
### -url
|
||||
URL of Snipeit system, can be set using Set-Info command
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
|
|
@ -45,8 +48,8 @@ Accept pipeline input: False
|
|||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -url
|
||||
{{Fill url Description}}
|
||||
### -apiKey
|
||||
Users API Key for Snipeit, can be set using Set-Info command
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
|
|
@ -54,7 +57,7 @@ Parameter Sets: (All)
|
|||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 0
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
|
|
@ -62,13 +65,8 @@ Accept wildcard characters: False
|
|||
|
||||
## INPUTS
|
||||
|
||||
### None
|
||||
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### System.Object
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ schema: 2.0.0
|
|||
# Get-Component
|
||||
|
||||
## SYNOPSIS
|
||||
{{Fill in the Synopsis}}
|
||||
# Gets a list of Snipe-it Components
|
||||
|
||||
## SYNTAX
|
||||
|
||||
|
|
@ -21,17 +21,20 @@ Get-Component [-url] <String> [-apiKey] <String>
|
|||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
### -------------------------- EXAMPLE 1 --------------------------
|
||||
```
|
||||
PS C:\> {{ Add example code here }}
|
||||
Get-Component -url "https://assets.example.com" -token "token..."
|
||||
```
|
||||
|
||||
{{ Add example description here }}
|
||||
### -------------------------- EXAMPLE 2 --------------------------
|
||||
```
|
||||
Get-Component -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "Memory" }
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -apiKey
|
||||
{{Fill apiKey Description}}
|
||||
### -url
|
||||
URL of Snipeit system, can be set using Set-Info command
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
|
|
@ -45,8 +48,8 @@ Accept pipeline input: False
|
|||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -url
|
||||
{{Fill url Description}}
|
||||
### -apiKey
|
||||
Users API Key for Snipeit, can be set using Set-Info command
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
|
|
@ -54,7 +57,7 @@ Parameter Sets: (All)
|
|||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 0
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
|
|
@ -62,13 +65,8 @@ Accept wildcard characters: False
|
|||
|
||||
## INPUTS
|
||||
|
||||
### None
|
||||
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### System.Object
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ schema: 2.0.0
|
|||
# Get-Manufacturer
|
||||
|
||||
## SYNOPSIS
|
||||
{{Fill in the Synopsis}}
|
||||
# Gets a list of Snipe-it Manufacturers
|
||||
|
||||
## SYNTAX
|
||||
|
||||
|
|
@ -21,17 +21,20 @@ Get-Manufacturer [-url] <String> [-apiKey] <String>
|
|||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
### -------------------------- EXAMPLE 1 --------------------------
|
||||
```
|
||||
PS C:\> {{ Add example code here }}
|
||||
Get-Manufacturer -url "https://assets.example.com" -token "token..."
|
||||
```
|
||||
|
||||
{{ Add example description here }}
|
||||
### -------------------------- EXAMPLE 2 --------------------------
|
||||
```
|
||||
Get-Manufacturer -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "HP" }
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -apiKey
|
||||
{{Fill apiKey Description}}
|
||||
### -url
|
||||
URL of Snipeit system, can be set using Set-Info command
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
|
|
@ -45,8 +48,8 @@ Accept pipeline input: False
|
|||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -url
|
||||
{{Fill url Description}}
|
||||
### -apiKey
|
||||
Users API Key for Snipeit, can be set using Set-Info command
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
|
|
@ -54,7 +57,7 @@ Parameter Sets: (All)
|
|||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 0
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
|
|
@ -62,13 +65,8 @@ Accept wildcard characters: False
|
|||
|
||||
## INPUTS
|
||||
|
||||
### None
|
||||
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### System.Object
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ schema: 2.0.0
|
|||
# Get-Model
|
||||
|
||||
## SYNOPSIS
|
||||
{{Fill in the Synopsis}}
|
||||
# Gets a list of Snipe-it Models
|
||||
|
||||
## SYNTAX
|
||||
|
||||
|
|
@ -21,17 +21,20 @@ Get-Model [-url] <String> [-apiKey] <String>
|
|||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
### -------------------------- EXAMPLE 1 --------------------------
|
||||
```
|
||||
PS C:\> {{ Add example code here }}
|
||||
Get-Models -url "https://assets.example.com" -token "token..."
|
||||
```
|
||||
|
||||
{{ Add example description here }}
|
||||
### -------------------------- EXAMPLE 2 --------------------------
|
||||
```
|
||||
Get-Models -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "DL380" }
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -apiKey
|
||||
{{Fill apiKey Description}}
|
||||
### -url
|
||||
URL of Snipeit system, can be set using Set-Info command
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
|
|
@ -45,8 +48,8 @@ Accept pipeline input: False
|
|||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -url
|
||||
{{Fill url Description}}
|
||||
### -apiKey
|
||||
Users API Key for Snipeit, can be set using Set-Info command
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
|
|
@ -54,7 +57,7 @@ Parameter Sets: (All)
|
|||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 0
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
|
|
@ -62,13 +65,8 @@ Accept wildcard characters: False
|
|||
|
||||
## INPUTS
|
||||
|
||||
### None
|
||||
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### System.Object
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ schema: 2.0.0
|
|||
# Get-Status
|
||||
|
||||
## SYNOPSIS
|
||||
{{Fill in the Synopsis}}
|
||||
# Gets a list of Snipe-it Status Labels
|
||||
|
||||
## SYNTAX
|
||||
|
||||
|
|
@ -21,17 +21,20 @@ Get-Status [-url] <String> [-apiKey] <String>
|
|||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
### -------------------------- EXAMPLE 1 --------------------------
|
||||
```
|
||||
PS C:\> {{ Add example code here }}
|
||||
Get-Status -url "https://assets.example.com" -token "token..."
|
||||
```
|
||||
|
||||
{{ Add example description here }}
|
||||
### -------------------------- EXAMPLE 2 --------------------------
|
||||
```
|
||||
Get-Status -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "Ready to Deploy" }
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -apiKey
|
||||
{{Fill apiKey Description}}
|
||||
### -url
|
||||
URL of Snipeit system, can be set using Set-Info command
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
|
|
@ -45,8 +48,8 @@ Accept pipeline input: False
|
|||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -url
|
||||
{{Fill url Description}}
|
||||
### -apiKey
|
||||
Users API Key for Snipeit, can be set using Set-Info command
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
|
|
@ -54,7 +57,7 @@ Parameter Sets: (All)
|
|||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 0
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
|
|
@ -62,13 +65,8 @@ Accept wildcard characters: False
|
|||
|
||||
## INPUTS
|
||||
|
||||
### None
|
||||
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### System.Object
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
||||
|
|
|
|||
|
|
@ -23,12 +23,12 @@ Get-User [-url] <String> [-apiKey] <String>
|
|||
|
||||
### -------------------------- EXAMPLE 1 --------------------------
|
||||
```
|
||||
Get-Users -url "https://assets.dip.co.uk" -token "token..."
|
||||
Get-User -url "https://assets.example.com" -token "token..."
|
||||
```
|
||||
|
||||
### -------------------------- EXAMPLE 2 --------------------------
|
||||
```
|
||||
Get-Users -url "https://assets.dip.co.uk" -token "token..." | Where-Object {$_.username -eq "stephenm" }
|
||||
Get-User -url "https://assets.example.com" -token "token..." | Where-Object {$_.username -eq "stephenm" }
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
|
|
|||
|
|
@ -8,46 +8,49 @@ schema: 2.0.0
|
|||
# New-Asset
|
||||
|
||||
## SYNOPSIS
|
||||
{{Fill in the Synopsis}}
|
||||
Add a new Asset to Snipe-it asset system
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```
|
||||
New-Asset [-Name] <String> [-Status_id] <String> [-Model_id] <String> [-url] <String> [-apiKey] <String>
|
||||
[[-customfields] <Hashtable>] [-WhatIf] [-Confirm]
|
||||
New-Asset [[-tag] <String>] [-Name] <String> [-Status_id] <String> [-Model_id] <String> [-url] <String>
|
||||
[-apiKey] <String> [[-customfields] <Hashtable>] [-WhatIf] [-Confirm]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
{{Fill in the Description}}
|
||||
Long description
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
### -------------------------- EXAMPLE 1 --------------------------
|
||||
```
|
||||
PS C:\> {{ Add example code here }}
|
||||
New-Asset -status_id 1 -model_id 1 -name "Machine1"
|
||||
```
|
||||
|
||||
{{ Add example description here }}
|
||||
### -------------------------- EXAMPLE 2 --------------------------
|
||||
```
|
||||
New-Asset -status_id 1 -model_id 1 -name "Machine1" -CustomValues = @{ "_snipeit_os_5 = "Windows 10 Pro" }
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -Confirm
|
||||
Prompts you for confirmation before running the cmdlet.
|
||||
### -tag
|
||||
Asset Tag for the Asset
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases: cf
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Model_id
|
||||
{{Fill Model_id Description}}
|
||||
### -Name
|
||||
Name of the Asset
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
|
|
@ -61,8 +64,8 @@ Accept pipeline input: False
|
|||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Name
|
||||
{{Fill Name Description}}
|
||||
### -Status_id
|
||||
Status ID of the asset, this can be got using Get-Status
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
|
|
@ -70,14 +73,14 @@ Parameter Sets: (All)
|
|||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 0
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Status_id
|
||||
{{Fill Status_id Description}}
|
||||
### -Model_id
|
||||
Model ID of the asset, this can be got using Get-Model
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
|
|
@ -85,7 +88,52 @@ Parameter Sets: (All)
|
|||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Position: 4
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -url
|
||||
URL of Snipeit system, can be set using Set-Info command
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 5
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -apiKey
|
||||
Users API Key for Snipeit, can be set using Set-Info command
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 6
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -customfields
|
||||
Hastable of custom fields and extra fields that need passing through to Snipeit
|
||||
|
||||
```yaml
|
||||
Type: Hashtable
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 7
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
|
|
@ -107,46 +155,16 @@ Accept pipeline input: False
|
|||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -apiKey
|
||||
{{Fill apiKey Description}}
|
||||
### -Confirm
|
||||
Prompts you for confirmation before running the cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 4
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -customfields
|
||||
{{Fill customfields Description}}
|
||||
|
||||
```yaml
|
||||
Type: Hashtable
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
Aliases: cf
|
||||
|
||||
Required: False
|
||||
Position: 5
|
||||
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
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
|
|
@ -154,13 +172,8 @@ Accept wildcard characters: False
|
|||
|
||||
## INPUTS
|
||||
|
||||
### None
|
||||
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### System.Object
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ schema: 2.0.0
|
|||
# New-Component
|
||||
|
||||
## SYNOPSIS
|
||||
{{Fill in the Synopsis}}
|
||||
Short description
|
||||
|
||||
## SYNTAX
|
||||
|
||||
|
|
@ -18,29 +18,87 @@ New-Component [-name] <String> [-category_id] <String> [-qty] <String> [-url] <S
|
|||
```
|
||||
|
||||
## DESCRIPTION
|
||||
{{Fill in the Description}}
|
||||
Long description
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
### -------------------------- EXAMPLE 1 --------------------------
|
||||
```
|
||||
PS C:\> {{ Add example code here }}
|
||||
An example
|
||||
```
|
||||
|
||||
{{ Add example description here }}
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -Confirm
|
||||
Prompts you for confirmation before running the cmdlet.
|
||||
### -name
|
||||
Parameter description
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases: cf
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -category_id
|
||||
Parameter description
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -qty
|
||||
Parameter description
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -url
|
||||
Parameter description
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 4
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -apiKey
|
||||
Parameter description
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 5
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
|
|
@ -62,76 +120,16 @@ Accept pipeline input: False
|
|||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -apiKey
|
||||
{{Fill apiKey Description}}
|
||||
### -Confirm
|
||||
Prompts you for confirmation before running the cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
Aliases: cf
|
||||
|
||||
Required: True
|
||||
Position: 4
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -category_id
|
||||
{{Fill category_id Description}}
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -name
|
||||
{{Fill name Description}}
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 0
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -qty
|
||||
{{Fill qty Description}}
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 2
|
||||
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
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
|
|
@ -139,14 +137,10 @@ Accept wildcard characters: False
|
|||
|
||||
## INPUTS
|
||||
|
||||
### None
|
||||
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### System.Object
|
||||
|
||||
## NOTES
|
||||
General notes
|
||||
|
||||
## RELATED LINKS
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ schema: 2.0.0
|
|||
# New-Manufacturer
|
||||
|
||||
## SYNOPSIS
|
||||
{{Fill in the Synopsis}}
|
||||
Add a new Manufacturer to Snipe-it asset system
|
||||
|
||||
## SYNTAX
|
||||
|
||||
|
|
@ -17,36 +17,19 @@ New-Manufacturer [-Name] <String> [-url] <String> [-apiKey] <String> [-WhatIf] [
|
|||
```
|
||||
|
||||
## DESCRIPTION
|
||||
{{Fill in the Description}}
|
||||
Long description
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
### -------------------------- EXAMPLE 1 --------------------------
|
||||
```
|
||||
PS C:\> {{ Add example code here }}
|
||||
New-Manufacturer -name "HP"
|
||||
```
|
||||
|
||||
{{ Add example description here }}
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -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
|
||||
```
|
||||
|
||||
### -Name
|
||||
{{Fill Name Description}}
|
||||
Name of the Manufacturer
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
|
|
@ -54,7 +37,37 @@ Parameter Sets: (All)
|
|||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 0
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -url
|
||||
URL of Snipeit system, can be set using Set-Info command
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -apiKey
|
||||
Users API Key for Snipeit, can be set using Set-Info command
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
|
|
@ -76,31 +89,16 @@ Accept pipeline input: False
|
|||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -apiKey
|
||||
{{Fill apiKey Description}}
|
||||
### -Confirm
|
||||
Prompts you for confirmation before running the cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
Aliases: cf
|
||||
|
||||
Required: True
|
||||
Position: 2
|
||||
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: 1
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
|
|
@ -108,13 +106,8 @@ Accept wildcard characters: False
|
|||
|
||||
## INPUTS
|
||||
|
||||
### None
|
||||
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### System.Object
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ schema: 2.0.0
|
|||
# New-Model
|
||||
|
||||
## SYNOPSIS
|
||||
{{Fill in the Synopsis}}
|
||||
Add a new Model to Snipe-it asset system
|
||||
|
||||
## SYNTAX
|
||||
|
||||
|
|
@ -18,29 +18,102 @@ New-Model [-name] <String> [-category_id] <Int32> [-manufacturer_id] <Int32> [-f
|
|||
```
|
||||
|
||||
## DESCRIPTION
|
||||
{{Fill in the Description}}
|
||||
Long description
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
### -------------------------- EXAMPLE 1 --------------------------
|
||||
```
|
||||
PS C:\> {{ Add example code here }}
|
||||
New-Model -name "DL380" -manufacturer_id 2 -fieldset_id 2 -category_id 1
|
||||
```
|
||||
|
||||
{{ Add example description here }}
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -Confirm
|
||||
Prompts you for confirmation before running the cmdlet.
|
||||
### -name
|
||||
Name of the Asset Model
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases: cf
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -category_id
|
||||
Category ID that the asset belongs to this can be got using Get-Category
|
||||
|
||||
```yaml
|
||||
Type: Int32
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 2
|
||||
Default value: 0
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -manufacturer_id
|
||||
Manufacturer ID that the asset belongs to this can be got using Get-Manufacturer
|
||||
|
||||
```yaml
|
||||
Type: Int32
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 3
|
||||
Default value: 0
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -fieldset_id
|
||||
Fieldset ID that the asset uses (Custom fields)
|
||||
|
||||
```yaml
|
||||
Type: Int32
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 4
|
||||
Default value: 0
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -url
|
||||
URL of Snipeit system, can be set using Set-Info command
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 5
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -apiKey
|
||||
Users API Key for Snipeit, can be set using Set-Info command
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 6
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
|
|
@ -62,91 +135,16 @@ Accept pipeline input: False
|
|||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -apiKey
|
||||
{{Fill apiKey Description}}
|
||||
### -Confirm
|
||||
Prompts you for confirmation before running the cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
Aliases: cf
|
||||
|
||||
Required: True
|
||||
Position: 5
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -category_id
|
||||
{{Fill category_id Description}}
|
||||
|
||||
```yaml
|
||||
Type: Int32
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -fieldset_id
|
||||
{{Fill fieldset_id Description}}
|
||||
|
||||
```yaml
|
||||
Type: Int32
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -manufacturer_id
|
||||
{{Fill manufacturer_id Description}}
|
||||
|
||||
```yaml
|
||||
Type: Int32
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -name
|
||||
{{Fill name Description}}
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 0
|
||||
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: 4
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
|
|
@ -154,13 +152,8 @@ Accept wildcard characters: False
|
|||
|
||||
## INPUTS
|
||||
|
||||
### None
|
||||
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### System.Object
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ schema: 2.0.0
|
|||
# Set-Asset
|
||||
|
||||
## SYNOPSIS
|
||||
{{Fill in the Synopsis}}
|
||||
Update a Asset in the Snipe-it asset system
|
||||
|
||||
## SYNTAX
|
||||
|
||||
|
|
@ -18,36 +18,54 @@ Set-Asset [-id] <Int32> [-Name] <String> [-Status_id] <String> [-Model_id] <Stri
|
|||
```
|
||||
|
||||
## DESCRIPTION
|
||||
{{Fill in the Description}}
|
||||
Long description
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
### -------------------------- EXAMPLE 1 --------------------------
|
||||
```
|
||||
PS C:\> {{ Add example code here }}
|
||||
Set-Asset -id 1 -status_id 1 -model_id 1 -name "Machine1"
|
||||
```
|
||||
|
||||
{{ Add example description here }}
|
||||
### -------------------------- EXAMPLE 2 --------------------------
|
||||
```
|
||||
Set-Asset -id 1 -status_id 1 -model_id 1 -name "Machine1" -CustomValues = @{ "_snipeit_os_5 = "Windows 10 Pro" }
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -Confirm
|
||||
Prompts you for confirmation before running the cmdlet.
|
||||
### -id
|
||||
ID of the Asset
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Type: Int32
|
||||
Parameter Sets: (All)
|
||||
Aliases: cf
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: 0
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Name
|
||||
Name of the Asset
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Model_id
|
||||
{{Fill Model_id Description}}
|
||||
### -Status_id
|
||||
Status ID of the asset, this can be got using Get-Status
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
|
|
@ -61,8 +79,8 @@ Accept pipeline input: False
|
|||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Name
|
||||
{{Fill Name Description}}
|
||||
### -Model_id
|
||||
Model ID of the asset, this can be got using Get-Model
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
|
|
@ -70,14 +88,14 @@ Parameter Sets: (All)
|
|||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Position: 4
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Status_id
|
||||
{{Fill Status_id Description}}
|
||||
### -url
|
||||
URL of Snipeit system, can be set using Set-Info command
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
|
|
@ -85,7 +103,37 @@ Parameter Sets: (All)
|
|||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 2
|
||||
Position: 5
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -apiKey
|
||||
Users API Key for Snipeit, can be set using Set-Info command
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 6
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -customfields
|
||||
Hastable of custom fields and extra fields that need passing through to Snipeit
|
||||
|
||||
```yaml
|
||||
Type: Hashtable
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 7
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
|
|
@ -107,61 +155,16 @@ Accept pipeline input: False
|
|||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -apiKey
|
||||
{{Fill apiKey Description}}
|
||||
### -Confirm
|
||||
Prompts you for confirmation before running the cmdlet.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 5
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -customfields
|
||||
{{Fill customfields Description}}
|
||||
|
||||
```yaml
|
||||
Type: Hashtable
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
Aliases: cf
|
||||
|
||||
Required: False
|
||||
Position: 6
|
||||
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: 0
|
||||
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: 4
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
|
|
@ -169,13 +172,8 @@ Accept wildcard characters: False
|
|||
|
||||
## INPUTS
|
||||
|
||||
### None
|
||||
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### System.Object
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue