Merge pull request #119 from snazy2000/develop

First 1.2 version
This commit is contained in:
Petri Asikainen 2021-05-24 16:45:32 +03:00 committed by GitHub
commit 5934568b20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
97 changed files with 1912 additions and 627 deletions

View file

@ -5,6 +5,25 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/), The format is based on [Keep a Changelog](http://keepachangelog.com/),
and this project adheres to [Semantic Versioning](http://semver.org/). and this project adheres to [Semantic Versioning](http://semver.org/).
# [v1.2.x] - 2021-05-24
## Prefixing SnipeItPS
### New Features
All commands are now prefixed like Set-Info -> Set-SnipeItInfo.
To keep compatibility all old commands are available as aliases.
To update existing scripts theres Update-SnipeItAlias command.
### New fuctions
- Update-SnipeitAlias Tool to update existing scripts
- Get-SnipeItLicenceSeat lists license seats
- Set-SnipeItLicenseSeat Set and checkouts/in license seats
Licenseseat api is supported from Snipe-It release => v5.1.5
### New fixes
Added -id parameter support to support Get-SnipeItCustomField and
Get-SnipeItFieldSet commands
# [v1.1.x] - 2021-05-18 # [v1.1.x] - 2021-05-18
## Pull request rollup release. Lots of new features including: ## Pull request rollup release. Lots of new features including:

View file

@ -0,0 +1,38 @@
Function Get-SnipeItAlias(){
@{'Get-Asset' = 'Get-SnipeItAsset';
'Get-AssetMaintenance' = 'Get-SnipeItAssetMaintenance';
'Get-Category' = 'Get-SnipeItCategory';
'Get-Company' = 'Get-SnipeItCompany';
'Get-Component' = 'Get-SnipeItCompany';
'Get-CustomField' = 'Get-SnipeItCustomField';
'Get-Department' = 'Get-SnipeItDepartment';
'Get-Fieldset' = 'Get-SnipeItFieldset';
'Get-Manufacturer' = 'Get-SnipeItManufacturer';
'Get-Model' = 'Get-SnipeItModel';
'Get-Status' = 'Get-SnipeItStatus';
'Get-Supplier' = 'Get-SnipeItSupplier';
'Get-User' = 'Get-SnipeItUser';
'New-Asset' = 'New-SnipeItAsset';
'New-AssetMaintenance' = 'New-SnipeItAssetMaintenance';
'New-Category' = 'New-SnipeItCategory';
'New-Component' = 'New-SnipeItComponent';
'New-CustomField' = 'New-SnipeItCustomField';
'New-Department' = 'New-SnipeItDepartment';
'New-License' = 'New-SnipeItLicense';
'Set-License' = 'Set-SnipeItLicense';
'New-Location' = 'New-SnipeItLocation';
'New-Manufacturer' = 'New-SnipeItManufacturer';
'New-Model' = 'New-SnipeItModel';
'New-User' = 'New-SnipeItUser';
'Set-Asset' = 'Set-SnipeItAsset';
'Set-AssetOwner' = 'Set-SnipeItAssetOwner';
'Set-Component' = 'Set-SnipeItComponent';
'Set-Model' = 'Set-SnipeItModel';
'Set-Info' = 'Set-SnipeItInfo';
'Set-User' = 'Set-SnipeItUser';
'New-Accessory' = 'New-SnipeItAccessory';
'Set-Accessory' = 'Set-SnipeItAccessory';
'Get-Accessory' = 'Get-SnipeItAccessory';
'Remove-Asset' = 'Remove-SnipeItAsset';
'Remove-User' = 'Remove-SnipeItUser';}
}

View file

@ -0,0 +1,18 @@
function Set-SnipeItAlias()
{
[CmdletBinding(
SupportsShouldProcess = $true,
ConfirmImpact = "Low"
)]
param()
Write-Verbose "Setting compatibility aliases.. "
Write-Verbose "All aliases are deprediated."
$SnipeItAliases = get-SnipeItAlias
ForEach ($key in $SnipeItAliases.Keys ) {
New-Alias -Name $key -Value $($SnipeItAliases[$key]) -Scope 1
Write-Verbose ("{0,5} -> {1}" -f $key,$($SnipeItAliases[$key]))
}
Write-Verbose "Please start using native 'SnipeIt' prfixed functions instead."
Get-Command -Module SnipeItPS -CommandType Alias | Select-Object -Property DisplayName,ResolvedCommand
}

View file

@ -0,0 +1,15 @@
function Test-SnipeItAlias()
{
[CmdletBinding()]
param(
[parameter(mandatory = $true)]
[string]$invocationName,
[parameter(mandatory = $true)]
[string]$commandName
)
if($invocationName -ne $commandName) {
Write-Warning "$invocationName is still working, but it has been superceded by $commandName, please use it instead."
Write-Warning 'To update your scripts you can use Update-SnipeItAlias helper function: '
Write-Warning '"Get-Content [your-script.ps1] | Update-SnipeItAlias | Out-File [new-script-name.ps1]"'
}
}

View file

@ -1,36 +0,0 @@
<#
.SYNOPSIS
Returns a list of all Snipe-IT 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
Get-Field -url "https://assets.example.com" -token "token..."
#>
function Get-CustomField()
{
Param(
[parameter(mandatory = $true)]
[string]$url,
[parameter(mandatory = $true)]
[string]$apiKey
)
$Parameters = @{
Uri = "$url/api/v1/fields"
Method = 'Get'
Token = $apiKey
}
$result = Invoke-SnipeitMethod @Parameters
$result
}

View file

@ -1,37 +0,0 @@
<#
.SYNOPSIS
Gets a list of Snipe-it Fieldsets
.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-Fieldset -url "https://assets.example.com" -token "token..."
.EXAMPLE
Get-Fieldset -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "Windows" }
#>
function Get-Fieldset() {
Param(
[parameter(mandatory = $true)]
[string]$url,
[parameter(mandatory = $true)]
[string]$apiKey
)
$Parameters = @{
Uri = "$url/api/v1/fieldsets"
Method = 'Get'
Token = $apiKey
}
$result = Invoke-SnipeitMethod @Parameters
$result
}

View file

@ -21,20 +21,20 @@ Result offset to use
A return all results, works with -offset and other parameters A return all results, works with -offset and other parameters
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
Get-Accessory -search Keyboard Get-SnipeItAccessory -search Keyboard
.EXAMPLE .EXAMPLE
Get-Accessory -id 1 Get-SnipeItAccessory -id 1
#> #>
function Get-Accessory() { function Get-SnipeItAccessory() {
Param( Param(
[string]$search, [string]$search,
@ -63,6 +63,7 @@ function Get-Accessory() {
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
@ -81,7 +82,7 @@ function Get-Accessory() {
while ($true) { while ($true) {
$callargs['offset'] = $offstart $callargs['offset'] = $offstart
$callargs['limit'] = $limit $callargs['limit'] = $limit
$res=Get-Accessory @callargs $res=Get-SnipeItAccessory @callargs
$res $res
if ($res.count -lt $limit) { if ($res.count -lt $limit) {
break break

View file

@ -54,29 +54,29 @@ Offset to use
A return all results, works with -offset and other parameters A return all results, works with -offset and other parameters
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
Get-Asset -url "https://assets.example.com"-token "token..." Get-SnipeItAsset -url "https://assets.example.com"-token "token..."
.EXAMPLE .EXAMPLE
Get-Asset -search "myMachine"-url "https://assets.example.com"-token "token..." Get-SnipeItAsset -search "myMachine"-url "https://assets.example.com"-token "token..."
.EXAMPLE .EXAMPLE
Get-Asset -search "myMachine"-url "https://assets.example.com"-token "token..." Get-SnipeItAsset -search "myMachine"-url "https://assets.example.com"-token "token..."
.EXAMPLE .EXAMPLE
Get-Asset -asset_tag "myAssetTag"-url "https://assets.example.com"-token "token..." Get-SnipeItAsset -asset_tag "myAssetTag"-url "https://assets.example.com"-token "token..."
#> #>
function Get-Asset() { function Get-SnipeItAsset() {
Param( Param(
[string]$search, [string]$search,
[string]$id, [int]$id,
[string]$asset_tag, [string]$asset_tag,
@ -118,6 +118,7 @@ function Get-Asset() {
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
@ -164,7 +165,7 @@ function Get-Asset() {
while ($true) { while ($true) {
$callargs['offset'] = $offstart $callargs['offset'] = $offstart
$callargs['limit'] = $limit $callargs['limit'] = $limit
$res=Get-Asset @callargs $res=Get-SnipeItAsset @callargs
$res $res
if ( $res.count -lt $limit) { if ( $res.count -lt $limit) {
break break

View file

@ -24,21 +24,21 @@ Offset to use
A return all results, works with -offset and other parameters A return all results, works with -offset and other parameters
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
Get-AssetMaintenances -url "https://assets.example.com" -token "token..." Get-SnipeItAssetMaintenances -url "https://assets.example.com" -token "token..."
.EXAMPLE .EXAMPLE
Get-AssetMaintenances -search "myMachine" -url "https://assets.example.com" -token "token..." Get-SnipeItAssetMaintenances -search "myMachine" -url "https://assets.example.com" -token "token..."
.EXAMPLE .EXAMPLE
Get-AssetMaintenances -search "myMachine" -url "https://assets.example.com" -token "token..." Get-SnipeItAssetMaintenances -search "myMachine" -url "https://assets.example.com" -token "token..."
#> #>
function Get-AssetMaintenance() { function Get-SnipeItAssetMaintenance() {
Param( Param(
[string]$search, [string]$search,
@ -62,6 +62,8 @@ function Get-AssetMaintenance() {
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
$Parameters = @{ $Parameters = @{
@ -79,7 +81,7 @@ function Get-AssetMaintenance() {
while ($true) { while ($true) {
$callargs['offset'] = $offstart $callargs['offset'] = $offstart
$callargs['limit'] = $limit $callargs['limit'] = $limit
$res=Get-AssetMaintenance @callargs $res=Get-SnipeItAssetMaintenance @callargs
$res $res
if ($res.count -lt $limit) { if ($res.count -lt $limit) {
break break

View file

@ -18,25 +18,25 @@ Offset to use
A return all results, works with -offset and other parameters A return all results, works with -offset and other parameters
.PARAMETER url .PARAMETER url
Url of Snipeit system, can be set using Set-Info command Url of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
Get-Category -id 1 Get-SnipeItCategory -id 1
.EXAMPLE .EXAMPLE
Get-Category -search "Laptop" Get-SnipeItCategory -search "Laptop"
#> #>
function Get-Category() function Get-SnipeItCategory()
{ {
Param( Param(
[string]$search, [string]$search,
[string]$id, [int]$id,
[ValidateSet("asc", "desc")] [ValidateSet("asc", "desc")]
[string]$order = "desc", [string]$order = "desc",
@ -53,6 +53,7 @@ function Get-Category()
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
@ -81,7 +82,7 @@ function Get-Category()
while ($true) { while ($true) {
$callargs['offset'] = $offstart $callargs['offset'] = $offstart
$callargs['limit'] = $limit $callargs['limit'] = $limit
$res=Get-Category @callargs $res=Get-SnipeItCategory @callargs
$res $res
if ($res.count -lt $limit) { if ($res.count -lt $limit) {
break break

View file

@ -17,27 +17,27 @@ Offset to use
.PARAMETER all .PARAMETER all
A return all results, works with -offset and other parameters A return all results, works with -offset and other parameters
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
Get-Company Get-SnipeItCompany
Gets all companies Gets all companies
.EXAMPLE .EXAMPLE
Get-Company -id 1 Get-SnipeItCompany -id 1
Gets specific company Gets specific company
#> #>
function Get-Company() function Get-SnipeItCompany()
{ {
Param( Param(
[string]$search, [string]$search,
[string]$id, [int]$id,
[ValidateSet("asc", "desc")] [ValidateSet("asc", "desc")]
[string]$order = "desc", [string]$order = "desc",
@ -55,6 +55,8 @@ function Get-Company()
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
$apiurl = "$url/api/v1/companies" $apiurl = "$url/api/v1/companies"
@ -82,7 +84,7 @@ function Get-Company()
while ($true) { while ($true) {
$callargs['offset'] = $offstart $callargs['offset'] = $offstart
$callargs['limit'] = $limit $callargs['limit'] = $limit
$res=Get-Company @callargs $res=Get-SnipeItCompany @callargs
$res $res
if ($res.count -lt $limit) { if ($res.count -lt $limit) {
break break

View file

@ -18,30 +18,30 @@ Offset to use
A return all results, works with -offset and other parameters A return all results, works with -offset and other parameters
.PARAMETER url .PARAMETER url
URL of Snipeit system,can be set using Set-Info command URL of Snipeit system,can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
Get-Component Get-SnipeItComponent
Returns all components Returns all components
.EXAMPLE .EXAMPLE
Get-Component -search display Get-SnipeItComponent -search display
Returns search results containeing string display Returns search results containeing string display
.EXAMPLE .EXAMPLE
Get-Component -id Get-SnipeItComponent -id
Returns specific component Returns specific component
#> #>
function Get-Component() { function Get-SnipeItComponent() {
Param( Param(
[string]$search, [string]$search,
[string]$id, [int]$id,
[int]$category_id, [int]$category_id,
@ -68,6 +68,8 @@ function Get-Component() {
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
$apiurl = "$url/api/v1/components" $apiurl = "$url/api/v1/components"
@ -95,7 +97,7 @@ function Get-Component() {
while ($true) { while ($true) {
$callargs['offset'] = $offstart $callargs['offset'] = $offstart
$callargs['limit'] = $limit $callargs['limit'] = $limit
$res=Get-Component @callargs $res=Get-SnipeItComponent @callargs
$res $res
if ($res.count -lt $limit) { if ($res.count -lt $limit) {
break break

View file

@ -0,0 +1,49 @@
<#
.SYNOPSIS
Returns specific Snipe-IT custom field or a list of all custom field
.PARAMETER id
A id of specific field
.PARAMETER url
URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE
Get-SnipeItCustomField -url "https://assets.example.com" -token "token..."
#>
function Get-SnipeItCustomField()
{
Param(
[int]$id,
[parameter(mandatory = $true)]
[string]$url,
[parameter(mandatory = $true)]
[string]$apiKey
)
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
if ($id) {
$apiurl= "$url/api/v1/fields/$id"
} else {
$apiurl = "$url/api/v1/fields"
}
$Parameters = @{
Uri = $apiurl
Method = 'Get'
Token = $apiKey
}
$result = Invoke-SnipeitMethod @Parameters
$result
}

View file

@ -18,28 +18,28 @@ Offset to use
A return all results, works with -offset and other parameters A return all results, works with -offset and other parameters
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
Get-Department -url "https://assets.example.com" -token "token..." Get-SnipeItDepartment -url "https://assets.example.com" -token "token..."
.EXAMPLE .EXAMPLE
Get-Department -search Department1 Get-SnipeItDepartment -search Department1
.EXAMPLE .EXAMPLE
Get-Department -id 1 Get-SnipeItDepartment -id 1
#> #>
function Get-Department() function Get-SnipeItDepartment()
{ {
Param( Param(
[string]$search, [string]$search,
[string]$id, [int]$id,
[ValidateSet("asc", "desc")] [ValidateSet("asc", "desc")]
[string]$order = "desc", [string]$order = "desc",
@ -60,6 +60,8 @@ function Get-Department()
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
$apiurl = "$url/api/v1/departments" $apiurl = "$url/api/v1/departments"
@ -87,7 +89,7 @@ function Get-Department()
while ($true) { while ($true) {
$callargs['offset'] = $offstart $callargs['offset'] = $offstart
$callargs['limit'] = $limit $callargs['limit'] = $limit
$res=Get-Department @callargs $res=Get-SnipeItDepartment @callargs
$res $res
if ($res.count -lt $limit) { if ($res.count -lt $limit) {
break break

View file

@ -0,0 +1,50 @@
<#
.SYNOPSIS
Returns a fieldset or list of Snipe-it Fieldsets
.PARAMETER id
A id of specific fieldset
.PARAMETER url
URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE
Get-SnipeItFieldset -url "https://assets.example.com" -token "token..."
.EXAMPLE
Get-SnipeItFieldset -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "Windows" }
#>
function Get-SnipeItFieldset() {
Param(
[int]$id,
[parameter(mandatory = $true)]
[string]$url,
[parameter(mandatory = $true)]
[string]$apiKey
)
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
if ($id) {
$apiurl = "$url/api/v1/fieldsets/$id"
} else {
$apiurl = "$url/api/v1/fieldsets"
}
$Parameters = @{
Uri = $apiurl
Method = 'Get'
Token = $apiKey
}
$result = Invoke-SnipeitMethod @Parameters
$result
}

View file

@ -19,24 +19,24 @@ A return all results, works with -offset and other parameters
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
Get-License -search SomeLicense Get-SnipeItLicense -search SomeLicense
.EXAMPLE .EXAMPLE
Get-License -id 1 Get-SnipeItLicense -id 1
#> #>
function Get-License() { function Get-SnipeItLicense() {
Param( Param(
[string]$search, [string]$search,
[string]$id, [int]$id,
[string]$name, [string]$name,
@ -79,6 +79,8 @@ function Get-License() {
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
$apiurl = "$url/api/v1/licenses" $apiurl = "$url/api/v1/licenses"
@ -106,7 +108,7 @@ function Get-License() {
while ($true) { while ($true) {
$callargs['offset'] = $offstart $callargs['offset'] = $offstart
$callargs['limit'] = $limit $callargs['limit'] = $limit
$res=Get-License @callargs $res=Get-SnipeItLicense @callargs
$res $res
if ($res.count -lt $limit) { if ($res.count -lt $limit) {
break break

View file

@ -0,0 +1,95 @@
<#
.SYNOPSIS
Gets a list of Snipe-it Licenses Seats or specific Seat
.PARAMETER search
A text string to search the Licenses data
.PARAMETER id
A id of specific License
.PARAMETER seat_id
A id of specific seat
.PARAMETER limit
Specify the number of results you wish to return. Defaults to 50. Defines batch size for -all
.PARAMETER offset
Offset to use
.PARAMETER all
A return all results, works with -offset and other parameters
.PARAMETER url
URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE
Get-SnipeItLicenseSeat -id 1
#>
function Get-SnipeItLicenseSeat() {
Param(
[parameter(mandatory = $true)]
[int]$id,
[int]$seat_id,
[int]$limit = 50,
[int]$offset,
[switch]$all = $false,
[parameter(mandatory = $true)]
[string]$url,
[parameter(mandatory = $true)]
[string]$apiKey
)
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
$apiurl = "$url/api/v1/licenses/$id/seats"
if ($seat_id) {
$apiurl= "$url/api/v1/licenses/$id/seats/$seat_id"
}
$Parameters = @{
Uri = $apiurl
Method = 'Get'
Token = $apiKey
GetParameters = $SearchParameter
}
if ($all) {
$offstart = $(if($offset){$offset} Else {0})
$callargs = $SearchParameter
$callargs.Remove('all')
while ($true) {
$callargs['offset'] = $offstart
$callargs['limit'] = $limit
$res=Get-SnipeItLicenseSeat @callargs
$res
if ($res.count -lt $limit) {
break
}
$offstart = $offstart + $limit
}
} else {
$result = Invoke-SnipeitMethod @Parameters
$result
}
}

View file

@ -18,16 +18,16 @@ Offset to use
A return all results, works with -offset and other parameters A return all results, works with -offset and other parameters
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfoeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
Get-Location -search Location1 Get-SnipeItLocation -search Location1
.EXAMPLE .EXAMPLE
Get-Location -id 3 Get-SnipeItLocation -id 3
#> #>
@ -36,7 +36,7 @@ function Get-SnipeitLocation()
Param( Param(
[string]$search, [string]$search,
[string]$id, [int]$id,
[ValidateSet("asc", "desc")] [ValidateSet("asc", "desc")]
[string]$order = "desc", [string]$order = "desc",
@ -54,6 +54,8 @@ function Get-SnipeitLocation()
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
$apiurl = "$url/api/v1/locations" $apiurl = "$url/api/v1/locations"

View file

@ -18,27 +18,27 @@ Offset to use
A return all results, works with -offset and other parameters A return all results, works with -offset and other parameters
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
Get-Manufacturer -search HP Get-SnipeItManufacturer -search HP
Search all manufacturers for string HP Search all manufacturers for string HP
.EXAMPLE .EXAMPLE
Get-Manufacturer -id 3 Get-SnipeItManufacturer -id 3
Returns manufacturer with id 3 Returns manufacturer with id 3
#> #>
function Get-Manufacturer() function Get-SnipeItManufacturer()
{ {
Param( Param(
[string]$search, [string]$search,
[string]$id, [int]$id,
[ValidateSet("asc", "desc")] [ValidateSet("asc", "desc")]
[string]$order = "desc", [string]$order = "desc",
@ -56,6 +56,8 @@ function Get-Manufacturer()
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
$apiurl = "$url/api/v1/manufacturers" $apiurl = "$url/api/v1/manufacturers"
@ -83,7 +85,7 @@ function Get-Manufacturer()
while ($true) { while ($true) {
$callargs['offset'] = $offstart $callargs['offset'] = $offstart
$callargs['limit'] = $limit $callargs['limit'] = $limit
$res=Get-Manufacturer @callargs $res=Get-SnipeItManufacturer @callargs
$res $res
if ($res.count -lt $limit) { if ($res.count -lt $limit) {
break break

View file

@ -18,20 +18,20 @@ Offset to use
A return all results, works with -offset and other parameters A return all results, works with -offset and other parameters
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
Get-Model -search "DL380" Get-SnipeItModel -search "DL380"
.EXAMPLE .EXAMPLE
Get-Model -id 1 Get-SnipeItModel -id 1
#> #>
function Get-Model() function Get-SnipeItModel()
{ {
Param( Param(
[string]$search, [string]$search,
@ -54,6 +54,8 @@ function Get-Model()
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
$apiurl = "$url/api/v1/models" $apiurl = "$url/api/v1/models"
@ -81,7 +83,7 @@ function Get-Model()
while ($true) { while ($true) {
$callargs['offset'] = $offstart $callargs['offset'] = $offstart
$callargs['limit'] = $limit $callargs['limit'] = $limit
$res=Get-Model @callargs $res=Get-SnipeItModel @callargs
$res $res
if ($res.count -ne $limit ) { if ($res.count -ne $limit ) {
break break

View file

@ -18,25 +18,25 @@ Offset to use
A return all results, works with -offset and other parameters A return all results, works with -offset and other parameters
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
Get-Status -search "Ready to Deploy" Get-SnipeItStatus -search "Ready to Deploy"
.EXAMPLE .EXAMPLE
Get-Status -id 3 Get-SnipeItStatus -id 3
#> #>
function Get-Status() function Get-SnipeItStatus()
{ {
Param( Param(
[string]$search, [string]$search,
[string]$id, [int]$id,
[ValidateSet("asc", "desc")] [ValidateSet("asc", "desc")]
[string]$order = "desc", [string]$order = "desc",
@ -54,6 +54,8 @@ function Get-Status()
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
$apiurl = "$url/api/v1/statuslabels" $apiurl = "$url/api/v1/statuslabels"
@ -81,7 +83,7 @@ function Get-Status()
while ($true) { while ($true) {
$callargs['offset'] = $offstart $callargs['offset'] = $offstart
$callargs['limit'] = $limit $callargs['limit'] = $limit
$res=Get-Status @callargs $res=Get-SnipeItStatus @callargs
$res $res
if ($res.count -lt $limit) { if ($res.count -lt $limit) {
break break

View file

@ -18,25 +18,25 @@ Offset to use
A return all results, works with -offset and other parameters A return all results, works with -offset and other parameters
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
Get-Supplier -search MySupplier Get-SnipeItSupplier -search MySupplier
.EXAMPLE .EXAMPLE
Get-Supplier -id 2 Get-SnipeItSupplier -id 2
#> #>
function Get-Supplier() function Get-SnipeItSupplier()
{ {
Param( Param(
[string]$search, [string]$search,
[string]$id, [int]$id,
[ValidateSet("asc", "desc")] [ValidateSet("asc", "desc")]
[string]$order = "desc", [string]$order = "desc",
@ -54,6 +54,8 @@ function Get-Supplier()
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
$apiurl = "$url/api/v1/suppliers" $apiurl = "$url/api/v1/suppliers"
@ -81,7 +83,7 @@ function Get-Supplier()
while ($true) { while ($true) {
$callargs['offset'] = $offstart $callargs['offset'] = $offstart
$callargs['limit'] = $limit $callargs['limit'] = $limit
$res=Get-Supplier @callargs $res=Get-SnipeItSupplier @callargs
$res $res
if ($res.count -lt $limit) { if ($res.count -lt $limit) {
break break

View file

@ -24,25 +24,25 @@ Offset to use
A return all results, works with -offset and other parameters A return all results, works with -offset and other parameters
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
Get-User -search SomeSurname Get-SnipeItUser -search SomeSurname
.EXAMPLE .EXAMPLE
Get-User -id 3 Get-SnipeItUser -id 3
.EXAMPLE .EXAMPLE
Get-User -username someuser Get-SnipeItUser -username someuser
.EXAMPLE .EXAMPLE
Get-User -email user@somedomain.com Get-SnipeItUser -email user@somedomain.com
#> #>
function Get-User() { function Get-SnipeItUser() {
Param( Param(
[string]$search, [string]$search,
@ -76,6 +76,8 @@ function Get-User() {
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
$apiurl = "$url/api/v1/users" $apiurl = "$url/api/v1/users"
@ -102,7 +104,7 @@ function Get-User() {
while ($true) { while ($true) {
$callargs['offset'] = $offstart $callargs['offset'] = $offstart
$callargs['limit'] = $limit $callargs['limit'] = $limit
$res=Get-User @callargs $res=Get-SnipeItUser @callargs
$res $res
if ($res.count -lt $limit) { if ($res.count -lt $limit) {
break break

View file

@ -48,16 +48,16 @@ ID number of the location the accessory is assigned to
Min quantity of the accessory before alert is triggered Min quantity of the accessory before alert is triggered
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
New-Accessory -name "Accessory" -qty 3 -category_id 1 New-SnipeItAccessory -name "Accessory" -qty 3 -category_id 1
#> #>
function New-Accessory() { function New-SnipeItAccessory() {
[CmdletBinding( [CmdletBinding(
SupportsShouldProcess = $true, SupportsShouldProcess = $true,
ConfirmImpact = "Low" ConfirmImpact = "Low"
@ -102,6 +102,8 @@ function New-Accessory() {
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
if ($values['purchase_date']) { if ($values['purchase_date']) {

View file

@ -43,29 +43,29 @@ Optional Purchase cost of the Asset
Optional Default location id for the asset Optional Default location id for the asset
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.PARAMETER customfields .PARAMETER customfields
Hastable of custom fields and extra fields that need passing through to Snipeit. Hastable of custom fields and extra fields that need passing through to Snipeit.
Use internal field names from snipeit .You can use Get-CustomField to get internal field names. Use internal field names from snipeit .You can use Get-CustomField to get internal field names.
.EXAMPLE .EXAMPLE
New-Asset -status_id 1 -model_id 1 -name "Machine1" New-SnipeItAsset -status_id 1 -model_id 1 -name "Machine1"
Create asset with automatic tag if tag genaration is enabled on snipe-it, other wise without tag Create asset with automatic tag if tag genaration is enabled on snipe-it, other wise without tag
.EXAMPLE .EXAMPLE
New-Asset -status_id 1 -model_id 1 -name "Machine1" -asset_tag "DEV123" New-SnipeItAsset -status_id 1 -model_id 1 -name "Machine1" -asset_tag "DEV123"
Specifying asset tag when creating asset Specifying asset tag when creating asset
.EXAMPLE .EXAMPLE
New-Asset -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" -CustomValues = @{ "_snipeit_os_5" = "Windows 10 Pro" }
Using customfields when creating asset. Using customfields when creating asset.
#> #>
function New-Asset() function New-SnipeItAsset()
{ {
[CmdletBinding( [CmdletBinding(
SupportsShouldProcess = $true, SupportsShouldProcess = $true,
@ -123,6 +123,8 @@ function New-Asset()
[hashtable] $customfields [hashtable] $customfields
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters

View file

@ -31,15 +31,15 @@ Optional completion date
Optional cost Optional cost
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
New-AssetMaintenence -asset_id 1 -supplier_id 1 -title "replace keyboard" -start_date 2021-01-01 New-SnipeItAssetMaintenence -asset_id 1 -supplier_id 1 -title "replace keyboard" -start_date 2021-01-01
#> #>
function New-AssetMaintenance() { function New-SnipeItAssetMaintenance() {
[CmdletBinding( [CmdletBinding(
SupportsShouldProcess = $true, SupportsShouldProcess = $true,
ConfirmImpact = "Low" ConfirmImpact = "Low"
@ -77,6 +77,8 @@ function New-AssetMaintenance() {
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
if ($values['start_date']) { if ($values['start_date']) {

View file

@ -12,11 +12,11 @@ The asset tag of the asset you wish to audit
ID of the location you want to associate with the audit ID of the location you want to associate with the audit
.EXAMPLE .EXAMPLE
New-Audit -tag 1 -location_id 1 New-SnipeItAudit -tag 1 -location_id 1
#> #>
function New-Audit() function New-SnipeItAudit()
{ {
[CmdletBinding( [CmdletBinding(
SupportsShouldProcess = $true, SupportsShouldProcess = $true,
@ -37,6 +37,8 @@ function New-Audit()
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = @{ $Values = @{
"location_id" = $location_id "location_id" = $location_id
} }

View file

@ -9,10 +9,10 @@ Name of new category to be created
Type of new category to be created (asset, accessory, consumable, component, license) Type of new category to be created (asset, accessory, consumable, component, license)
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
User's API Key for Snipeit, can be set using Set-Info command User's API Key for Snipeit, can be set using Set-SnipeItInfo command
.PARAMETER use_default_eula .PARAMETER use_default_eula
If switch is present, use the primary default EULA If switch is present, use the primary default EULA
@ -24,10 +24,10 @@ If switch is present, require users to confirm acceptance of assets in this cate
If switch is present, send email to user on checkin/checkout If switch is present, send email to user on checkin/checkout
.EXAMPLE .EXAMPLE
New-Category -name "Laptops" -category_type asset -url "Snipe-IT URL here..." -apiKey "API key here..." New-SnipeItCategory -name "Laptops" -category_type asset -url "Snipe-IT URL here..." -apiKey "API key here..."
#> #>
function New-Category() function New-SnipeItCategory()
{ {
[CmdletBinding( [CmdletBinding(
SupportsShouldProcess = $true, SupportsShouldProcess = $true,
@ -55,6 +55,8 @@ function New-Category()
[switch]$checkin_email [switch]$checkin_email
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = @{ $Values = @{
"name" = $name "name" = $name
"category_type" = $category_type "category_type" = $category_type

View file

@ -9,17 +9,17 @@ Creates new company on Snipe-It system
Comapany name Comapany name
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
User's API Key for Snipeit, can be set using Set-Info command User's API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
New-Company -name "Acme Company" New-SnipeItCompany -name "Acme Company"
#> #>
function New-Company() function New-SnipeItCompany()
{ {
[CmdletBinding( [CmdletBinding(
SupportsShouldProcess = $true, SupportsShouldProcess = $true,
@ -37,6 +37,8 @@ function New-Company()
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
$Body = $Values | ConvertTo-Json; $Body = $Values | ConvertTo-Json;

View file

@ -24,10 +24,10 @@ Date accessory was purchased
Cost of item being purchased. Cost of item being purchased.
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
User's API Key for Snipeit, can be set using Set-Info command User's API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
An example An example
@ -36,7 +36,7 @@ An example
General notes General notes
#> #>
function New-Component() { function New-SnipeItComponent() {
[CmdletBinding( [CmdletBinding(
SupportsShouldProcess = $true, SupportsShouldProcess = $true,
ConfirmImpact = "Low" ConfirmImpact = "Low"
@ -67,6 +67,8 @@ function New-Component() {
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
if ($values['purchase_date']) { if ($values['purchase_date']) {

View file

@ -9,16 +9,16 @@
Name of the Custom Field Name of the Custom Field
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
New-Field -Name "AntivirusInstalled" -Format "BOOLEAN" -HelpText "Is AntiVirus installed on Asset" New-SnipeItCustomField -Name "AntivirusInstalled" -Format "BOOLEAN" -HelpText "Is AntiVirus installed on Asset"
#> #>
function New-CustomField() function New-SnipeItCustomField()
{ {
[CmdletBinding( [CmdletBinding(
SupportsShouldProcess = $true, SupportsShouldProcess = $true,
@ -46,6 +46,8 @@ function New-CustomField()
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
#Convert Values to JSON format #Convert Values to JSON format

View file

@ -18,17 +18,17 @@
ID number of manager ID number of manager
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
New-Department -name "Department1" -company_id 1 -localtion_id 1 -manager_id 3 New-SnipeItDepartment -name "Department1" -company_id 1 -localtion_id 1 -manager_id 3
#> #>
function New-Department() { function New-SnipeItDepartment() {
[CmdletBinding( [CmdletBinding(
SupportsShouldProcess = $true, SupportsShouldProcess = $true,
ConfirmImpact = "Low" ConfirmImpact = "Low"
@ -53,6 +53,8 @@ function New-Department() {
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
$Body = $Values | ConvertTo-Json; $Body = $Values | ConvertTo-Json;

View file

@ -57,17 +57,17 @@
Termination date for license. Termination date for license.
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
New-Licence -name "License" -seats 3 -company_id 1 New-SnipeItLicence -name "License" -seats 3 -company_id 1
#> #>
function New-License() { function New-SnipeItLicense() {
[CmdletBinding( [CmdletBinding(
SupportsShouldProcess = $true, SupportsShouldProcess = $true,
ConfirmImpact = "Low" ConfirmImpact = "Low"
@ -124,6 +124,8 @@ function New-License() {
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
if ($values['expiration_date']) { if ($values['expiration_date']) {

View file

@ -36,16 +36,16 @@
The manager ID of the location The manager ID of the location
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
New-Location -name "Room 1" -address "123 Asset Street" -parent_id 14 New-SnipeItLocation -name "Room 1" -address "123 Asset Street" -parent_id 14
#> #>
function New-Location() { function New-SnipeItLocation() {
[CmdletBinding( [CmdletBinding(
SupportsShouldProcess = $true, SupportsShouldProcess = $true,
ConfirmImpact = "Low" ConfirmImpact = "Low"
@ -78,6 +78,8 @@ function New-Location() {
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
$Body = $Values | ConvertTo-Json; $Body = $Values | ConvertTo-Json;

View file

@ -9,16 +9,16 @@
Name of the Manufacturer Name of the Manufacturer
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
New-Manufacturer -name "HP" New-SnipeItManufacturer -name "HP"
#> #>
function New-Manufacturer() function New-SnipeItManufacturer()
{ {
[CmdletBinding( [CmdletBinding(
SupportsShouldProcess = $true, SupportsShouldProcess = $true,
@ -36,6 +36,7 @@ function New-Manufacturer()
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = @{ $Values = @{
"name" = $Name "name" = $Name

View file

@ -21,16 +21,16 @@
Fieldset ID that the asset uses (Custom fields) Fieldset ID that the asset uses (Custom fields)
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
New-Model -name "DL380" -manufacturer_id 2 -fieldset_id 2 -category_id 1 New-SnipeItModel -name "DL380" -manufacturer_id 2 -fieldset_id 2 -category_id 1
#> #>
function New-Model() function New-SnipeItModel()
{ {
[CmdletBinding( [CmdletBinding(
SupportsShouldProcess = $true, SupportsShouldProcess = $true,
@ -61,6 +61,8 @@ function New-Model()
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = @{ $Values = @{
name = $name name = $name
category_id = $category_id category_id = $category_id

View file

@ -48,19 +48,19 @@
Mark user as import from ldap Mark user as import from ldap
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
User's API Key for Snipeit, can be set using Set-Info command User's API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
New-user -fist_name It -lastname Snipe -username snipeit -activated $false -company_id 1 -location_id 1 -department_id 1 New-SnipeItuser -fist_name It -lastname Snipe -username snipeit -activated $false -company_id 1 -location_id 1 -department_id 1
Creates new a new user who can't login to system Creates new a new user who can't login to system
.NOTES .NOTES
General notes General notes
#> #>
function New-User() { function New-SnipeItUser() {
[CmdletBinding( [CmdletBinding(
SupportsShouldProcess = $true, SupportsShouldProcess = $true,
@ -109,6 +109,8 @@ function New-User() {
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
if ($password ) { if ($password ) {

View file

@ -1,21 +1,21 @@
<# <#
.SYNOPSIS .SYNOPSIS
Removes Asset to Snipe-it asset system Removes Asset from Snipe-it asset system
.DESCRIPTION .DESCRIPTION
Long description Removes Asset from Snipe-it asset system
.PARAMETER ID .PARAMETER ID
Unique ID For Asset to be removed Unique ID For Asset to be removed
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
User's API Key for Snipeit, can be set using Set-Info command User's API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
Remove-Asset -ID 44 -Verbose Remove-SnipeItAsset -ID 44 -Verbose
#> #>
function Remove-Asset () function Remove-SnipeItAsset ()
{ {
[CmdletBinding( [CmdletBinding(
SupportsShouldProcess = $true, SupportsShouldProcess = $true,
@ -24,7 +24,7 @@ function Remove-Asset ()
Param( Param(
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$ID, [int]$ID,
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
[string]$URL, [string]$URL,
[parameter(mandatory = $true)] [parameter(mandatory = $true)]
@ -32,6 +32,8 @@ function Remove-Asset ()
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = @{ $Values = @{
"ID" = $Name "ID" = $Name
} }

View file

@ -1,4 +1,4 @@
function Remove-AssetMaintenance { function Remove-SnipeItAssetMaintenance {
<# <#
.SYNOPSIS .SYNOPSIS
Remove asset maintenance from Snipe-it asset system Remove asset maintenance from Snipe-it asset system
@ -7,13 +7,13 @@ function Remove-AssetMaintenance {
.PARAMETER ID .PARAMETER ID
Unique ID of the asset maintenance to be removed Unique ID of the asset maintenance to be removed
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfoeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
User's API Key for Snipeit, can be set using Set-Info command User's API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
Remove-AssetMaintenance -ID 44 -url $url -apiKey $secret -Verbose Remove-SnipeItAssetMaintenance -ID 44 -url $url -apiKey $secret -Verbose
#> #>
[CmdletBinding( [CmdletBinding(
SupportsShouldProcess = $true, SupportsShouldProcess = $true,
@ -22,7 +22,7 @@ function Remove-AssetMaintenance {
param ( param (
# Asset maintenance ID # Asset maintenance ID
[Parameter(Mandatory = $true)] [Parameter(Mandatory = $true)]
[string] [int]
$ID, $ID,
# SnipeIt URL # SnipeIt URL
@ -36,6 +36,8 @@ function Remove-AssetMaintenance {
$apiKey $apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = @{ $Values = @{
"ID" = $ID "ID" = $ID
} }

View file

@ -7,16 +7,16 @@
Unique ID For User to be removed Unique ID For User to be removed
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
User's API Key for Snipeit, can be set using Set-Info command User's API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
Remove-User -ID 44 -url $url -apiKey $secret -Verbose Remove-SnipeItUser -ID 44 -url $url -apiKey $secret -Verbose
#> #>
function Remove-User () function Remove-SnipeItUser ()
{ {
[CmdletBinding( [CmdletBinding(
SupportsShouldProcess = $true, SupportsShouldProcess = $true,
@ -33,6 +33,8 @@ function Remove-User ()
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = @{ $Values = @{
"ID" = $ID "ID" = $ID
} }

View file

@ -17,15 +17,15 @@
Notes about checkin Notes about checkin
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfoeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
User's API Key for Snipeit, can be set using Set-Info command User's API Key for Snipeit, can be set using Set-SnipeItInfoeItInfo command
.EXAMPLE .EXAMPLE
Remove-User -ID 44 -url $url -apiKey $secret -Verbose Remove-SnipeItUser -ID 44 -url $url -apiKey $secret -Verbose
#> #>
function Reset-AssetOwner() { function Reset-SnipeItAssetOwner() {
[CmdletBinding( [CmdletBinding(
SupportsShouldProcess = $true, SupportsShouldProcess = $true,
ConfirmImpact = "Medium" ConfirmImpact = "Medium"
@ -48,6 +48,8 @@ function Reset-AssetOwner() {
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = @{ $Values = @{
"notes" = $notes "notes" = $notes
} }

View file

@ -48,16 +48,16 @@ ID number of the location the accessory is assigned to
Min quantity of the accessory before alert is triggered Min quantity of the accessory before alert is triggered
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfoeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfoeItInfoeItInfo command
.EXAMPLE .EXAMPLE
Set-Accessory -id 1 -qty 3 Set-SnipeItAccessory -id 1 -qty 3
#> #>
function Set-Accessory() { function Set-SnipeItAccessory() {
[CmdletBinding( [CmdletBinding(
SupportsShouldProcess = $true, SupportsShouldProcess = $true,
ConfirmImpact = "Low" ConfirmImpact = "Low"
@ -99,6 +99,8 @@ function Set-Accessory() {
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
if ($values['purchase_date']) { if ($values['purchase_date']) {

View file

@ -51,22 +51,22 @@
The id that corresponds to the location where the asset is usually located when not checked out The id that corresponds to the location where the asset is usually located when not checked out
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfoeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfoeItInfo command
.PARAMETER customfields .PARAMETER customfields
Hastable of custom fields and extra fields that need passing through to Snipeit Hastable of custom fields and extra fields that need passing through to Snipeit
.EXAMPLE .EXAMPLE
Set-Asset -id 1 -status_id 1 -model_id 1 -name "Machine1" Set-SnipeItAsset -id 1 -status_id 1 -model_id 1 -name "Machine1"
.EXAMPLE .EXAMPLE
Set-Asset -id 1 -status_id 1 -model_id 1 -name "Machine1" -CustomValues = @{ "_snipeit_os_5 = "Windows 10 Pro" } Set-SnipeItAsset -id 1 -status_id 1 -model_id 1 -name "Machine1" -CustomValues = @{ "_snipeit_os_5 = "Windows 10 Pro" }
#> #>
function Set-Asset() function Set-SnipeItAsset()
{ {
[CmdletBinding( [CmdletBinding(
SupportsShouldProcess = $true, SupportsShouldProcess = $true,
@ -114,6 +114,8 @@ function Set-Asset()
[hashtable] $customfields [hashtable] $customfields
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
if ($model_id) { $Values.Add('model_id',$model_id)} if ($model_id) { $Values.Add('model_id',$model_id)}

View file

@ -25,15 +25,15 @@
Optional date to override the checkout time of now Optional date to override the checkout time of now
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
User's API Key for Snipeit, can be set using Set-Info command User's API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
Remove-User -ID 44 -url $url -apiKey $secret -Verbose Set-SnipeItAssetOwner -id 1 -assigned_id 1 -checkout_to_type user -note "testing check out to user"
#> #>
function Set-AssetOwner() function Set-SnipeItAssetOwner()
{ {
[CmdletBinding( [CmdletBinding(
SupportsShouldProcess = $true, SupportsShouldProcess = $true,
@ -65,6 +65,8 @@ function Set-AssetOwner()
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
if ($Values['expected_checkin']) { if ($Values['expected_checkin']) {

View file

@ -27,10 +27,10 @@ Date accessory was purchased
Cost of item being purchased. Cost of item being purchased.
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
User's API Key for Snipeit, can be set using Set-Info command User's API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
An example An example
@ -38,7 +38,7 @@ An example
.NOTES .NOTES
General notes General notes
#> #>
function Set-Component() function Set-SnipeItComponent()
{ {
[CmdletBinding( [CmdletBinding(
SupportsShouldProcess = $true, SupportsShouldProcess = $true,
@ -69,6 +69,8 @@ function Set-Component()
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
if ($values['purchase_date']) { if ($values['purchase_date']) {

View file

@ -5,15 +5,15 @@
Set apikey and url user to connect Snipe-It system Set apikey and url user to connect Snipe-It system
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
User's API Key for Snipeit, can be set using Set-Info command User's API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
Set-Info -url $url -apiKey -Verbose Set-SnipeItInfo -url $url -apiKey -Verbose
#> #>
function Set-Info { function Set-SnipeItInfo {
[CmdletBinding()] [CmdletBinding()]
[System.Diagnostics.CodeAnalysis.SuppressMessage('PSUseShouldProcessForStateChangingFunctions', '')] [System.Diagnostics.CodeAnalysis.SuppressMessage('PSUseShouldProcessForStateChangingFunctions', '')]
param ( param (
@ -23,7 +23,7 @@ function Set-Info {
) )
BEGIN { BEGIN {
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
function Add-DefaultParameter { function Add-DefaultParameter {
param( param(
[Parameter(Mandatory = $true)] [Parameter(Mandatory = $true)]
@ -43,10 +43,11 @@ function Set-Info {
# http://stackoverflow.com/questions/30427110/set-psdefaultparametersvalues-for-use-within-module-scope # http://stackoverflow.com/questions/30427110/set-psdefaultparametersvalues-for-use-within-module-scope
$PSDefaultParameterValues["${command}:${parameter}"] = $Value $PSDefaultParameterValues["${command}:${parameter}"] = $Value
$global:PSDefaultParameterValues["${command}:${parameter}"] = $Value $global:PSDefaultParameterValues["${command}:${parameter}"] = $Value
} }
} }
$moduleCommands = Get-Command -Module SnipeitPS $moduleCommands = Get-Command -Module SnipeitPS -CommandType Function
} }
PROCESS { PROCESS {

View file

@ -60,17 +60,17 @@
Termination date for license. Termination date for license.
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
Set-Licence -name "License" -seats 3 -company_id 1 Set-SnipeItLicence -name "License" -seats 3 -company_id 1
#> #>
function Set-License() { function Set-SnipeItLicense() {
[CmdletBinding( [CmdletBinding(
SupportsShouldProcess = $true, SupportsShouldProcess = $true,
ConfirmImpact = "Low" ConfirmImpact = "Low"
@ -129,7 +129,9 @@ function Set-License() {
[string]$apiKey [string]$apiKey
) )
$Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
if ($values['expiration_date']) { if ($values['expiration_date']) {
$values['expiration_date'] = $values['expiration_date'].ToString("yyyy-MM-dd") $values['expiration_date'] = $values['expiration_date'].ToString("yyyy-MM-dd")

View file

@ -0,0 +1,78 @@
<#
.SYNOPSIS
Set license seat or checkout license seat
.DESCRIPTION
Checkout specific license seat to user, asset or both
.PARAMETER ID
Unique ID For asset to checkout
.PARAMETER assigned_to
Id of target user
.PARAMETER asset_id
Id of target asset
.PARAMETER note
Notes about checkout
.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
Set-SnipeItLicenceSeat -ID 1 -seat_id 1 -assigned_id 3 -Verbose
Checkout licence to user id 3
.EXAMPLE
Set-SnipeItLicenceSeat -ID 1 -seat_id 1 -asset_id 3 -Verbose
Checkout licence to asset id 3
#>
function Set-SnipeItLicenseSeat()
{
[CmdletBinding(
SupportsShouldProcess = $true,
ConfirmImpact = "Medium"
)]
Param(
[parameter(mandatory = $true)]
[int]$id,
[parameter(mandatory = $true)]
[int]$seat_id,
[int]$assigned_id,
[int]$asset_id,
[string]$note,
[parameter(mandatory = $true)]
[string]$url,
[parameter(mandatory = $true)]
[string]$apiKey
)
$Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
$Body = $Values | ConvertTo-Json;
$Parameters = @{
Uri = "$url/api/v1/licenses/$id/seats/$seat_id"
Method = 'Patch'
Body = $Body
Token = $apiKey
}
If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
{
$result = Invoke-SnipeitMethod @Parameters
}
return $result
}

View file

@ -36,10 +36,10 @@
Parent location as id Parent location as id
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
Set-SnipeitLocation -id 123 -name "Some storage" -parent_id 100 Set-SnipeitLocation -id 123 -name "Some storage" -parent_id 100
@ -82,6 +82,8 @@ function Set-SnipeitLocation() {
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
$Body = $Values | ConvertTo-Json; $Body = $Values | ConvertTo-Json;

View file

@ -24,16 +24,16 @@
Fieldset ID that the asset uses (Custom fields) Fieldset ID that the asset uses (Custom fields)
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
New-Model -name "DL380" -manufacturer_id 2 -fieldset_id 2 -category_id 1 New-SnipeItModel -name "DL380" -manufacturer_id 2 -fieldset_id 2 -category_id 1
#> #>
function Set-Model() { function Set-SnipeItModel() {
[CmdletBinding( [CmdletBinding(
SupportsShouldProcess = $true, SupportsShouldProcess = $true,
ConfirmImpact = "Medium" ConfirmImpact = "Medium"
@ -66,6 +66,8 @@ function Set-Model() {
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
$Body = $Values | ConvertTo-Json; $Body = $Values | ConvertTo-Json;

View file

@ -48,19 +48,19 @@
Mark user as import from ldap Mark user as import from ldap
.PARAMETER url .PARAMETER url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
.PARAMETER apiKey .PARAMETER apiKey
User's API Key for Snipeit, can be set using Set-Info command User's API Key for Snipeit, can be set using Set-SnipeItInfo command
.EXAMPLE .EXAMPLE
Update-user -id 3 -fist_name It -lastname Snipe -username snipeit -activated $false -company_id 1 -location_id 1 -department_id 1 Update-SnipeItUser -id 3 -fist_name It -lastname Snipe -username snipeit -activated $false -company_id 1 -location_id 1 -department_id 1
Updates user with id 3 Updates user with id 3
.NOTES .NOTES
General notes General notes
#> #>
function Set-User() { function Set-SnipeItUser() {
[CmdletBinding( [CmdletBinding(
SupportsShouldProcess = $true, SupportsShouldProcess = $true,
@ -104,6 +104,8 @@ function Set-User() {
[string]$apiKey [string]$apiKey
) )
Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name
$Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters
$Body = $Values | ConvertTo-Json; $Body = $Values | ConvertTo-Json;

View file

@ -0,0 +1,55 @@
<#
.SYNOPSIS
Replaces old SnipeItPS commands with new ones
.DESCRIPTION
Replaces old SnipeItPS commands with new ones
.PARAMETER String
Input string
.EXAMPLE
Get-Content [your-script.ps1] | Update-SnipeItAlias | Out-File [new-script-name.ps1]
Replaces old command from file "your-script.ps1" and creates new script "new-script-name.ps1"
After testing new file you can replace old file with new.
#>
function Update-SnipeItAlias()
{
[CmdletBinding(
SupportsShouldProcess = $true,
ConfirmImpact = "Low"
)]
param(
[Parameter(Mandatory = $true,
ValueFromPipeline = $true)]
[AllowEmptyString()]
[string[]]
$String
)
begin{
Write-Verbose "Replacing old SnipeIt fuctions with new ones.. "
$SnipeItAliases = Get-SnipeItAlias
}
process {
If ($PSCmdlet.ShouldProcess("ShouldProcess?")) {
ForEach ($st in $String){
$result = $st
ForEach ($key in $SnipeItAliases.Keys ) {
#Write-Verbose "Replacing $key with $($SnipeItAliases[$key])"
$result = $result -replace $key, $SnipeItAliases[$key]
}
$result
}
}
}
end{
Write-Verbose "..replacing done"
}
}

Binary file not shown.

View file

@ -1,3 +1,7 @@
<#
.DESCRIPTION
Powershell API for SnipeIt Asset Management
#>
$scriptRoot = $PSScriptRoot + '\Public' $scriptRoot = $PSScriptRoot + '\Public'
Get-ChildItem $scriptRoot *.ps1 | ForEach-Object { Get-ChildItem $scriptRoot *.ps1 | ForEach-Object {
@ -9,3 +13,44 @@ $scriptRoot = $PSScriptRoot + '\Private'
Get-ChildItem $scriptRoot *.ps1 | ForEach-Object { Get-ChildItem $scriptRoot *.ps1 | ForEach-Object {
Import-Module $_.FullName Import-Module $_.FullName
} }
$SnipeItAliases= @{'Get-Asset' = 'Get-SnipeItAsset';
'Get-AssetMaintenance' = 'Get-SnipeItAssetMaintenance';
'Get-Category' = 'Get-SnipeItCategory';
'Get-Company' = 'Get-SnipeItCompany';
'Get-Component' = 'Get-SnipeItCompany';
'Get-CustomField' = 'Get-SnipeItCustomField';
'Get-Department' = 'Get-SnipeItDepartment';
'Get-Fieldset' = 'Get-SnipeItFieldset';
'Get-Manufacturer' = 'Get-SnipeItManufacturer';
'Get-Model' = 'Get-SnipeItModel';
'Get-Status' = 'Get-SnipeItStatus';
'Get-Supplier' = 'Get-SnipeItSupplier';
'Get-User' = 'Get-SnipeItUser';
'New-Asset' = 'New-SnipeItAsset';
'New-AssetMaintenance' = 'New-SnipeItAssetMaintenance';
'New-Category' = 'New-SnipeItCategory';
'New-Component' = 'New-SnipeItComponent';
'New-CustomField' = 'New-SnipeItCustomField';
'New-Department' = 'New-SnipeItDepartment';
'New-License' = 'New-SnipeItLicense';
'Set-License' = 'Set-SnipeItLicense';
'New-Location' = 'New-SnipeItLocation';
'New-Manufacturer' = 'New-SnipeItManufacturer';
'New-Model' = 'New-SnipeItModel';
'New-User' = 'New-SnipeItUser';
'Set-Asset' = 'Set-SnipeItAsset';
'Set-AssetOwner' = 'Set-SnipeItAssetOwner';
'Set-Component' = 'Set-SnipeItComponent';
'Set-Model' = 'Set-SnipeItModel';
'Set-Info' = 'Set-SnipeItInfo';
'Set-User' = 'Set-SnipeItUser';
'New-Accessory' = 'New-SnipeItAccessory';
'Set-Accessory' = 'Set-SnipeItAccessory';
'Get-Accessory' = 'Get-SnipeItAccessory';
'Remove-Asset' = 'Remove-SnipeItAsset';
'Remove-User' = 'Remove-SnipeItUser';}
#Create unprefixed aliases
Set-SnipeItAlias

View file

@ -14,7 +14,7 @@ environment:
PSGalleryAPIKey: PSGalleryAPIKey:
secure: UdM6qhf5B0G8liHhUrwWERCZr44iSqmg4jUq0lwlTjZs4KyeoiwnBzdej0phqIAm secure: UdM6qhf5B0G8liHhUrwWERCZr44iSqmg4jUq0lwlTjZs4KyeoiwnBzdej0phqIAm
version: 1.1.{build} version: 1.2.{build}
# Don't rebuild when I tag a release on GitHub # Don't rebuild when I tag a release on GitHub
skip_tags: true skip_tags: true

View file

@ -1,11 +1,11 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# Get-Accessory # Get-SnipeItAccessory
## SYNOPSIS ## SYNOPSIS
Gets a list of Snipe-it Accessories Gets a list of Snipe-it Accessories
@ -13,7 +13,7 @@ Gets a list of Snipe-it Accessories
## SYNTAX ## SYNTAX
``` ```
Get-Accessory [[-search] <String>] [[-company_id] <Int32>] [[-category_id] <Int32>] Get-SnipeItAccessory [[-search] <String>] [[-company_id] <Int32>] [[-category_id] <Int32>]
[[-manufacturer_id] <Int32>] [[-supplier_id] <Int32>] [[-sort] <String>] [[-order] <String>] [[-manufacturer_id] <Int32>] [[-supplier_id] <Int32>] [[-sort] <String>] [[-order] <String>]
[[-limit] <Int32>] [[-offset] <Int32>] [-all] [-url] <String> [-apiKey] <String> [<CommonParameters>] [[-limit] <Int32>] [[-offset] <Int32>] [-all] [-url] <String> [-apiKey] <String> [<CommonParameters>]
``` ```
@ -25,12 +25,12 @@ Gets a list of Snipe-it Accessories
### EXAMPLE 1 ### EXAMPLE 1
``` ```
Get-Accessory -search Keyboard Get-SnipeItAccessory -search Keyboard
``` ```
### EXAMPLE 2 ### EXAMPLE 2
``` ```
Get-Accessory -id 1 Get-SnipeItAccessory -id 1
``` ```
## PARAMETERS ## PARAMETERS
@ -51,7 +51,7 @@ Accept wildcard characters: False
``` ```
### -apiKey ### -apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -203,7 +203,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,11 +1,11 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# Get-Asset # Get-SnipeItAsset
## SYNOPSIS ## SYNOPSIS
Gets a list of Snipe-it Assets or specific asset Gets a list of Snipe-it Assets or specific asset
@ -13,7 +13,7 @@ Gets a list of Snipe-it Assets or specific asset
## SYNTAX ## SYNTAX
``` ```
Get-Asset [[-search] <String>] [[-id] <String>] [[-asset_tag] <String>] [[-asset_serial] <String>] Get-SnipeItAsset [[-search] <String>] [[-id] <Int32>] [[-asset_tag] <String>] [[-asset_serial] <String>]
[[-order_number] <Int32>] [[-model_id] <Int32>] [[-category_id] <Int32>] [[-manufacturer_id] <Int32>] [[-order_number] <Int32>] [[-model_id] <Int32>] [[-category_id] <Int32>] [[-manufacturer_id] <Int32>]
[[-company_id] <Int32>] [[-location_id] <Int32>] [[-depreciation_id] <Int32>] [[-requestable] <Boolean>] [[-company_id] <Int32>] [[-location_id] <Int32>] [[-depreciation_id] <Int32>] [[-requestable] <Boolean>]
[[-status] <String>] [[-status_id] <Int32>] [[-sort] <String>] [[-order] <String>] [[-limit] <Int32>] [[-status] <String>] [[-status_id] <Int32>] [[-sort] <String>] [[-order] <String>] [[-limit] <Int32>]
@ -27,22 +27,22 @@ Get-Asset [[-search] <String>] [[-id] <String>] [[-asset_tag] <String>] [[-asset
### EXAMPLE 1 ### EXAMPLE 1
``` ```
Get-Asset -url "https://assets.example.com"-token "token..." Get-SnipeItAsset -url "https://assets.example.com"-token "token..."
``` ```
### EXAMPLE 2 ### EXAMPLE 2
``` ```
Get-Asset -search "myMachine"-url "https://assets.example.com"-token "token..." Get-SnipeItAsset -search "myMachine"-url "https://assets.example.com"-token "token..."
``` ```
### EXAMPLE 3 ### EXAMPLE 3
``` ```
Get-Asset -search "myMachine"-url "https://assets.example.com"-token "token..." Get-SnipeItAsset -search "myMachine"-url "https://assets.example.com"-token "token..."
``` ```
### EXAMPLE 4 ### EXAMPLE 4
``` ```
Get-Asset -asset_tag "myAssetTag"-url "https://assets.example.com"-token "token..." Get-SnipeItAsset -asset_tag "myAssetTag"-url "https://assets.example.com"-token "token..."
``` ```
## PARAMETERS ## PARAMETERS
@ -63,7 +63,7 @@ Accept wildcard characters: False
``` ```
### -apiKey ### -apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -156,13 +156,13 @@ Accept wildcard characters: False
ID number of excact snipeit asset ID number of excact snipeit asset
```yaml ```yaml
Type: String Type: Int32
Parameter Sets: (All) Parameter Sets: (All)
Aliases: Aliases:
Required: False Required: False
Position: 2 Position: 2
Default value: None Default value: 0
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
``` ```
@ -350,7 +350,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,11 +1,11 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# Get-AssetMaintenance # Get-SnipeItAssetMaintenance
## SYNOPSIS ## SYNOPSIS
Lists Snipe-it Assets Maintenances Lists Snipe-it Assets Maintenances
@ -13,7 +13,7 @@ Lists Snipe-it Assets Maintenances
## SYNTAX ## SYNTAX
``` ```
Get-AssetMaintenance [[-search] <String>] [[-asset_id] <Int32>] [[-sort] <String>] [[-order] <String>] Get-SnipeItAssetMaintenance [[-search] <String>] [[-asset_id] <Int32>] [[-sort] <String>] [[-order] <String>]
[[-limit] <Int32>] [-all] [[-offset] <Int32>] [-url] <String> [-apiKey] <String> [<CommonParameters>] [[-limit] <Int32>] [-all] [[-offset] <Int32>] [-url] <String> [-apiKey] <String> [<CommonParameters>]
``` ```
@ -24,17 +24,17 @@ Get-AssetMaintenance [[-search] <String>] [[-asset_id] <Int32>] [[-sort] <String
### EXAMPLE 1 ### EXAMPLE 1
``` ```
Get-AssetMaintenances -url "https://assets.example.com" -token "token..." Get-SnipeItAssetMaintenances -url "https://assets.example.com" -token "token..."
``` ```
### EXAMPLE 2 ### EXAMPLE 2
``` ```
Get-AssetMaintenances -search "myMachine" -url "https://assets.example.com" -token "token..." Get-SnipeItAssetMaintenances -search "myMachine" -url "https://assets.example.com" -token "token..."
``` ```
### EXAMPLE 3 ### EXAMPLE 3
``` ```
Get-AssetMaintenances -search "myMachine" -url "https://assets.example.com" -token "token..." Get-SnipeItAssetMaintenances -search "myMachine" -url "https://assets.example.com" -token "token..."
``` ```
## PARAMETERS ## PARAMETERS
@ -55,7 +55,7 @@ Accept wildcard characters: False
``` ```
### -apiKey ### -apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -162,7 +162,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,11 +1,11 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# Get-Category # Get-SnipeItCategory
## SYNOPSIS ## SYNOPSIS
Gets a list of Snipe-it Categories Gets a list of Snipe-it Categories
@ -13,8 +13,8 @@ Gets a list of Snipe-it Categories
## SYNTAX ## SYNTAX
``` ```
Get-Category [[-search] <String>] [[-id] <String>] [[-order] <String>] [[-limit] <Int32>] [[-offset] <Int32>] Get-SnipeItCategory [[-search] <String>] [[-id] <Int32>] [[-order] <String>] [[-limit] <Int32>]
[-all] [-url] <String> [-apiKey] <String> [<CommonParameters>] [[-offset] <Int32>] [-all] [-url] <String> [-apiKey] <String> [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -24,12 +24,12 @@ Get-Category [[-search] <String>] [[-id] <String>] [[-order] <String>] [[-limit]
### EXAMPLE 1 ### EXAMPLE 1
``` ```
Get-Category -id 1 Get-SnipeItCategory -id 1
``` ```
### EXAMPLE 2 ### EXAMPLE 2
``` ```
Get-Category -search "Laptop" Get-SnipeItCategory -search "Laptop"
``` ```
## PARAMETERS ## PARAMETERS
@ -50,7 +50,7 @@ Accept wildcard characters: False
``` ```
### -apiKey ### -apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -68,13 +68,13 @@ Accept wildcard characters: False
A id of specific Category A id of specific Category
```yaml ```yaml
Type: String Type: Int32
Parameter Sets: (All) Parameter Sets: (All)
Aliases: Aliases:
Required: False Required: False
Position: 2 Position: 2
Default value: None Default value: 0
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
``` ```
@ -142,7 +142,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
Url of Snipeit system, can be set using Set-Info command Url of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,11 +1,11 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# Get-Company # Get-SnipeItCompany
## SYNOPSIS ## SYNOPSIS
Gets a list of Snipe-it Companies Gets a list of Snipe-it Companies
@ -13,8 +13,8 @@ Gets a list of Snipe-it Companies
## SYNTAX ## SYNTAX
``` ```
Get-Company [[-search] <String>] [[-id] <String>] [[-order] <String>] [[-limit] <Int32>] [[-offset] <Int32>] Get-SnipeItCompany [[-search] <String>] [[-id] <Int32>] [[-order] <String>] [[-limit] <Int32>]
[-all] [-url] <String> [-apiKey] <String> [<CommonParameters>] [[-offset] <Int32>] [-all] [-url] <String> [-apiKey] <String> [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -24,14 +24,14 @@ Get-Company [[-search] <String>] [[-id] <String>] [[-order] <String>] [[-limit]
### EXAMPLE 1 ### EXAMPLE 1
``` ```
Get-Company Get-SnipeItCompany
``` ```
Gets all companies Gets all companies
### EXAMPLE 2 ### EXAMPLE 2
``` ```
Get-Company -id 1 Get-SnipeItCompany -id 1
``` ```
Gets specific company Gets specific company
@ -54,7 +54,7 @@ Accept wildcard characters: False
``` ```
### -apiKey ### -apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -72,13 +72,13 @@ Accept wildcard characters: False
A id of specific Company A id of specific Company
```yaml ```yaml
Type: String Type: Int32
Parameter Sets: (All) Parameter Sets: (All)
Aliases: Aliases:
Required: False Required: False
Position: 2 Position: 2
Default value: None Default value: 0
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
``` ```
@ -146,7 +146,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,11 +1,11 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# Get-Component # Get-SnipeItComponent
## SYNOPSIS ## SYNOPSIS
Gets a list of Snipe-it Components Gets a list of Snipe-it Components
@ -13,7 +13,7 @@ Gets a list of Snipe-it Components
## SYNTAX ## SYNTAX
``` ```
Get-Component [[-search] <String>] [[-id] <String>] [[-category_id] <Int32>] [[-company_id] <Int32>] Get-SnipeItComponent [[-search] <String>] [[-id] <Int32>] [[-category_id] <Int32>] [[-company_id] <Int32>]
[[-location_id] <Int32>] [[-order] <String>] [[-sort] <String>] [[-limit] <Int32>] [[-offset] <Int32>] [-all] [[-location_id] <Int32>] [[-order] <String>] [[-sort] <String>] [[-limit] <Int32>] [[-offset] <Int32>] [-all]
[-url] <String> [-apiKey] <String> [<CommonParameters>] [-url] <String> [-apiKey] <String> [<CommonParameters>]
``` ```
@ -25,21 +25,21 @@ Get-Component [[-search] <String>] [[-id] <String>] [[-category_id] <Int32>] [[-
### EXAMPLE 1 ### EXAMPLE 1
``` ```
Get-Component Get-SnipeItComponent
``` ```
Returns all components Returns all components
### EXAMPLE 2 ### EXAMPLE 2
``` ```
Get-Component -search display Get-SnipeItComponent -search display
``` ```
Returns search results containeing string display Returns search results containeing string display
### EXAMPLE 3 ### EXAMPLE 3
``` ```
Get-Component -id Get-SnipeItComponent -id
``` ```
Returns specific component Returns specific component
@ -62,7 +62,7 @@ Accept wildcard characters: False
``` ```
### -apiKey ### -apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -110,13 +110,13 @@ Accept wildcard characters: False
A id of specific Component A id of specific Component
```yaml ```yaml
Type: String Type: Int32
Parameter Sets: (All) Parameter Sets: (All)
Aliases: Aliases:
Required: False Required: False
Position: 2 Position: 2
Default value: None Default value: 0
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
``` ```
@ -214,7 +214,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system,can be set using Set-Info command URL of Snipeit system,can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,19 +1,19 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# Get-Fieldset # Get-SnipeItCustomField
## SYNOPSIS ## SYNOPSIS
Gets a list of Snipe-it Fieldsets Returns specific Snipe-IT custom field or a list of all custom field
## SYNTAX ## SYNTAX
``` ```
Get-Fieldset [-url] <String> [-apiKey] <String> [<CommonParameters>] Get-SnipeItCustomField [[-id] <Int32>] [-url] <String> [-apiKey] <String> [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -23,18 +23,43 @@ Get-Fieldset [-url] <String> [-apiKey] <String> [<CommonParameters>]
### EXAMPLE 1 ### EXAMPLE 1
``` ```
Get-Fieldset -url "https://assets.example.com" -token "token..." Get-SnipeItCustomField -url "https://assets.example.com" -token "token..."
```
### EXAMPLE 2
```
Get-Fieldset -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "Windows" }
``` ```
## PARAMETERS ## PARAMETERS
### -apiKey ### -apiKey
Users API Key for Snipeit, can be set using Set-Info command Users 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
A id of specific field
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -url
URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -48,21 +73,6 @@ Accept pipeline input: False
Accept wildcard characters: 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: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters ### 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). 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).

View file

@ -1,11 +1,11 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# Get-Department # Get-SnipeItDepartment
## SYNOPSIS ## SYNOPSIS
Gets a list of Snipe-it Departments Gets a list of Snipe-it Departments
@ -13,8 +13,8 @@ Gets a list of Snipe-it Departments
## SYNTAX ## SYNTAX
``` ```
Get-Department [[-search] <String>] [[-id] <String>] [[-order] <String>] [[-limit] <Int32>] [[-offset] <Int32>] Get-SnipeItDepartment [[-search] <String>] [[-id] <Int32>] [[-order] <String>] [[-limit] <Int32>]
[-all] [[-sort] <String>] [-url] <String> [-apiKey] <String> [<CommonParameters>] [[-offset] <Int32>] [-all] [[-sort] <String>] [-url] <String> [-apiKey] <String> [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -24,17 +24,17 @@ Get-Department [[-search] <String>] [[-id] <String>] [[-order] <String>] [[-limi
### EXAMPLE 1 ### EXAMPLE 1
``` ```
Get-Department -url "https://assets.example.com" -token "token..." Get-SnipeItDepartment -url "https://assets.example.com" -token "token..."
``` ```
### EXAMPLE 2 ### EXAMPLE 2
``` ```
Get-Department -search Department1 Get-SnipeItDepartment -search Department1
``` ```
### EXAMPLE 3 ### EXAMPLE 3
``` ```
Get-Department -id 1 Get-SnipeItDepartment -id 1
``` ```
## PARAMETERS ## PARAMETERS
@ -55,7 +55,7 @@ Accept wildcard characters: False
``` ```
### -apiKey ### -apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -73,13 +73,13 @@ Accept wildcard characters: False
A id of specific Department A id of specific Department
```yaml ```yaml
Type: String Type: Int32
Parameter Sets: (All) Parameter Sets: (All)
Aliases: Aliases:
Required: False Required: False
Position: 2 Position: 2
Default value: None Default value: 0
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
``` ```
@ -162,7 +162,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,19 +1,19 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# Get-CustomField # Get-SnipeItFieldset
## SYNOPSIS ## SYNOPSIS
Returns a list of all Snipe-IT custom fields Returns a fieldset or list of Snipe-it Fieldsets
## SYNTAX ## SYNTAX
``` ```
Get-CustomField [-url] <String> [-apiKey] <String> [<CommonParameters>] Get-SnipeItFieldset [[-id] <Int32>] [-url] <String> [-apiKey] <String> [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -23,13 +23,48 @@ Get-CustomField [-url] <String> [-apiKey] <String> [<CommonParameters>]
### EXAMPLE 1 ### EXAMPLE 1
``` ```
Get-Field -url "https://assets.example.com" -token "token..." Get-SnipeItFieldset -url "https://assets.example.com" -token "token..."
```
### EXAMPLE 2
```
Get-SnipeItFieldset -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "Windows" }
``` ```
## PARAMETERS ## PARAMETERS
### -apiKey ### -apiKey
Users API Key for Snipeit, can be set using Set-Info command Users 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
A id of specific fieldset
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -url
URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -43,21 +78,6 @@ Accept pipeline input: False
Accept wildcard characters: 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: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters ### 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). 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).

351
docs/Get-SnipeItLicense.md Normal file
View file

@ -0,0 +1,351 @@
---
external help file: SnipeItPS-help.xml
Module Name: SnipeitPS
online version:
schema: 2.0.0
---
# Get-SnipeItLicense
## SYNOPSIS
Gets a list of Snipe-it Licenses
## SYNTAX
```
Get-SnipeItLicense [[-search] <String>] [[-id] <Int32>] [[-name] <String>] [[-company_id] <Int32>]
[[-product_key] <String>] [[-order_number] <Int32>] [[-purchase_order] <String>] [[-license_name] <String>]
[[-license_email] <MailAddress>] [[-manufacturer_id] <Int32>] [[-supplier_id] <Int32>]
[[-depreciation_id] <Int32>] [[-category_id] <Int32>] [[-order] <String>] [[-sort] <String>]
[[-limit] <Int32>] [[-offset] <Int32>] [-all] [-url] <String> [-apiKey] <String> [<CommonParameters>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### EXAMPLE 1
```
Get-SnipeItLicense -search SomeLicense
```
### EXAMPLE 2
```
Get-SnipeItLicense -id 1
```
## PARAMETERS
### -all
A return all results, works with -offset and other parameters
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -apiKey
Users API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 19
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: False
Position: 13
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -company_id
{{ Fill company_id Description }}
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -depreciation_id
{{ Fill depreciation_id Description }}
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 12
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -id
A id of specific License
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -license_email
{{ Fill license_email Description }}
```yaml
Type: MailAddress
Parameter Sets: (All)
Aliases:
Required: False
Position: 9
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -license_name
{{ Fill license_name Description }}
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 8
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -limit
Specify the number of results you wish to return.
Defaults to 50.
Defines batch size for -all
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 16
Default value: 50
Accept pipeline input: False
Accept wildcard characters: False
```
### -manufacturer_id
{{ Fill manufacturer_id Description }}
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 10
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -name
{{ Fill name Description }}
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -offset
Offset to use
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 17
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -order
{{ Fill order Description }}
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 14
Default value: Desc
Accept pipeline input: False
Accept wildcard characters: False
```
### -order_number
{{ Fill order_number Description }}
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 6
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -product_key
{{ Fill product_key Description }}
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -purchase_order
{{ Fill purchase_order Description }}
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 7
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -search
A text string to search the Licenses data
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -sort
{{ Fill sort Description }}
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 15
Default value: Created_at
Accept pipeline input: False
Accept wildcard characters: False
```
### -supplier_id
{{ Fill supplier_id Description }}
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 11
Default value: 0
Accept pipeline input: False
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: 18
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

View file

@ -0,0 +1,148 @@
---
external help file: SnipeItPS-help.xml
Module Name: SnipeitPS
online version:
schema: 2.0.0
---
# Get-SnipeItLicenseSeat
## SYNOPSIS
Gets a list of Snipe-it Licenses Seats or specific Seat
## SYNTAX
```
Get-SnipeItLicenseSeat [-id] <Int32> [[-seat_id] <Int32>] [[-limit] <Int32>] [[-offset] <Int32>] [-all]
[-url] <String> [-apiKey] <String> [<CommonParameters>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### EXAMPLE 1
```
Get-SnipeItLicenseSeat -id 1
```
## PARAMETERS
### -all
A return all results, works with -offset and other parameters
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -apiKey
Users API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -id
A id of specific License
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -limit
Specify the number of results you wish to return.
Defaults to 50.
Defines batch size for -all
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: 50
Accept pipeline input: False
Accept wildcard characters: False
```
### -offset
Offset to use
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -seat_id
A id of specific seat
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: 0
Accept pipeline input: False
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: 5
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

View file

@ -5,7 +5,7 @@ online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# Get-Manufacturer # Get-SnipeItManufacturer
## SYNOPSIS ## SYNOPSIS
# Gets a list of Snipe-it Manufacturers # Gets a list of Snipe-it Manufacturers
@ -13,7 +13,7 @@ schema: 2.0.0
## SYNTAX ## SYNTAX
``` ```
Get-Manufacturer [[-search] <String>] [[-id] <String>] [[-order] <String>] [[-limit] <Int32>] Get-SnipeItManufacturer [[-search] <String>] [[-id] <Int32>] [[-order] <String>] [[-limit] <Int32>]
[[-offset] <Int32>] [-all] [-url] <String> [-apiKey] <String> [<CommonParameters>] [[-offset] <Int32>] [-all] [-url] <String> [-apiKey] <String> [<CommonParameters>]
``` ```
@ -24,14 +24,14 @@ Get-Manufacturer [[-search] <String>] [[-id] <String>] [[-order] <String>] [[-li
### EXAMPLE 1 ### EXAMPLE 1
``` ```
Get-Manufacturer -search HP Get-SnipeItManufacturer -search HP
``` ```
Search all manufacturers for string HP Search all manufacturers for string HP
### EXAMPLE 2 ### EXAMPLE 2
``` ```
Get-Manufacturer -id 3 Get-SnipeItManufacturer -id 3
``` ```
Returns manufacturer with id 3 Returns manufacturer with id 3
@ -54,7 +54,7 @@ Accept wildcard characters: False
``` ```
### -apiKey ### -apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -72,13 +72,13 @@ Accept wildcard characters: False
A id of specific Manufactuter A id of specific Manufactuter
```yaml ```yaml
Type: String Type: Int32
Parameter Sets: (All) Parameter Sets: (All)
Aliases: Aliases:
Required: False Required: False
Position: 2 Position: 2
Default value: None Default value: 0
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
``` ```
@ -146,7 +146,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,11 +1,11 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# Get-Model # Get-SnipeItModel
## SYNOPSIS ## SYNOPSIS
Gets a list of Snipe-it Models Gets a list of Snipe-it Models
@ -13,8 +13,8 @@ Gets a list of Snipe-it Models
## SYNTAX ## SYNTAX
``` ```
Get-Model [[-search] <String>] [[-id] <Int32>] [[-order] <String>] [[-limit] <Int32>] [[-offset] <Int32>] Get-SnipeItModel [[-search] <String>] [[-id] <Int32>] [[-order] <String>] [[-limit] <Int32>]
[-all] [-url] <String> [-apiKey] <String> [<CommonParameters>] [[-offset] <Int32>] [-all] [-url] <String> [-apiKey] <String> [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -24,12 +24,12 @@ Get-Model [[-search] <String>] [[-id] <Int32>] [[-order] <String>] [[-limit] <In
### EXAMPLE 1 ### EXAMPLE 1
``` ```
Get-Model -search "DL380" Get-SnipeItModel -search "DL380"
``` ```
### EXAMPLE 2 ### EXAMPLE 2
``` ```
Get-Model -id 1 Get-SnipeItModel -id 1
``` ```
## PARAMETERS ## PARAMETERS
@ -50,7 +50,7 @@ Accept wildcard characters: False
``` ```
### -apiKey ### -apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -142,7 +142,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,11 +1,11 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# Get-Status # Get-SnipeItStatus
## SYNOPSIS ## SYNOPSIS
Gets a list of Snipe-it Status Labels Gets a list of Snipe-it Status Labels
@ -13,8 +13,8 @@ Gets a list of Snipe-it Status Labels
## SYNTAX ## SYNTAX
``` ```
Get-Status [[-search] <String>] [[-id] <String>] [[-order] <String>] [[-limit] <Int32>] [[-offset] <Int32>] Get-SnipeItStatus [[-search] <String>] [[-id] <Int32>] [[-order] <String>] [[-limit] <Int32>]
[-all] [-url] <String> [-apiKey] <String> [<CommonParameters>] [[-offset] <Int32>] [-all] [-url] <String> [-apiKey] <String> [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -24,12 +24,12 @@ Get-Status [[-search] <String>] [[-id] <String>] [[-order] <String>] [[-limit] <
### EXAMPLE 1 ### EXAMPLE 1
``` ```
Get-Status -search "Ready to Deploy" Get-SnipeItStatus -search "Ready to Deploy"
``` ```
### EXAMPLE 2 ### EXAMPLE 2
``` ```
Get-Status -id 3 Get-SnipeItStatus -id 3
``` ```
## PARAMETERS ## PARAMETERS
@ -50,7 +50,7 @@ Accept wildcard characters: False
``` ```
### -apiKey ### -apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -68,13 +68,13 @@ Accept wildcard characters: False
A id of specific Status Label A id of specific Status Label
```yaml ```yaml
Type: String Type: Int32
Parameter Sets: (All) Parameter Sets: (All)
Aliases: Aliases:
Required: False Required: False
Position: 2 Position: 2
Default value: None Default value: 0
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
``` ```
@ -142,7 +142,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -5,7 +5,7 @@ online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# Get-Supplier # Get-SnipeItSupplier
## SYNOPSIS ## SYNOPSIS
# Gets a list of Snipe-it Suppliers # Gets a list of Snipe-it Suppliers
@ -13,8 +13,8 @@ schema: 2.0.0
## SYNTAX ## SYNTAX
``` ```
Get-Supplier [[-search] <String>] [[-id] <String>] [[-order] <String>] [[-limit] <Int32>] [[-offset] <Int32>] Get-SnipeItSupplier [[-search] <String>] [[-id] <Int32>] [[-order] <String>] [[-limit] <Int32>]
[-all] [-url] <String> [-apiKey] <String> [<CommonParameters>] [[-offset] <Int32>] [-all] [-url] <String> [-apiKey] <String> [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -24,12 +24,12 @@ Get-Supplier [[-search] <String>] [[-id] <String>] [[-order] <String>] [[-limit]
### EXAMPLE 1 ### EXAMPLE 1
``` ```
Get-Supplier -search MySupplier Get-SnipeItSupplier -search MySupplier
``` ```
### EXAMPLE 2 ### EXAMPLE 2
``` ```
Get-Supplier -id 2 Get-SnipeItSupplier -id 2
``` ```
## PARAMETERS ## PARAMETERS
@ -50,7 +50,7 @@ Accept wildcard characters: False
``` ```
### -apiKey ### -apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -68,13 +68,13 @@ Accept wildcard characters: False
A id of specific Suplier A id of specific Suplier
```yaml ```yaml
Type: String Type: Int32
Parameter Sets: (All) Parameter Sets: (All)
Aliases: Aliases:
Required: False Required: False
Position: 2 Position: 2
Default value: None Default value: 0
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
``` ```
@ -142,7 +142,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -5,7 +5,7 @@ online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# Get-User # Get-SnipeItUser
## SYNOPSIS ## SYNOPSIS
# Gets a list of Snipe-it Users # Gets a list of Snipe-it Users
@ -13,7 +13,7 @@ schema: 2.0.0
## SYNTAX ## SYNTAX
``` ```
Get-User [[-search] <String>] [[-id] <String>] [[-company_id] <Int32>] [[-location_id] <Int32>] Get-SnipeItUser [[-search] <String>] [[-id] <String>] [[-company_id] <Int32>] [[-location_id] <Int32>]
[[-group_id] <Int32>] [[-department_id] <Int32>] [[-username] <String>] [[-email] <String>] [[-group_id] <Int32>] [[-department_id] <Int32>] [[-username] <String>] [[-email] <String>]
[[-order] <String>] [[-limit] <Int32>] [[-offset] <Int32>] [-all] [-url] <String> [-apiKey] <String> [[-order] <String>] [[-limit] <Int32>] [[-offset] <Int32>] [-all] [-url] <String> [-apiKey] <String>
[<CommonParameters>] [<CommonParameters>]
@ -26,22 +26,22 @@ Get-User [[-search] <String>] [[-id] <String>] [[-company_id] <Int32>] [[-locati
### EXAMPLE 1 ### EXAMPLE 1
``` ```
Get-User -search SomeSurname Get-SnipeItUser -search SomeSurname
``` ```
### EXAMPLE 2 ### EXAMPLE 2
``` ```
Get-User -id 3 Get-SnipeItUser -id 3
``` ```
### EXAMPLE 3 ### EXAMPLE 3
``` ```
Get-User -username someuser Get-SnipeItUser -username someuser
``` ```
### EXAMPLE 4 ### EXAMPLE 4
``` ```
Get-User -email user@somedomain.com Get-SnipeItUser -email user@somedomain.com
``` ```
## PARAMETERS ## PARAMETERS
@ -62,7 +62,7 @@ Accept wildcard characters: False
``` ```
### -apiKey ### -apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -229,7 +229,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,4 +1,4 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
@ -13,7 +13,7 @@ Gets a list of Snipe-it Locations
## SYNTAX ## SYNTAX
``` ```
Get-SnipeitLocation [[-search] <String>] [[-id] <String>] [[-order] <String>] [[-limit] <Int32>] Get-SnipeitLocation [[-search] <String>] [[-id] <Int32>] [[-order] <String>] [[-limit] <Int32>]
[[-offset] <Int32>] [-all] [-url] <String> [-apiKey] <String> [<CommonParameters>] [[-offset] <Int32>] [-all] [-url] <String> [-apiKey] <String> [<CommonParameters>]
``` ```
@ -24,12 +24,12 @@ Get-SnipeitLocation [[-search] <String>] [[-id] <String>] [[-order] <String>] [[
### EXAMPLE 1 ### EXAMPLE 1
``` ```
Get-Location -search Location1 Get-SnipeItLocation -search Location1
``` ```
### EXAMPLE 2 ### EXAMPLE 2
``` ```
Get-Location -id 3 Get-SnipeItLocation -id 3
``` ```
## PARAMETERS ## PARAMETERS
@ -50,7 +50,7 @@ Accept wildcard characters: False
``` ```
### -apiKey ### -apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -68,13 +68,13 @@ Accept wildcard characters: False
A id of specific Location A id of specific Location
```yaml ```yaml
Type: String Type: Int32
Parameter Sets: (All) Parameter Sets: (All)
Aliases: Aliases:
Required: False Required: False
Position: 2 Position: 2
Default value: None Default value: 0
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
``` ```
@ -142,7 +142,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfoeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,11 +1,11 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# New-Asset # New-SnipeItAsset
## SYNOPSIS ## SYNOPSIS
Add a new Asset to Snipe-it asset system Add a new Asset to Snipe-it asset system
@ -13,7 +13,7 @@ Add a new Asset to Snipe-it asset system
## SYNTAX ## SYNTAX
``` ```
New-Asset [-status_id] <Int32> [-model_id] <Int32> [[-name] <String>] [[-asset_tag] <String>] New-SnipeItAsset [-status_id] <Int32> [-model_id] <Int32> [[-name] <String>] [[-asset_tag] <String>]
[[-serial] <String>] [[-company_id] <Int32>] [[-order_number] <String>] [[-notes] <String>] [[-serial] <String>] [[-company_id] <Int32>] [[-order_number] <String>] [[-notes] <String>]
[[-warranty_months] <Int32>] [[-purchase_cost] <String>] [[-purchase_date] <String>] [[-supplier_id] <Int32>] [[-warranty_months] <Int32>] [[-purchase_cost] <String>] [[-purchase_date] <String>] [[-supplier_id] <Int32>]
[[-rtd_location_id] <Int32>] [-url] <String> [-apiKey] <String> [[-customfields] <Hashtable>] [-WhatIf] [[-rtd_location_id] <Int32>] [-url] <String> [-apiKey] <String> [[-customfields] <Hashtable>] [-WhatIf]
@ -27,21 +27,21 @@ Long description
### EXAMPLE 1 ### EXAMPLE 1
``` ```
New-Asset -status_id 1 -model_id 1 -name "Machine1" New-SnipeItAsset -status_id 1 -model_id 1 -name "Machine1"
``` ```
Create asset with automatic tag if tag genaration is enabled on snipe-it, other wise without tag Create asset with automatic tag if tag genaration is enabled on snipe-it, other wise without tag
### EXAMPLE 2 ### EXAMPLE 2
``` ```
New-Asset -status_id 1 -model_id 1 -name "Machine1" -asset_tag "DEV123" New-SnipeItAsset -status_id 1 -model_id 1 -name "Machine1" -asset_tag "DEV123"
``` ```
Specifying asset tag when creating asset Specifying asset tag when creating asset
### EXAMPLE 3 ### EXAMPLE 3
``` ```
New-Asset -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" -CustomValues = @{ "_snipeit_os_5" = "Windows 10 Pro" }
``` ```
Using customfields when creating asset. Using customfields when creating asset.
@ -49,7 +49,7 @@ Using customfields when creating asset.
## PARAMETERS ## PARAMETERS
### -apiKey ### -apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -260,7 +260,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,11 +1,11 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# New-AssetMaintenance # New-SnipeItAssetMaintenance
## SYNOPSIS ## SYNOPSIS
Add a new Asset maintenence to Snipe-it asset system Add a new Asset maintenence to Snipe-it asset system
@ -13,7 +13,7 @@ Add a new Asset maintenence to Snipe-it asset system
## SYNTAX ## SYNTAX
``` ```
New-AssetMaintenance [-asset_id] <Int32> [-supplier_id] <Int32> [-asset_maintenance_type] <String> New-SnipeItAssetMaintenance [-asset_id] <Int32> [-supplier_id] <Int32> [-asset_maintenance_type] <String>
[-title] <String> [-start_date] <DateTime> [[-completion_date] <DateTime>] [[-is_warranty] <Boolean>] [-title] <String> [-start_date] <DateTime> [[-completion_date] <DateTime>] [[-is_warranty] <Boolean>]
[[-cost] <Decimal>] [[-notes] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [[-cost] <Decimal>] [[-notes] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm]
[<CommonParameters>] [<CommonParameters>]
@ -26,13 +26,13 @@ Long description
### EXAMPLE 1 ### EXAMPLE 1
``` ```
New-AssetMaintenence -asset_id 1 -supplier_id 1 -title "replace keyboard" -start_date 2021-01-01 New-SnipeItAssetMaintenence -asset_id 1 -supplier_id 1 -title "replace keyboard" -start_date 2021-01-01
``` ```
## PARAMETERS ## PARAMETERS
### -apiKey ### -apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -182,7 +182,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,11 +1,11 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# New-Category # New-SnipeItCategory
## SYNOPSIS ## SYNOPSIS
Create a new Snipe-IT Category Create a new Snipe-IT Category
@ -13,8 +13,8 @@ Create a new Snipe-IT Category
## SYNTAX ## SYNTAX
``` ```
New-Category [-name] <String> [-category_type] <String> [-url] <String> [-apiKey] <String> [-use_default_eula] New-SnipeItCategory [-name] <String> [-category_type] <String> [-url] <String> [-apiKey] <String>
[-require_acceptance] [-checkin_email] [-WhatIf] [-Confirm] [<CommonParameters>] [-use_default_eula] [-require_acceptance] [-checkin_email] [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -24,13 +24,13 @@ New-Category [-name] <String> [-category_type] <String> [-url] <String> [-apiKey
### EXAMPLE 1 ### EXAMPLE 1
``` ```
New-Category -name "Laptops" -category_type asset -url "Snipe-IT URL here..." -apiKey "API key here..." New-SnipeItCategory -name "Laptops" -category_type asset -url "Snipe-IT URL here..." -apiKey "API key here..."
``` ```
## PARAMETERS ## PARAMETERS
### -apiKey ### -apiKey
User's API Key for Snipeit, can be set using Set-Info command User's API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -105,7 +105,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,11 +1,11 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# New-Component # New-SnipeItComponent
## SYNOPSIS ## SYNOPSIS
Create a new component Create a new component
@ -13,7 +13,7 @@ Create a new component
## SYNTAX ## SYNTAX
``` ```
New-Component [-name] <String> [-category_id] <Int32> [-qty] <String> [[-company_id] <Int32>] New-SnipeItComponent [-name] <String> [-category_id] <Int32> [-qty] <String> [[-company_id] <Int32>]
[[-location_id] <Int32>] [[-purchase_date] <DateTime>] [[-purchase_cost] <Single>] [-url] <String> [[-location_id] <Int32>] [[-purchase_date] <DateTime>] [[-purchase_cost] <Single>] [-url] <String>
[-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>] [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
@ -31,7 +31,7 @@ An example
## PARAMETERS ## PARAMETERS
### -apiKey ### -apiKey
User's API Key for Snipeit, can be set using Set-Info command User's API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -151,7 +151,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,11 +1,11 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# New-CustomField # New-SnipeItCustomField
## SYNOPSIS ## SYNOPSIS
Add a new Custom Field to Snipe-it asset system Add a new Custom Field to Snipe-it asset system
@ -13,7 +13,7 @@ Add a new Custom Field to Snipe-it asset system
## SYNTAX ## SYNTAX
``` ```
New-CustomField [-Name] <String> [[-HelpText] <String>] [[-Element] <String>] [[-Format] <String>] New-SnipeItCustomField [-Name] <String> [[-HelpText] <String>] [[-Element] <String>] [[-Format] <String>]
[[-field_encrypted] <Boolean>] [[-CustomFormat] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [[-field_encrypted] <Boolean>] [[-CustomFormat] <String>] [-url] <String> [-apiKey] <String> [-WhatIf]
[-Confirm] [<CommonParameters>] [-Confirm] [<CommonParameters>]
``` ```
@ -25,13 +25,13 @@ Add a new Custom Field to Snipe-it asset system
### EXAMPLE 1 ### EXAMPLE 1
``` ```
New-Field -Name "AntivirusInstalled" -Format "BOOLEAN" -HelpText "Is AntiVirus installed on Asset" New-SnipeItCustomField -Name "AntivirusInstalled" -Format "BOOLEAN" -HelpText "Is AntiVirus installed on Asset"
``` ```
## PARAMETERS ## PARAMETERS
### -apiKey ### -apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -136,7 +136,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,11 +1,11 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# New-Department # New-SnipeItDepartment
## SYNOPSIS ## SYNOPSIS
Creates a department Creates a department
@ -13,7 +13,7 @@ Creates a department
## SYNTAX ## SYNTAX
``` ```
New-Department [-name] <String> [[-company_id] <Int32>] [[-location_id] <Int32>] [[-manager_id] <Int32>] New-SnipeItDepartment [-name] <String> [[-company_id] <Int32>] [[-location_id] <Int32>] [[-manager_id] <Int32>]
[[-notes] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>] [[-notes] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
@ -24,13 +24,13 @@ Creates a new department on Snipe-It system
### EXAMPLE 1 ### EXAMPLE 1
``` ```
New-Department -name "Department1" -company_id 1 -localtion_id 1 -manager_id 3 New-SnipeItDepartment -name "Department1" -company_id 1 -localtion_id 1 -manager_id 3
``` ```
## PARAMETERS ## PARAMETERS
### -apiKey ### -apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -120,7 +120,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,11 +1,11 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# New-License # New-SnipeItLicense
## SYNOPSIS ## SYNOPSIS
Creates a licence Creates a licence
@ -13,7 +13,7 @@ Creates a licence
## SYNTAX ## SYNTAX
``` ```
New-License [-name] <String> [-seats] <Int32> [[-category_id] <Int32>] [[-company_id] <Int32>] New-SnipeItLicense [-name] <String> [-seats] <Int32> [[-category_id] <Int32>] [[-company_id] <Int32>]
[[-expiration_date] <DateTime>] [[-license_email] <MailAddress>] [[-license_name] <String>] [[-expiration_date] <DateTime>] [[-license_email] <MailAddress>] [[-license_name] <String>]
[[-maintained] <Boolean>] [[-manufacturer_id] <Int32>] [[-notes] <String>] [[-order_number] <String>] [[-maintained] <Boolean>] [[-manufacturer_id] <Int32>] [[-notes] <String>] [[-order_number] <String>]
[[-purchase_cost] <Single>] [[-purchase_date] <DateTime>] [[-reassignable] <Boolean>] [[-serial] <String>] [[-purchase_cost] <Single>] [[-purchase_date] <DateTime>] [[-reassignable] <Boolean>] [[-serial] <String>]
@ -28,13 +28,13 @@ Creates a new licence on Snipe-It system
### EXAMPLE 1 ### EXAMPLE 1
``` ```
New-Licence -name "License" -seats 3 -company_id 1 New-SnipeItLicence -name "License" -seats 3 -company_id 1
``` ```
## PARAMETERS ## PARAMETERS
### -apiKey ### -apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -304,7 +304,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,11 +1,11 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# New-Location # New-SnipeItLocation
## SYNOPSIS ## SYNOPSIS
Add a new Location to Snipe-it asset system Add a new Location to Snipe-it asset system
@ -13,7 +13,7 @@ Add a new Location to Snipe-it asset system
## SYNTAX ## SYNTAX
``` ```
New-Location [-name] <String> [[-address] <String>] [[-address2] <String>] [[-state] <String>] New-SnipeItLocation [-name] <String> [[-address] <String>] [[-address2] <String>] [[-state] <String>]
[[-country] <String>] [[-zip] <String>] [[-parent_id] <Int32>] [[-manager_id] <Int32>] [[-ldap_ou] <String>] [[-country] <String>] [[-zip] <String>] [[-parent_id] <Int32>] [[-manager_id] <Int32>] [[-ldap_ou] <String>]
[-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
@ -25,7 +25,7 @@ Long description
### EXAMPLE 1 ### EXAMPLE 1
``` ```
New-Location -name "Room 1" -address "123 Asset Street" -parent_id 14 New-SnipeItLocation -name "Room 1" -address "123 Asset Street" -parent_id 14
``` ```
## PARAMETERS ## PARAMETERS
@ -61,7 +61,7 @@ Accept wildcard characters: False
``` ```
### -apiKey ### -apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -166,7 +166,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,11 +1,11 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# New-Manufacturer # New-SnipeItManufacturer
## SYNOPSIS ## SYNOPSIS
Add a new Manufacturer to Snipe-it asset system Add a new Manufacturer to Snipe-it asset system
@ -13,7 +13,8 @@ Add a new Manufacturer to Snipe-it asset system
## SYNTAX ## SYNTAX
``` ```
New-Manufacturer [-Name] <String> [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>] New-SnipeItManufacturer [-Name] <String> [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm]
[<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -23,13 +24,13 @@ Long description
### EXAMPLE 1 ### EXAMPLE 1
``` ```
New-Manufacturer -name "HP" New-SnipeItManufacturer -name "HP"
``` ```
## PARAMETERS ## PARAMETERS
### -apiKey ### -apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -59,7 +60,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,11 +1,11 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# New-Model # New-SnipeItModel
## SYNOPSIS ## SYNOPSIS
Add a new Model to Snipe-it asset system Add a new Model to Snipe-it asset system
@ -13,7 +13,7 @@ Add a new Model to Snipe-it asset system
## SYNTAX ## SYNTAX
``` ```
New-Model [-name] <String> [[-model_number] <String>] [-category_id] <Int32> [-manufacturer_id] <Int32> New-SnipeItModel [-name] <String> [[-model_number] <String>] [-category_id] <Int32> [-manufacturer_id] <Int32>
[[-eol] <Int32>] [-fieldset_id] <Int32> [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [[-eol] <Int32>] [-fieldset_id] <Int32> [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm]
[<CommonParameters>] [<CommonParameters>]
``` ```
@ -25,13 +25,13 @@ Long description
### EXAMPLE 1 ### EXAMPLE 1
``` ```
New-Model -name "DL380" -manufacturer_id 2 -fieldset_id 2 -category_id 1 New-SnipeItModel -name "DL380" -manufacturer_id 2 -fieldset_id 2 -category_id 1
``` ```
## PARAMETERS ## PARAMETERS
### -apiKey ### -apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -136,7 +136,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -5,7 +5,7 @@ online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# New-User # New-SnipeItUser
## SYNOPSIS ## SYNOPSIS
Creates a new user Creates a new user
@ -13,7 +13,7 @@ Creates a new user
## SYNTAX ## SYNTAX
``` ```
New-User [-first_name] <String> [-last_name] <String> [-username] <String> [[-password] <String>] New-SnipeItUser [-first_name] <String> [-last_name] <String> [-username] <String> [[-password] <String>]
[[-activated] <Boolean>] [[-notes] <String>] [[-jobtitle] <String>] [[-email] <String>] [[-phone] <String>] [[-activated] <Boolean>] [[-notes] <String>] [[-jobtitle] <String>] [[-email] <String>] [[-phone] <String>]
[[-company_id] <Int32>] [[-location_id] <Int32>] [[-department_id] <Int32>] [[-manager_id] <Int32>] [[-company_id] <Int32>] [[-location_id] <Int32>] [[-department_id] <Int32>] [[-manager_id] <Int32>]
[[-employee_num] <String>] [[-ldap_import] <Boolean>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [[-employee_num] <String>] [[-ldap_import] <Boolean>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm]
@ -27,7 +27,7 @@ Creates a new user to Snipe-IT system
### EXAMPLE 1 ### EXAMPLE 1
``` ```
New-user -fist_name It -lastname Snipe -username snipeit -activated $false -company_id 1 -location_id 1 -department_id 1 New-SnipeItuser -fist_name It -lastname Snipe -username snipeit -activated $false -company_id 1 -location_id 1 -department_id 1
``` ```
Creates new a new user who can't login to system Creates new a new user who can't login to system
@ -50,7 +50,7 @@ Accept wildcard characters: False
``` ```
### -apiKey ### -apiKey
User's API Key for Snipeit, can be set using Set-Info command User's API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -130,7 +130,7 @@ Users first name
```yaml ```yaml
Type: String Type: String
Parameter Sets: (All) Parameter Sets: (All)
Aliases: firstName Aliases:
Required: True Required: True
Position: 1 Position: 1
@ -160,7 +160,7 @@ Users last name
```yaml ```yaml
Type: String Type: String
Parameter Sets: (All) Parameter Sets: (All)
Aliases: lastName Aliases:
Required: True Required: True
Position: 2 Position: 2
@ -175,7 +175,7 @@ Mark user as import from ldap
```yaml ```yaml
Type: Boolean Type: Boolean
Parameter Sets: (All) Parameter Sets: (All)
Aliases: ldap_user Aliases:
Required: False Required: False
Position: 15 Position: 15
@ -260,7 +260,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,35 +1,35 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# Remove-Asset # Remove-SnipeItAsset
## SYNOPSIS ## SYNOPSIS
Removes Asset to Snipe-it asset system Removes Asset from Snipe-it asset system
## SYNTAX ## SYNTAX
``` ```
Remove-Asset [-ID] <String> [-URL] <String> [-APIKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>] Remove-SnipeItAsset [-ID] <Int32> [-URL] <String> [-APIKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
Long description Removes Asset from Snipe-it asset system
## EXAMPLES ## EXAMPLES
### EXAMPLE 1 ### EXAMPLE 1
``` ```
Remove-Asset -ID 44 -Verbose Remove-SnipeItAsset -ID 44 -Verbose
``` ```
## PARAMETERS ## PARAMETERS
### -APIKey ### -APIKey
User's API Key for Snipeit, can be set using Set-Info command User's API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -47,19 +47,19 @@ Accept wildcard characters: False
Unique ID For Asset to be removed Unique ID For Asset to be removed
```yaml ```yaml
Type: String Type: Int32
Parameter Sets: (All) Parameter Sets: (All)
Aliases: Aliases:
Required: True Required: True
Position: 1 Position: 1
Default value: None Default value: 0
Accept pipeline input: False Accept pipeline input: False
Accept wildcard characters: False Accept wildcard characters: False
``` ```
### -URL ### -URL
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,11 +1,11 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# Remove-User # Remove-SnipeItUser
## SYNOPSIS ## SYNOPSIS
Removes User from Snipe-it asset system Removes User from Snipe-it asset system
@ -13,7 +13,7 @@ Removes User from Snipe-it asset system
## SYNTAX ## SYNTAX
``` ```
Remove-User [-ID] <String> [-URL] <String> [-APIKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>] Remove-SnipeItUser [-ID] <String> [-URL] <String> [-APIKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -23,13 +23,13 @@ Long description
### EXAMPLE 1 ### EXAMPLE 1
``` ```
Remove-User -ID 44 -url $url -apiKey $secret -Verbose Remove-SnipeItUser -ID 44 -url $url -apiKey $secret -Verbose
``` ```
## PARAMETERS ## PARAMETERS
### -APIKey ### -APIKey
User's API Key for Snipeit, can be set using Set-Info command User's API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -59,7 +59,7 @@ Accept wildcard characters: False
``` ```
### -URL ### -URL
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,11 +1,11 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# Set-Accessory # Set-SnipeItAccessory
## SYNOPSIS ## SYNOPSIS
Updates accessory on Snipe-It system Updates accessory on Snipe-It system
@ -13,7 +13,7 @@ Updates accessory on Snipe-It system
## SYNTAX ## SYNTAX
``` ```
Set-Accessory [-id] <Int32> [[-name] <String>] [[-qty] <Int32>] [[-category_id] <Int32>] Set-SnipeItAccessory [-id] <Int32> [[-name] <String>] [[-qty] <Int32>] [[-category_id] <Int32>]
[[-company_id] <Int32>] [[-manufacturer_id] <Int32>] [[-order_number] <String>] [[-purchase_cost] <Single>] [[-company_id] <Int32>] [[-manufacturer_id] <Int32>] [[-order_number] <String>] [[-purchase_cost] <Single>]
[[-purchase_date] <DateTime>] [[-min_qty] <Boolean>] [[-supplier_id] <Int32>] [-url] <String> [[-purchase_date] <DateTime>] [[-min_qty] <Boolean>] [[-supplier_id] <Int32>] [-url] <String>
[-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>] [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
@ -26,13 +26,13 @@ Updates accessory on Snipe-It system
### EXAMPLE 1 ### EXAMPLE 1
``` ```
Set-Accessory -id 1 -qty 3 Set-SnipeItAccessory -id 1 -qty 3
``` ```
## PARAMETERS ## PARAMETERS
### -apiKey ### -apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfoeItInfoeItInfo command
```yaml ```yaml
Type: String Type: String
@ -212,7 +212,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfoeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,11 +1,11 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# Set-Asset # Set-SnipeItAsset
## SYNOPSIS ## SYNOPSIS
Update a specific Asset in the Snipe-it asset system Update a specific Asset in the Snipe-it asset system
@ -13,7 +13,7 @@ Update a specific Asset in the Snipe-it asset system
## SYNTAX ## SYNTAX
``` ```
Set-Asset [-id] <Int32> [[-Name] <String>] [[-Status_id] <String>] [[-Model_id] <String>] Set-SnipeItAsset [-id] <Int32> [[-Name] <String>] [[-Status_id] <String>] [[-Model_id] <String>]
[[-last_checkout] <DateTime>] [[-assigned_to] <Int32>] [[-company_id] <Int32>] [[-serial] <String>] [[-last_checkout] <DateTime>] [[-assigned_to] <Int32>] [[-company_id] <Int32>] [[-serial] <String>]
[[-order_number] <String>] [[-warranty_months] <Int32>] [[-purchase_cost] <Double>] [[-order_number] <String>] [[-warranty_months] <Int32>] [[-purchase_cost] <Double>]
[[-purchase_date] <DateTime>] [[-requestable] <Boolean>] [[-archived] <Boolean>] [[-rtd_location_id] <Int32>] [[-purchase_date] <DateTime>] [[-requestable] <Boolean>] [[-archived] <Boolean>] [[-rtd_location_id] <Int32>]
@ -27,18 +27,18 @@ Long description
### EXAMPLE 1 ### EXAMPLE 1
``` ```
Set-Asset -id 1 -status_id 1 -model_id 1 -name "Machine1" Set-SnipeItAsset -id 1 -status_id 1 -model_id 1 -name "Machine1"
``` ```
### EXAMPLE 2 ### EXAMPLE 2
``` ```
Set-Asset -id 1 -status_id 1 -model_id 1 -name "Machine1" -CustomValues = @{ "_snipeit_os_5 = "Windows 10 Pro" } Set-SnipeItAsset -id 1 -status_id 1 -model_id 1 -name "Machine1" -CustomValues = @{ "_snipeit_os_5 = "Windows 10 Pro" }
``` ```
## PARAMETERS ## PARAMETERS
### -apiKey ### -apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfoeItInfo command
```yaml ```yaml
Type: String Type: String
@ -279,7 +279,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfoeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,11 +1,11 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# Set-AssetOwner # Set-SnipeItAssetOwner
## SYNOPSIS ## SYNOPSIS
Checkout asset Checkout asset
@ -13,7 +13,7 @@ Checkout asset
## SYNTAX ## SYNTAX
``` ```
Set-AssetOwner [-id] <Int32> [-assigned_id] <Int32> [[-checkout_to_type] <String>] [[-name] <String>] Set-SnipeItAssetOwner [-id] <Int32> [-assigned_id] <Int32> [[-checkout_to_type] <String>] [[-name] <String>]
[[-note] <String>] [[-expected_checkin] <DateTime>] [[-checkout_at] <DateTime>] [-url] <String> [[-note] <String>] [[-expected_checkin] <DateTime>] [[-checkout_at] <DateTime>] [-url] <String>
[-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>] [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
@ -25,13 +25,13 @@ Checkout asset to user/localtion/asset
### EXAMPLE 1 ### EXAMPLE 1
``` ```
Remove-User -ID 44 -url $url -apiKey $secret -Verbose Set-SnipeItAssetOwner -id 1 -assigned_id 1 -checkout_to_type user -note "testing check out to user"
``` ```
## PARAMETERS ## PARAMETERS
### -apiKey ### -apiKey
User's API Key for Snipeit, can be set using Set-Info command User's API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -154,7 +154,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,11 +1,11 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# Set-Component # Set-SnipeItComponent
## SYNOPSIS ## SYNOPSIS
Updates component Updates component
@ -13,7 +13,7 @@ Updates component
## SYNTAX ## SYNTAX
``` ```
Set-Component [-id] <String> [-qty] <String> [[-name] <String>] [[-company_id] <Int32>] Set-SnipeItComponent [-id] <String> [-qty] <String> [[-name] <String>] [[-company_id] <Int32>]
[[-location_id] <Int32>] [[-purchase_date] <DateTime>] [[-purchase_cost] <Single>] [-url] <String> [[-location_id] <Int32>] [[-purchase_date] <DateTime>] [[-purchase_cost] <Single>] [-url] <String>
[-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>] [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
@ -31,7 +31,7 @@ An example
## PARAMETERS ## PARAMETERS
### -apiKey ### -apiKey
User's API Key for Snipeit, can be set using Set-Info command User's API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -151,7 +151,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,11 +1,11 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# Set-Info # Set-SnipeItInfo
## SYNOPSIS ## SYNOPSIS
Sets authetication information Sets authetication information
@ -13,7 +13,7 @@ Sets authetication information
## SYNTAX ## SYNTAX
``` ```
Set-Info [[-url] <Uri>] [[-apiKey] <String>] [<CommonParameters>] Set-SnipeItInfo [[-url] <Uri>] [[-apiKey] <String>] [<CommonParameters>]
``` ```
## DESCRIPTION ## DESCRIPTION
@ -23,13 +23,13 @@ Set apikey and url user to connect Snipe-It system
### EXAMPLE 1 ### EXAMPLE 1
``` ```
Set-Info -url $url -apiKey -Verbose Set-SnipeItInfo -url $url -apiKey -Verbose
``` ```
## PARAMETERS ## PARAMETERS
### -apiKey ### -apiKey
User's API Key for Snipeit, can be set using Set-Info command User's API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -44,7 +44,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: Uri Type: Uri

View file

@ -1,11 +1,11 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# Set-License # Set-SnipeItLicense
## SYNOPSIS ## SYNOPSIS
Updates a licence Updates a licence
@ -13,7 +13,7 @@ Updates a licence
## SYNTAX ## SYNTAX
``` ```
Set-License [-id] <Int32> [[-name] <String>] [[-seats] <Int32>] [[-category_id] <Int32>] Set-SnipeItLicense [-id] <Int32> [[-name] <String>] [[-seats] <Int32>] [[-category_id] <Int32>]
[[-company_id] <Int32>] [[-expiration_date] <DateTime>] [[-license_email] <MailAddress>] [[-company_id] <Int32>] [[-expiration_date] <DateTime>] [[-license_email] <MailAddress>]
[[-license_name] <String>] [[-maintained] <Boolean>] [[-manufacturer_id] <Int32>] [[-notes] <String>] [[-license_name] <String>] [[-maintained] <Boolean>] [[-manufacturer_id] <Int32>] [[-notes] <String>]
[[-order_number] <String>] [[-purchase_cost] <Single>] [[-purchase_date] <DateTime>] [[-order_number] <String>] [[-purchase_cost] <Single>] [[-purchase_date] <DateTime>]
@ -28,13 +28,13 @@ Updates licence on Snipe-It system
### EXAMPLE 1 ### EXAMPLE 1
``` ```
Set-Licence -name "License" -seats 3 -company_id 1 Set-SnipeItLicence -name "License" -seats 3 -company_id 1
``` ```
## PARAMETERS ## PARAMETERS
### -apiKey ### -apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -319,7 +319,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -0,0 +1,186 @@
---
external help file: SnipeItPS-help.xml
Module Name: SnipeitPS
online version:
schema: 2.0.0
---
# Set-SnipeItLicenseSeat
## SYNOPSIS
Set license seat or checkout license seat
## SYNTAX
```
Set-SnipeItLicenseSeat [-id] <Int32> [-seat_id] <Int32> [[-assigned_id] <Int32>] [[-asset_id] <Int32>]
[[-note] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
```
## DESCRIPTION
Checkout specific license seat to user, asset or both
## EXAMPLES
### EXAMPLE 1
```
Set-SnipeItLicenceSeat -ID 1 -seat_id 1 -assigned_id 3 -Verbose
```
Checkout licence to user id 3
### EXAMPLE 2
```
Set-SnipeItLicenceSeat -ID 1 -seat_id 1 -asset_id 3 -Verbose
```
Checkout licence to asset id 3
## 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: 7
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -asset_id
Id of target asset
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -assigned_id
{{ Fill assigned_id Description }}
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -id
Unique ID For asset to checkout
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```
### -note
Notes about checkout
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -seat_id
{{ Fill seat_id Description }}
```yaml
Type: Int32
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: 0
Accept pipeline input: False
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: 6
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

View file

@ -1,11 +1,11 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# Set-Model # Set-SnipeItModel
## SYNOPSIS ## SYNOPSIS
Updates Model on Snipe-it asset system Updates Model on Snipe-it asset system
@ -13,7 +13,7 @@ Updates Model on Snipe-it asset system
## SYNTAX ## SYNTAX
``` ```
Set-Model [-id] <Int32> [[-name] <String>] [[-model_number] <String>] [[-category_id] <Int32>] Set-SnipeItModel [-id] <Int32> [[-name] <String>] [[-model_number] <String>] [[-category_id] <Int32>]
[[-manufacturer_id] <Int32>] [[-eol] <Int32>] [[-custom_fieldset_id] <Int32>] [-url] <String> [[-manufacturer_id] <Int32>] [[-eol] <Int32>] [[-custom_fieldset_id] <Int32>] [-url] <String>
[-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>] [-apiKey] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
``` ```
@ -25,13 +25,13 @@ Updates Model on Snipe-it asset system
### EXAMPLE 1 ### EXAMPLE 1
``` ```
New-Model -name "DL380" -manufacturer_id 2 -fieldset_id 2 -category_id 1 New-SnipeItModel -name "DL380" -manufacturer_id 2 -fieldset_id 2 -category_id 1
``` ```
## PARAMETERS ## PARAMETERS
### -apiKey ### -apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -151,7 +151,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,11 +1,11 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
schema: 2.0.0 schema: 2.0.0
--- ---
# Set-User # Set-SnipeItUser
## SYNOPSIS ## SYNOPSIS
Creates a new user Creates a new user
@ -13,7 +13,7 @@ Creates a new user
## SYNTAX ## SYNTAX
``` ```
Set-User [-id] <Int32> [[-first_name] <String>] [[-last_name] <String>] [[-userName] <String>] Set-SnipeItUser [-id] <Int32> [[-first_name] <String>] [[-last_name] <String>] [[-userName] <String>]
[[-jobtitle] <String>] [[-email] <String>] [[-phone] <String>] [[-company_id] <Int32>] [[-jobtitle] <String>] [[-email] <String>] [[-phone] <String>] [[-company_id] <Int32>]
[[-location_id] <Int32>] [[-department_id] <Int32>] [[-manager_id] <Int32>] [[-employee_num] <String>] [[-location_id] <Int32>] [[-department_id] <Int32>] [[-manager_id] <Int32>] [[-employee_num] <String>]
[[-activated] <Boolean>] [[-notes] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm] [[-activated] <Boolean>] [[-notes] <String>] [-url] <String> [-apiKey] <String> [-WhatIf] [-Confirm]
@ -27,7 +27,7 @@ Creates a new user to Snipe-IT system
### EXAMPLE 1 ### EXAMPLE 1
``` ```
Update-user -id 3 -fist_name It -lastname Snipe -username snipeit -activated $false -company_id 1 -location_id 1 -department_id 1 Update-SnipeItUser -id 3 -fist_name It -lastname Snipe -username snipeit -activated $false -company_id 1 -location_id 1 -department_id 1
``` ```
Updates user with id 3 Updates user with id 3
@ -50,7 +50,7 @@ Accept wildcard characters: False
``` ```
### -apiKey ### -apiKey
User's API Key for Snipeit, can be set using Set-Info command User's API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -245,7 +245,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,4 +1,4 @@
--- ---
external help file: SnipeItPS-help.xml external help file: SnipeItPS-help.xml
Module Name: SnipeitPS Module Name: SnipeitPS
online version: online version:
@ -61,7 +61,7 @@ Accept wildcard characters: False
``` ```
### -apiKey ### -apiKey
Users API Key for Snipeit, can be set using Set-Info command Users API Key for Snipeit, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String
@ -181,7 +181,7 @@ Accept wildcard characters: False
``` ```
### -url ### -url
URL of Snipeit system, can be set using Set-Info command URL of Snipeit system, can be set using Set-SnipeItInfo command
```yaml ```yaml
Type: String Type: String

View file

@ -1,9 +1,9 @@
--- ---
Module Name: SnipeitPS Module Name: SnipeitPS
Module Guid: {{ Update Module Guid }} Module Guid: f86f4db4-1cb1-45c4-b7bf-6762531bfdeb
Download Help Link: {{ Update Download Link }} Download Help Link: {{ Update Download Link }}
Help Version: {{ Update Help Version }} Help Version: {{ Please enter version of help manually (X.X.X.X) format }}
Locale: {{ Update Locale }} Locale: en-US
--- ---
# SnipeitPS Module # SnipeitPS Module
@ -11,105 +11,117 @@ Locale: {{ Update Locale }}
{{ Fill in the Description }} {{ Fill in the Description }}
## SnipeitPS Cmdlets ## SnipeitPS Cmdlets
### [Get-Accessory](Get-Accessory.md) ### [Get-SnipeItAccessory](Get-SnipeItAccessory.md)
Gets a list of Snipe-it Accessories Gets a list of Snipe-it Accessories
### [Get-Asset](Get-Asset.md) ### [Get-SnipeItAsset](Get-SnipeItAsset.md)
Gets a list of Snipe-it Assets or specific asset Gets a list of Snipe-it Assets or specific asset
### [Get-AssetMaintenance](Get-AssetMaintenance.md) ### [Get-SnipeItAssetMaintenance](Get-SnipeItAssetMaintenance.md)
Lists Snipe-it Assets Maintenances Lists Snipe-it Assets Maintenances
### [Get-Category](Get-Category.md) ### [Get-SnipeItCategory](Get-SnipeItCategory.md)
Gets a list of Snipe-it Categories Gets a list of Snipe-it Categories
### [Get-Company](Get-Company.md) ### [Get-SnipeItCompany](Get-SnipeItCompany.md)
Gets a list of Snipe-it Companies Gets a list of Snipe-it Companies
### [Get-Component](Get-Component.md) ### [Get-SnipeItComponent](Get-SnipeItComponent.md)
Gets a list of Snipe-it Components Gets a list of Snipe-it Components
### [Get-CustomField](Get-CustomField.md) ### [Get-SnipeItCustomField](Get-SnipeItCustomField.md)
Returns a list of all Snipe-IT custom fields Returns specific Snipe-IT custom field or a list of all custom field
### [Get-Department](Get-Department.md) ### [Get-SnipeItDepartment](Get-SnipeItDepartment.md)
Gets a list of Snipe-it Departments Gets a list of Snipe-it Departments
### [Get-Fieldset](Get-Fieldset.md) ### [Get-SnipeItFieldset](Get-SnipeItFieldset.md)
Gets a list of Snipe-it Fieldsets Returns a fieldset or list of Snipe-it Fieldsets
### [Get-Model](Get-Model.md) ### [Get-SnipeItLicense](Get-SnipeItLicense.md)
Gets a list of Snipe-it Models Gets a list of Snipe-it Licenses
### [Get-SnipeItLicenseSeat](Get-SnipeItLicenseSeat.md)
Gets a list of Snipe-it Licenses Seats or specific Seat
### [Get-SnipeitLocation](Get-SnipeitLocation.md) ### [Get-SnipeitLocation](Get-SnipeitLocation.md)
Gets a list of Snipe-it Locations Gets a list of Snipe-it Locations
### [Get-Status](Get-Status.md) ### [Get-SnipeItModel](Get-SnipeItModel.md)
Gets a list of Snipe-it Models
### [Get-SnipeItStatus](Get-SnipeItStatus.md)
Gets a list of Snipe-it Status Labels Gets a list of Snipe-it Status Labels
### [New-Asset](New-Asset.md) ### [New-SnipeItAsset](New-SnipeItAsset.md)
Add a new Asset to Snipe-it asset system Add a new Asset to Snipe-it asset system
### [New-AssetMaintenance](New-AssetMaintenance.md) ### [New-SnipeItAssetMaintenance](New-SnipeItAssetMaintenance.md)
Add a new Asset maintenence to Snipe-it asset system Add a new Asset maintenence to Snipe-it asset system
### [New-Category](New-Category.md) ### [New-SnipeItCategory](New-SnipeItCategory.md)
Create a new Snipe-IT Category Create a new Snipe-IT Category
### [New-Component](New-Component.md) ### [New-SnipeItComponent](New-SnipeItComponent.md)
Create a new component Create a new component
### [New-CustomField](New-CustomField.md) ### [New-SnipeItCustomField](New-SnipeItCustomField.md)
Add a new Custom Field to Snipe-it asset system Add a new Custom Field to Snipe-it asset system
### [New-Department](New-Department.md) ### [New-SnipeItDepartment](New-SnipeItDepartment.md)
Creates a department Creates a department
### [New-License](New-License.md) ### [New-SnipeItLicense](New-SnipeItLicense.md)
Creates a licence Creates a licence
### [New-Location](New-Location.md) ### [New-SnipeItLocation](New-SnipeItLocation.md)
Add a new Location to Snipe-it asset system Add a new Location to Snipe-it asset system
### [New-Manufacturer](New-Manufacturer.md) ### [New-SnipeItManufacturer](New-SnipeItManufacturer.md)
Add a new Manufacturer to Snipe-it asset system Add a new Manufacturer to Snipe-it asset system
### [New-Model](New-Model.md) ### [New-SnipeItModel](New-SnipeItModel.md)
Add a new Model to Snipe-it asset system Add a new Model to Snipe-it asset system
### [New-User](New-User.md) ### [New-SnipeItUser](New-SnipeItUser.md)
Creates a new user Creates a new user
### [Remove-Asset](Remove-Asset.md) ### [Remove-SnipeItAsset](Remove-SnipeItAsset.md)
Removes Asset to Snipe-it asset system Removes Asset from Snipe-it asset system
### [Remove-User](Remove-User.md) ### [Remove-SnipeItUser](Remove-SnipeItUser.md)
Removes User from Snipe-it asset system Removes User from Snipe-it asset system
### [Set-Accessory](Set-Accessory.md) ### [Set-SnipeItAccessory](Set-SnipeItAccessory.md)
Updates accessory on Snipe-It system Updates accessory on Snipe-It system
### [Set-Asset](Set-Asset.md) ### [Set-SnipeItAsset](Set-SnipeItAsset.md)
Update a specific Asset in the Snipe-it asset system Update a specific Asset in the Snipe-it asset system
### [Set-AssetOwner](Set-AssetOwner.md) ### [Set-SnipeItAssetOwner](Set-SnipeItAssetOwner.md)
Checkout asset Checkout asset
### [Set-Component](Set-Component.md) ### [Set-SnipeItComponent](Set-SnipeItComponent.md)
Updates component Updates component
### [Set-Info](Set-Info.md) ### [Set-SnipeItInfo](Set-SnipeItInfo.md)
Sets authetication information Sets authetication information
### [Set-License](Set-License.md) ### [Set-SnipeItLicense](Set-SnipeItLicense.md)
Updates a licence Updates a licence
### [Set-Model](Set-Model.md) ### [Set-SnipeItLicenseSeat](Set-SnipeItLicenseSeat.md)
Updates Model on Snipe-it asset system Set license seat or checkout license seat
### [Set-SnipeitLocation](Set-SnipeitLocation.md) ### [Set-SnipeitLocation](Set-SnipeitLocation.md)
Updates Location in Snipe-it asset system Updates Location in Snipe-it asset system
### [Set-User](Set-User.md) ### [Set-SnipeItModel](Set-SnipeItModel.md)
Updates Model on Snipe-it asset system
### [Set-SnipeItUser](Set-SnipeItUser.md)
Creates a new user Creates a new user
### [Update-SnipeItAlias](Update-SnipeItAlias.md)
{{ Fill in the Synopsis }}

View file

@ -0,0 +1,91 @@
---
external help file: SnipeItPS-help.xml
Module Name: SnipeitPS
online version:
schema: 2.0.0
---
# Update-SnipeItAlias
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
Update-SnipeItAlias [-String] <String[]> [-WhatIf] [-Confirm] [<CommonParameters>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -String
{{ Fill String Description }}
```yaml
Type: String[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
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
### System.String[]
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS