diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f8d2ff..9d2b243 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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/), 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 ## Pull request rollup release. Lots of new features including: diff --git a/SnipeitPS/Private/Get-SnipeItAlias.ps1 b/SnipeitPS/Private/Get-SnipeItAlias.ps1 new file mode 100644 index 0000000..08218d6 --- /dev/null +++ b/SnipeitPS/Private/Get-SnipeItAlias.ps1 @@ -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';} +} diff --git a/SnipeitPS/Private/Set-SnipeItAlias.ps1 b/SnipeitPS/Private/Set-SnipeItAlias.ps1 new file mode 100644 index 0000000..899f316 --- /dev/null +++ b/SnipeitPS/Private/Set-SnipeItAlias.ps1 @@ -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 + +} diff --git a/SnipeitPS/Private/Test-SnipeItAlias.ps1 b/SnipeitPS/Private/Test-SnipeItAlias.ps1 new file mode 100644 index 0000000..0664cb7 --- /dev/null +++ b/SnipeitPS/Private/Test-SnipeItAlias.ps1 @@ -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]"' + } +} diff --git a/SnipeitPS/Public/Get-CustomField.ps1 b/SnipeitPS/Public/Get-CustomField.ps1 deleted file mode 100644 index ff52aa5..0000000 --- a/SnipeitPS/Public/Get-CustomField.ps1 +++ /dev/null @@ -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 -} diff --git a/SnipeitPS/Public/Get-Fieldset.ps1 b/SnipeitPS/Public/Get-Fieldset.ps1 deleted file mode 100644 index 54035b3..0000000 --- a/SnipeitPS/Public/Get-Fieldset.ps1 +++ /dev/null @@ -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 -} diff --git a/SnipeitPS/Public/Get-Accessory.ps1 b/SnipeitPS/Public/Get-SnipeItAccessory.ps1 similarity index 81% rename from SnipeitPS/Public/Get-Accessory.ps1 rename to SnipeitPS/Public/Get-SnipeItAccessory.ps1 index 3cb0ba6..8ac47b9 100644 --- a/SnipeitPS/Public/Get-Accessory.ps1 +++ b/SnipeitPS/Public/Get-SnipeItAccessory.ps1 @@ -21,20 +21,20 @@ Result offset to use A return all results, works with -offset and other parameters .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 -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 -Get-Accessory -search Keyboard +Get-SnipeItAccessory -search Keyboard .EXAMPLE -Get-Accessory -id 1 +Get-SnipeItAccessory -id 1 #> -function Get-Accessory() { +function Get-SnipeItAccessory() { Param( [string]$search, @@ -63,6 +63,7 @@ function Get-Accessory() { [parameter(mandatory = $true)] [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters @@ -81,7 +82,7 @@ function Get-Accessory() { while ($true) { $callargs['offset'] = $offstart $callargs['limit'] = $limit - $res=Get-Accessory @callargs + $res=Get-SnipeItAccessory @callargs $res if ($res.count -lt $limit) { break diff --git a/SnipeitPS/Public/Get-Asset.ps1 b/SnipeitPS/Public/Get-SnipeItAsset.ps1 similarity index 85% rename from SnipeitPS/Public/Get-Asset.ps1 rename to SnipeitPS/Public/Get-SnipeItAsset.ps1 index 8954437..40bf01b 100644 --- a/SnipeitPS/Public/Get-Asset.ps1 +++ b/SnipeitPS/Public/Get-SnipeItAsset.ps1 @@ -54,29 +54,29 @@ Offset to use A return all results, works with -offset and other parameters .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 -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 -Get-Asset -url "https://assets.example.com"-token "token..." +Get-SnipeItAsset -url "https://assets.example.com"-token "token..." .EXAMPLE -Get-Asset -search "myMachine"-url "https://assets.example.com"-token "token..." +Get-SnipeItAsset -search "myMachine"-url "https://assets.example.com"-token "token..." .EXAMPLE -Get-Asset -search "myMachine"-url "https://assets.example.com"-token "token..." +Get-SnipeItAsset -search "myMachine"-url "https://assets.example.com"-token "token..." .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( [string]$search, - [string]$id, + [int]$id, [string]$asset_tag, @@ -118,6 +118,7 @@ function Get-Asset() { [parameter(mandatory = $true)] [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters @@ -164,7 +165,7 @@ function Get-Asset() { while ($true) { $callargs['offset'] = $offstart $callargs['limit'] = $limit - $res=Get-Asset @callargs + $res=Get-SnipeItAsset @callargs $res if ( $res.count -lt $limit) { break diff --git a/SnipeitPS/Public/Get-AssetMaintenance.ps1 b/SnipeitPS/Public/Get-SnipeItAssetMaintenance.ps1 similarity index 73% rename from SnipeitPS/Public/Get-AssetMaintenance.ps1 rename to SnipeitPS/Public/Get-SnipeItAssetMaintenance.ps1 index 81b29fe..602b0c6 100644 --- a/SnipeitPS/Public/Get-AssetMaintenance.ps1 +++ b/SnipeitPS/Public/Get-SnipeItAssetMaintenance.ps1 @@ -24,21 +24,21 @@ Offset to use A return all results, works with -offset and other parameters .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 -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 -Get-AssetMaintenances -url "https://assets.example.com" -token "token..." +Get-SnipeItAssetMaintenances -url "https://assets.example.com" -token "token..." .EXAMPLE -Get-AssetMaintenances -search "myMachine" -url "https://assets.example.com" -token "token..." +Get-SnipeItAssetMaintenances -search "myMachine" -url "https://assets.example.com" -token "token..." .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( [string]$search, @@ -62,6 +62,8 @@ function Get-AssetMaintenance() { [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $Parameters = @{ @@ -79,7 +81,7 @@ function Get-AssetMaintenance() { while ($true) { $callargs['offset'] = $offstart $callargs['limit'] = $limit - $res=Get-AssetMaintenance @callargs + $res=Get-SnipeItAssetMaintenance @callargs $res if ($res.count -lt $limit) { break diff --git a/SnipeitPS/Public/Get-Category.ps1 b/SnipeitPS/Public/Get-SnipeItCategory.ps1 similarity index 81% rename from SnipeitPS/Public/Get-Category.ps1 rename to SnipeitPS/Public/Get-SnipeItCategory.ps1 index c66f530..827feb5 100644 --- a/SnipeitPS/Public/Get-Category.ps1 +++ b/SnipeitPS/Public/Get-SnipeItCategory.ps1 @@ -18,25 +18,25 @@ Offset to use A return all results, works with -offset and other parameters .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 -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 -Get-Category -id 1 +Get-SnipeItCategory -id 1 .EXAMPLE -Get-Category -search "Laptop" +Get-SnipeItCategory -search "Laptop" #> -function Get-Category() +function Get-SnipeItCategory() { Param( [string]$search, - [string]$id, + [int]$id, [ValidateSet("asc", "desc")] [string]$order = "desc", @@ -53,6 +53,7 @@ function Get-Category() [parameter(mandatory = $true)] [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters @@ -81,7 +82,7 @@ function Get-Category() while ($true) { $callargs['offset'] = $offstart $callargs['limit'] = $limit - $res=Get-Category @callargs + $res=Get-SnipeItCategory @callargs $res if ($res.count -lt $limit) { break diff --git a/SnipeitPS/Public/Get-Company.ps1 b/SnipeitPS/Public/Get-SnipeItCompany.ps1 similarity index 82% rename from SnipeitPS/Public/Get-Company.ps1 rename to SnipeitPS/Public/Get-SnipeItCompany.ps1 index fbead48..99748d6 100644 --- a/SnipeitPS/Public/Get-Company.ps1 +++ b/SnipeitPS/Public/Get-SnipeItCompany.ps1 @@ -17,27 +17,27 @@ 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-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command .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 -Get-Company +Get-SnipeItCompany Gets all companies .EXAMPLE -Get-Company -id 1 +Get-SnipeItCompany -id 1 Gets specific company #> -function Get-Company() +function Get-SnipeItCompany() { Param( [string]$search, - [string]$id, + [int]$id, [ValidateSet("asc", "desc")] [string]$order = "desc", @@ -55,6 +55,8 @@ function Get-Company() [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $apiurl = "$url/api/v1/companies" @@ -82,7 +84,7 @@ function Get-Company() while ($true) { $callargs['offset'] = $offstart $callargs['limit'] = $limit - $res=Get-Company @callargs + $res=Get-SnipeItCompany @callargs $res if ($res.count -lt $limit) { break diff --git a/SnipeitPS/Public/Get-Component.ps1 b/SnipeitPS/Public/Get-SnipeItComponent.ps1 similarity index 83% rename from SnipeitPS/Public/Get-Component.ps1 rename to SnipeitPS/Public/Get-SnipeItComponent.ps1 index 2218ad5..9adb8c1 100644 --- a/SnipeitPS/Public/Get-Component.ps1 +++ b/SnipeitPS/Public/Get-SnipeItComponent.ps1 @@ -18,30 +18,30 @@ Offset to use A return all results, works with -offset and other parameters .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 -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 -Get-Component +Get-SnipeItComponent Returns all components .EXAMPLE -Get-Component -search display +Get-SnipeItComponent -search display Returns search results containeing string display .EXAMPLE -Get-Component -id +Get-SnipeItComponent -id Returns specific component #> -function Get-Component() { +function Get-SnipeItComponent() { Param( [string]$search, - [string]$id, + [int]$id, [int]$category_id, @@ -68,6 +68,8 @@ function Get-Component() { [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $apiurl = "$url/api/v1/components" @@ -95,7 +97,7 @@ function Get-Component() { while ($true) { $callargs['offset'] = $offstart $callargs['limit'] = $limit - $res=Get-Component @callargs + $res=Get-SnipeItComponent @callargs $res if ($res.count -lt $limit) { break diff --git a/SnipeitPS/Public/Get-SnipeItCustomField.ps1 b/SnipeitPS/Public/Get-SnipeItCustomField.ps1 new file mode 100644 index 0000000..276b7bf --- /dev/null +++ b/SnipeitPS/Public/Get-SnipeItCustomField.ps1 @@ -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 +} diff --git a/SnipeitPS/Public/Get-Department.ps1 b/SnipeitPS/Public/Get-SnipeItDepartment.ps1 similarity index 79% rename from SnipeitPS/Public/Get-Department.ps1 rename to SnipeitPS/Public/Get-SnipeItDepartment.ps1 index 4fcaeb6..b80ec8a 100644 --- a/SnipeitPS/Public/Get-Department.ps1 +++ b/SnipeitPS/Public/Get-SnipeItDepartment.ps1 @@ -18,28 +18,28 @@ Offset to use A return all results, works with -offset and other parameters .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 -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 -Get-Department -url "https://assets.example.com" -token "token..." +Get-SnipeItDepartment -url "https://assets.example.com" -token "token..." .EXAMPLE -Get-Department -search Department1 +Get-SnipeItDepartment -search Department1 .EXAMPLE -Get-Department -id 1 +Get-SnipeItDepartment -id 1 #> -function Get-Department() +function Get-SnipeItDepartment() { Param( [string]$search, - [string]$id, + [int]$id, [ValidateSet("asc", "desc")] [string]$order = "desc", @@ -60,6 +60,8 @@ function Get-Department() [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $apiurl = "$url/api/v1/departments" @@ -87,7 +89,7 @@ function Get-Department() while ($true) { $callargs['offset'] = $offstart $callargs['limit'] = $limit - $res=Get-Department @callargs + $res=Get-SnipeItDepartment @callargs $res if ($res.count -lt $limit) { break diff --git a/SnipeitPS/Public/Get-SnipeItFieldset.ps1 b/SnipeitPS/Public/Get-SnipeItFieldset.ps1 new file mode 100644 index 0000000..33d0252 --- /dev/null +++ b/SnipeitPS/Public/Get-SnipeItFieldset.ps1 @@ -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 +} diff --git a/SnipeitPS/Public/Get-License.ps1 b/SnipeitPS/Public/Get-SnipeItLicense.ps1 similarity index 85% rename from SnipeitPS/Public/Get-License.ps1 rename to SnipeitPS/Public/Get-SnipeItLicense.ps1 index 0cb1a7d..bdca13b 100644 --- a/SnipeitPS/Public/Get-License.ps1 +++ b/SnipeitPS/Public/Get-SnipeItLicense.ps1 @@ -19,24 +19,24 @@ A return all results, works with -offset and other parameters .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 -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 -Get-License -search SomeLicense +Get-SnipeItLicense -search SomeLicense .EXAMPLE -Get-License -id 1 +Get-SnipeItLicense -id 1 #> -function Get-License() { +function Get-SnipeItLicense() { Param( [string]$search, - [string]$id, + [int]$id, [string]$name, @@ -79,6 +79,8 @@ function Get-License() { [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $apiurl = "$url/api/v1/licenses" @@ -106,7 +108,7 @@ function Get-License() { while ($true) { $callargs['offset'] = $offstart $callargs['limit'] = $limit - $res=Get-License @callargs + $res=Get-SnipeItLicense @callargs $res if ($res.count -lt $limit) { break diff --git a/SnipeitPS/Public/Get-SnipeItLicenseSeat.ps1 b/SnipeitPS/Public/Get-SnipeItLicenseSeat.ps1 new file mode 100644 index 0000000..5eef03a --- /dev/null +++ b/SnipeitPS/Public/Get-SnipeItLicenseSeat.ps1 @@ -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 + } +} + diff --git a/SnipeitPS/Public/Get-SnipeitLocation.ps1 b/SnipeitPS/Public/Get-SnipeItLocation.ps1 similarity index 84% rename from SnipeitPS/Public/Get-SnipeitLocation.ps1 rename to SnipeitPS/Public/Get-SnipeItLocation.ps1 index db9276e..718e251 100644 --- a/SnipeitPS/Public/Get-SnipeitLocation.ps1 +++ b/SnipeitPS/Public/Get-SnipeItLocation.ps1 @@ -18,16 +18,16 @@ Offset to use A return all results, works with -offset and other parameters .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 -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 -Get-Location -search Location1 +Get-SnipeItLocation -search Location1 .EXAMPLE -Get-Location -id 3 +Get-SnipeItLocation -id 3 #> @@ -36,7 +36,7 @@ function Get-SnipeitLocation() Param( [string]$search, - [string]$id, + [int]$id, [ValidateSet("asc", "desc")] [string]$order = "desc", @@ -54,6 +54,8 @@ function Get-SnipeitLocation() [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $apiurl = "$url/api/v1/locations" diff --git a/SnipeitPS/Public/Get-Manufacturer.ps1 b/SnipeitPS/Public/Get-SnipeItManufacturer.ps1 similarity index 81% rename from SnipeitPS/Public/Get-Manufacturer.ps1 rename to SnipeitPS/Public/Get-SnipeItManufacturer.ps1 index 9ddc1f1..36bcb61 100644 --- a/SnipeitPS/Public/Get-Manufacturer.ps1 +++ b/SnipeitPS/Public/Get-SnipeItManufacturer.ps1 @@ -18,27 +18,27 @@ Offset to use A return all results, works with -offset and other parameters .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 -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 -Get-Manufacturer -search HP +Get-SnipeItManufacturer -search HP Search all manufacturers for string HP .EXAMPLE -Get-Manufacturer -id 3 +Get-SnipeItManufacturer -id 3 Returns manufacturer with id 3 #> -function Get-Manufacturer() +function Get-SnipeItManufacturer() { Param( [string]$search, - [string]$id, + [int]$id, [ValidateSet("asc", "desc")] [string]$order = "desc", @@ -56,6 +56,8 @@ function Get-Manufacturer() [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $apiurl = "$url/api/v1/manufacturers" @@ -83,7 +85,7 @@ function Get-Manufacturer() while ($true) { $callargs['offset'] = $offstart $callargs['limit'] = $limit - $res=Get-Manufacturer @callargs + $res=Get-SnipeItManufacturer @callargs $res if ($res.count -lt $limit) { break diff --git a/SnipeitPS/Public/Get-Model.ps1 b/SnipeitPS/Public/Get-SnipeItModel.ps1 similarity index 82% rename from SnipeitPS/Public/Get-Model.ps1 rename to SnipeitPS/Public/Get-SnipeItModel.ps1 index 0df4b34..7219657 100644 --- a/SnipeitPS/Public/Get-Model.ps1 +++ b/SnipeitPS/Public/Get-SnipeItModel.ps1 @@ -18,20 +18,20 @@ Offset to use A return all results, works with -offset and other parameters .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 -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 -Get-Model -search "DL380" +Get-SnipeItModel -search "DL380" .EXAMPLE -Get-Model -id 1 +Get-SnipeItModel -id 1 #> -function Get-Model() +function Get-SnipeItModel() { Param( [string]$search, @@ -54,6 +54,8 @@ function Get-Model() [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $apiurl = "$url/api/v1/models" @@ -81,7 +83,7 @@ function Get-Model() while ($true) { $callargs['offset'] = $offstart $callargs['limit'] = $limit - $res=Get-Model @callargs + $res=Get-SnipeItModel @callargs $res if ($res.count -ne $limit ) { break diff --git a/SnipeitPS/Public/Get-Status.ps1 b/SnipeitPS/Public/Get-SnipeItStatus.ps1 similarity index 81% rename from SnipeitPS/Public/Get-Status.ps1 rename to SnipeitPS/Public/Get-SnipeItStatus.ps1 index 63fb4ca..ebeb50b 100644 --- a/SnipeitPS/Public/Get-Status.ps1 +++ b/SnipeitPS/Public/Get-SnipeItStatus.ps1 @@ -18,25 +18,25 @@ Offset to use A return all results, works with -offset and other parameters .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 -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 -Get-Status -search "Ready to Deploy" +Get-SnipeItStatus -search "Ready to Deploy" .EXAMPLE -Get-Status -id 3 +Get-SnipeItStatus -id 3 #> -function Get-Status() +function Get-SnipeItStatus() { Param( [string]$search, - [string]$id, + [int]$id, [ValidateSet("asc", "desc")] [string]$order = "desc", @@ -54,6 +54,8 @@ function Get-Status() [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $apiurl = "$url/api/v1/statuslabels" @@ -81,7 +83,7 @@ function Get-Status() while ($true) { $callargs['offset'] = $offstart $callargs['limit'] = $limit - $res=Get-Status @callargs + $res=Get-SnipeItStatus @callargs $res if ($res.count -lt $limit) { break diff --git a/SnipeitPS/Public/Get-Supplier.ps1 b/SnipeitPS/Public/Get-SnipeItSupplier.ps1 similarity index 81% rename from SnipeitPS/Public/Get-Supplier.ps1 rename to SnipeitPS/Public/Get-SnipeItSupplier.ps1 index 5cf5245..d5c84fe 100644 --- a/SnipeitPS/Public/Get-Supplier.ps1 +++ b/SnipeitPS/Public/Get-SnipeItSupplier.ps1 @@ -18,25 +18,25 @@ Offset to use A return all results, works with -offset and other parameters .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 -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 -Get-Supplier -search MySupplier +Get-SnipeItSupplier -search MySupplier .EXAMPLE -Get-Supplier -id 2 +Get-SnipeItSupplier -id 2 #> -function Get-Supplier() +function Get-SnipeItSupplier() { Param( [string]$search, - [string]$id, + [int]$id, [ValidateSet("asc", "desc")] [string]$order = "desc", @@ -54,6 +54,8 @@ function Get-Supplier() [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $apiurl = "$url/api/v1/suppliers" @@ -81,7 +83,7 @@ function Get-Supplier() while ($true) { $callargs['offset'] = $offstart $callargs['limit'] = $limit - $res=Get-Supplier @callargs + $res=Get-SnipeItSupplier @callargs $res if ($res.count -lt $limit) { break diff --git a/SnipeitPS/Public/Get-User.ps1 b/SnipeitPS/Public/Get-SnipeItUser.ps1 similarity index 81% rename from SnipeitPS/Public/Get-User.ps1 rename to SnipeitPS/Public/Get-SnipeItUser.ps1 index 859c48a..9f02830 100644 --- a/SnipeitPS/Public/Get-User.ps1 +++ b/SnipeitPS/Public/Get-SnipeItUser.ps1 @@ -24,25 +24,25 @@ Offset to use A return all results, works with -offset and other parameters .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 -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 -Get-User -search SomeSurname +Get-SnipeItUser -search SomeSurname .EXAMPLE -Get-User -id 3 +Get-SnipeItUser -id 3 .EXAMPLE -Get-User -username someuser +Get-SnipeItUser -username someuser .EXAMPLE -Get-User -email user@somedomain.com +Get-SnipeItUser -email user@somedomain.com #> -function Get-User() { +function Get-SnipeItUser() { Param( [string]$search, @@ -76,6 +76,8 @@ function Get-User() { [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $SearchParameter = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $apiurl = "$url/api/v1/users" @@ -102,7 +104,7 @@ function Get-User() { while ($true) { $callargs['offset'] = $offstart $callargs['limit'] = $limit - $res=Get-User @callargs + $res=Get-SnipeItUser @callargs $res if ($res.count -lt $limit) { break diff --git a/SnipeitPS/Public/New-Accessory.ps1 b/SnipeitPS/Public/New-SnipeItAccessory.ps1 similarity index 87% rename from SnipeitPS/Public/New-Accessory.ps1 rename to SnipeitPS/Public/New-SnipeItAccessory.ps1 index 22fdd96..493f628 100644 --- a/SnipeitPS/Public/New-Accessory.ps1 +++ b/SnipeitPS/Public/New-SnipeItAccessory.ps1 @@ -48,16 +48,16 @@ ID number of the location the accessory is assigned to Min quantity of the accessory before alert is triggered .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 -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 -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( SupportsShouldProcess = $true, ConfirmImpact = "Low" @@ -102,6 +102,8 @@ function New-Accessory() { [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters if ($values['purchase_date']) { diff --git a/SnipeitPS/Public/New-Asset.ps1 b/SnipeitPS/Public/New-SnipeItAsset.ps1 similarity index 84% rename from SnipeitPS/Public/New-Asset.ps1 rename to SnipeitPS/Public/New-SnipeItAsset.ps1 index d86a32f..9db73ec 100644 --- a/SnipeitPS/Public/New-Asset.ps1 +++ b/SnipeitPS/Public/New-SnipeItAsset.ps1 @@ -43,29 +43,29 @@ Optional Purchase cost of the Asset Optional Default location id for the asset .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 -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 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. .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 .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 .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. #> -function New-Asset() +function New-SnipeItAsset() { [CmdletBinding( SupportsShouldProcess = $true, @@ -123,6 +123,8 @@ function New-Asset() [hashtable] $customfields ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters diff --git a/SnipeitPS/Public/New-AssetMaintenance.ps1 b/SnipeitPS/Public/New-SnipeItAssetMaintenance.ps1 similarity index 83% rename from SnipeitPS/Public/New-AssetMaintenance.ps1 rename to SnipeitPS/Public/New-SnipeItAssetMaintenance.ps1 index 8c66445..0f37fd2 100644 --- a/SnipeitPS/Public/New-AssetMaintenance.ps1 +++ b/SnipeitPS/Public/New-SnipeItAssetMaintenance.ps1 @@ -31,15 +31,15 @@ Optional completion date Optional cost .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 -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 -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( SupportsShouldProcess = $true, ConfirmImpact = "Low" @@ -77,6 +77,8 @@ function New-AssetMaintenance() { [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters if ($values['start_date']) { diff --git a/SnipeitPS/Public/New-Audit.ps1 b/SnipeitPS/Public/New-SnipeItAudit.ps1 similarity index 81% rename from SnipeitPS/Public/New-Audit.ps1 rename to SnipeitPS/Public/New-SnipeItAudit.ps1 index 94824d3..985979e 100644 --- a/SnipeitPS/Public/New-Audit.ps1 +++ b/SnipeitPS/Public/New-SnipeItAudit.ps1 @@ -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 .EXAMPLE -New-Audit -tag 1 -location_id 1 +New-SnipeItAudit -tag 1 -location_id 1 #> -function New-Audit() +function New-SnipeItAudit() { [CmdletBinding( SupportsShouldProcess = $true, @@ -37,6 +37,8 @@ function New-Audit() ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $Values = @{ "location_id" = $location_id } diff --git a/SnipeitPS/Public/New-Category.ps1 b/SnipeitPS/Public/New-SnipeItCategory.ps1 similarity index 82% rename from SnipeitPS/Public/New-Category.ps1 rename to SnipeitPS/Public/New-SnipeItCategory.ps1 index f5e8c27..16a9c75 100644 --- a/SnipeitPS/Public/New-Category.ps1 +++ b/SnipeitPS/Public/New-SnipeItCategory.ps1 @@ -9,10 +9,10 @@ Name of new category to be created Type of new category to be created (asset, accessory, consumable, component, license) .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 -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 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 .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( SupportsShouldProcess = $true, @@ -55,6 +55,8 @@ function New-Category() [switch]$checkin_email ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $Values = @{ "name" = $name "category_type" = $category_type diff --git a/SnipeitPS/Public/New-Company.ps1 b/SnipeitPS/Public/New-SnipeItCompany.ps1 similarity index 73% rename from SnipeitPS/Public/New-Company.ps1 rename to SnipeitPS/Public/New-SnipeItCompany.ps1 index 3d0b669..c479aeb 100644 --- a/SnipeitPS/Public/New-Company.ps1 +++ b/SnipeitPS/Public/New-SnipeItCompany.ps1 @@ -9,17 +9,17 @@ Creates new company on Snipe-It system Comapany name .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 -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 -New-Company -name "Acme Company" +New-SnipeItCompany -name "Acme Company" #> -function New-Company() +function New-SnipeItCompany() { [CmdletBinding( SupportsShouldProcess = $true, @@ -37,6 +37,8 @@ function New-Company() [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $Body = $Values | ConvertTo-Json; diff --git a/SnipeitPS/Public/New-Component.ps1 b/SnipeitPS/Public/New-SnipeItComponent.ps1 similarity index 84% rename from SnipeitPS/Public/New-Component.ps1 rename to SnipeitPS/Public/New-SnipeItComponent.ps1 index 4504de6..a846332 100644 --- a/SnipeitPS/Public/New-Component.ps1 +++ b/SnipeitPS/Public/New-SnipeItComponent.ps1 @@ -24,10 +24,10 @@ Date accessory was purchased Cost of item being purchased. .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 -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 An example @@ -36,7 +36,7 @@ An example General notes #> -function New-Component() { +function New-SnipeItComponent() { [CmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = "Low" @@ -67,6 +67,8 @@ function New-Component() { [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters if ($values['purchase_date']) { diff --git a/SnipeitPS/Public/New-CustomField.ps1 b/SnipeitPS/Public/New-SnipeItCustomField.ps1 similarity index 73% rename from SnipeitPS/Public/New-CustomField.ps1 rename to SnipeitPS/Public/New-SnipeItCustomField.ps1 index 13557ad..d4b2d55 100644 --- a/SnipeitPS/Public/New-CustomField.ps1 +++ b/SnipeitPS/Public/New-SnipeItCustomField.ps1 @@ -9,16 +9,16 @@ Name of the Custom Field .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 - 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 - 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( SupportsShouldProcess = $true, @@ -46,6 +46,8 @@ function New-CustomField() [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters #Convert Values to JSON format diff --git a/SnipeitPS/Public/New-Department.ps1 b/SnipeitPS/Public/New-SnipeItDepartment.ps1 similarity index 75% rename from SnipeitPS/Public/New-Department.ps1 rename to SnipeitPS/Public/New-SnipeItDepartment.ps1 index 800b3d8..d6141cd 100644 --- a/SnipeitPS/Public/New-Department.ps1 +++ b/SnipeitPS/Public/New-SnipeItDepartment.ps1 @@ -18,17 +18,17 @@ ID number of manager .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 - 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 - 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( SupportsShouldProcess = $true, ConfirmImpact = "Low" @@ -53,6 +53,8 @@ function New-Department() { [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $Body = $Values | ConvertTo-Json; diff --git a/SnipeitPS/Public/New-License.ps1 b/SnipeitPS/Public/New-SnipeItLicense.ps1 similarity index 89% rename from SnipeitPS/Public/New-License.ps1 rename to SnipeitPS/Public/New-SnipeItLicense.ps1 index fb38435..ecfc9df 100644 --- a/SnipeitPS/Public/New-License.ps1 +++ b/SnipeitPS/Public/New-SnipeItLicense.ps1 @@ -57,17 +57,17 @@ Termination date for license. .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 - 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 - 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( SupportsShouldProcess = $true, ConfirmImpact = "Low" @@ -124,6 +124,8 @@ function New-License() { [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters if ($values['expiration_date']) { diff --git a/SnipeitPS/Public/New-Location.ps1 b/SnipeitPS/Public/New-SnipeItLocation.ps1 similarity index 81% rename from SnipeitPS/Public/New-Location.ps1 rename to SnipeitPS/Public/New-SnipeItLocation.ps1 index d15cc93..f3ecd6e 100644 --- a/SnipeitPS/Public/New-Location.ps1 +++ b/SnipeitPS/Public/New-SnipeItLocation.ps1 @@ -36,16 +36,16 @@ The manager ID of the location .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 - 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 - 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( SupportsShouldProcess = $true, ConfirmImpact = "Low" @@ -78,6 +78,8 @@ function New-Location() { [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $Body = $Values | ConvertTo-Json; diff --git a/SnipeitPS/Public/New-Manufacturer.ps1 b/SnipeitPS/Public/New-SnipeItManufacturer.ps1 similarity index 74% rename from SnipeitPS/Public/New-Manufacturer.ps1 rename to SnipeitPS/Public/New-SnipeItManufacturer.ps1 index d85ee18..c7c1f69 100644 --- a/SnipeitPS/Public/New-Manufacturer.ps1 +++ b/SnipeitPS/Public/New-SnipeItManufacturer.ps1 @@ -9,16 +9,16 @@ Name of the Manufacturer .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 - 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 - New-Manufacturer -name "HP" + New-SnipeItManufacturer -name "HP" #> -function New-Manufacturer() +function New-SnipeItManufacturer() { [CmdletBinding( SupportsShouldProcess = $true, @@ -36,6 +36,7 @@ function New-Manufacturer() [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name $Values = @{ "name" = $Name diff --git a/SnipeitPS/Public/New-Model.ps1 b/SnipeitPS/Public/New-SnipeItModel.ps1 similarity index 83% rename from SnipeitPS/Public/New-Model.ps1 rename to SnipeitPS/Public/New-SnipeItModel.ps1 index 87f0fad..603e052 100644 --- a/SnipeitPS/Public/New-Model.ps1 +++ b/SnipeitPS/Public/New-SnipeItModel.ps1 @@ -21,16 +21,16 @@ Fieldset ID that the asset uses (Custom fields) .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 - 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 - 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( SupportsShouldProcess = $true, @@ -61,6 +61,8 @@ function New-Model() [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $Values = @{ name = $name category_id = $category_id diff --git a/SnipeitPS/Public/New-User.ps1 b/SnipeitPS/Public/New-SnipeItUser.ps1 similarity index 84% rename from SnipeitPS/Public/New-User.ps1 rename to SnipeitPS/Public/New-SnipeItUser.ps1 index 4630f06..2dbac25 100644 --- a/SnipeitPS/Public/New-User.ps1 +++ b/SnipeitPS/Public/New-SnipeItUser.ps1 @@ -48,19 +48,19 @@ Mark user as import from ldap .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 - 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 - 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 .NOTES General notes #> -function New-User() { +function New-SnipeItUser() { [CmdletBinding( SupportsShouldProcess = $true, @@ -109,6 +109,8 @@ function New-User() { [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters if ($password ) { diff --git a/SnipeitPS/Public/Remove-Asset.ps1 b/SnipeitPS/Public/Remove-SnipeItAsset.ps1 similarity index 64% rename from SnipeitPS/Public/Remove-Asset.ps1 rename to SnipeitPS/Public/Remove-SnipeItAsset.ps1 index 095cd0d..3fe5f53 100644 --- a/SnipeitPS/Public/Remove-Asset.ps1 +++ b/SnipeitPS/Public/Remove-SnipeItAsset.ps1 @@ -1,21 +1,21 @@ <# .SYNOPSIS - Removes Asset to Snipe-it asset system + Removes Asset from Snipe-it asset system .DESCRIPTION - Long description + Removes Asset from Snipe-it asset system .PARAMETER ID Unique ID For Asset to be removed .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 - 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 - Remove-Asset -ID 44 -Verbose + Remove-SnipeItAsset -ID 44 -Verbose #> -function Remove-Asset () +function Remove-SnipeItAsset () { [CmdletBinding( SupportsShouldProcess = $true, @@ -24,7 +24,7 @@ function Remove-Asset () Param( [parameter(mandatory = $true)] - [string]$ID, + [int]$ID, [parameter(mandatory = $true)] [string]$URL, [parameter(mandatory = $true)] @@ -32,6 +32,8 @@ function Remove-Asset () ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $Values = @{ "ID" = $Name } diff --git a/SnipeitPS/Public/Remove-AssetMaintenance.ps1 b/SnipeitPS/Public/Remove-SnipeItAssetMaintenance.ps1 similarity index 70% rename from SnipeitPS/Public/Remove-AssetMaintenance.ps1 rename to SnipeitPS/Public/Remove-SnipeItAssetMaintenance.ps1 index 655269b..e64c941 100644 --- a/SnipeitPS/Public/Remove-AssetMaintenance.ps1 +++ b/SnipeitPS/Public/Remove-SnipeItAssetMaintenance.ps1 @@ -1,4 +1,4 @@ -function Remove-AssetMaintenance { +function Remove-SnipeItAssetMaintenance { <# .SYNOPSIS Remove asset maintenance from Snipe-it asset system @@ -7,13 +7,13 @@ function Remove-AssetMaintenance { .PARAMETER ID Unique ID of the asset maintenance to be removed .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 - 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 - Remove-AssetMaintenance -ID 44 -url $url -apiKey $secret -Verbose + Remove-SnipeItAssetMaintenance -ID 44 -url $url -apiKey $secret -Verbose #> [CmdletBinding( SupportsShouldProcess = $true, @@ -22,7 +22,7 @@ function Remove-AssetMaintenance { param ( # Asset maintenance ID [Parameter(Mandatory = $true)] - [string] + [int] $ID, # SnipeIt URL @@ -36,6 +36,8 @@ function Remove-AssetMaintenance { $apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $Values = @{ "ID" = $ID } diff --git a/SnipeitPS/Public/Remove-User.ps1 b/SnipeitPS/Public/Remove-SnipeItUser.ps1 similarity index 71% rename from SnipeitPS/Public/Remove-User.ps1 rename to SnipeitPS/Public/Remove-SnipeItUser.ps1 index 4d5c7b1..b6f64cf 100644 --- a/SnipeitPS/Public/Remove-User.ps1 +++ b/SnipeitPS/Public/Remove-SnipeItUser.ps1 @@ -7,16 +7,16 @@ Unique ID For User to be removed .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 - 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 - 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( SupportsShouldProcess = $true, @@ -33,6 +33,8 @@ function Remove-User () ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $Values = @{ "ID" = $ID } diff --git a/SnipeitPS/Public/Reset-AssetOwner.ps1 b/SnipeitPS/Public/Reset-SnipeItAssetOwner.ps1 similarity index 78% rename from SnipeitPS/Public/Reset-AssetOwner.ps1 rename to SnipeitPS/Public/Reset-SnipeItAssetOwner.ps1 index beecfcf..235942a 100644 --- a/SnipeitPS/Public/Reset-AssetOwner.ps1 +++ b/SnipeitPS/Public/Reset-SnipeItAssetOwner.ps1 @@ -17,15 +17,15 @@ Notes about checkin .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 - 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 - 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( SupportsShouldProcess = $true, ConfirmImpact = "Medium" @@ -48,6 +48,8 @@ function Reset-AssetOwner() { [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $Values = @{ "notes" = $notes } diff --git a/SnipeitPS/Public/Set-Accessory.ps1 b/SnipeitPS/Public/Set-SnipeItAccessory.ps1 similarity index 87% rename from SnipeitPS/Public/Set-Accessory.ps1 rename to SnipeitPS/Public/Set-SnipeItAccessory.ps1 index 298a0c9..668092e 100644 --- a/SnipeitPS/Public/Set-Accessory.ps1 +++ b/SnipeitPS/Public/Set-SnipeItAccessory.ps1 @@ -48,16 +48,16 @@ ID number of the location the accessory is assigned to Min quantity of the accessory before alert is triggered .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 -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 -Set-Accessory -id 1 -qty 3 +Set-SnipeItAccessory -id 1 -qty 3 #> -function Set-Accessory() { +function Set-SnipeItAccessory() { [CmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = "Low" @@ -99,6 +99,8 @@ function Set-Accessory() { [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters if ($values['purchase_date']) { diff --git a/SnipeitPS/Public/Set-Asset.ps1 b/SnipeitPS/Public/Set-SnipeItAsset.ps1 similarity index 85% rename from SnipeitPS/Public/Set-Asset.ps1 rename to SnipeitPS/Public/Set-SnipeItAsset.ps1 index df45913..fb3d6cf 100644 --- a/SnipeitPS/Public/Set-Asset.ps1 +++ b/SnipeitPS/Public/Set-SnipeItAsset.ps1 @@ -51,22 +51,22 @@ The id that corresponds to the location where the asset is usually located when not checked out .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 - 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 Hastable of custom fields and extra fields that need passing through to Snipeit .EXAMPLE - Set-Asset -id 1 -status_id 1 -model_id 1 -name "Machine1" + Set-SnipeItAsset -id 1 -status_id 1 -model_id 1 -name "Machine1" .EXAMPLE - Set-Asset -id 1 -status_id 1 -model_id 1 -name "Machine1" -CustomValues = @{ "_snipeit_os_5 = "Windows 10 Pro" } + 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( SupportsShouldProcess = $true, @@ -114,6 +114,8 @@ function Set-Asset() [hashtable] $customfields ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters if ($model_id) { $Values.Add('model_id',$model_id)} diff --git a/SnipeitPS/Public/Set-AssetOwner.ps1 b/SnipeitPS/Public/Set-SnipeItAssetOwner.ps1 similarity index 85% rename from SnipeitPS/Public/Set-AssetOwner.ps1 rename to SnipeitPS/Public/Set-SnipeItAssetOwner.ps1 index 15b5284..55193f6 100644 --- a/SnipeitPS/Public/Set-AssetOwner.ps1 +++ b/SnipeitPS/Public/Set-SnipeItAssetOwner.ps1 @@ -25,15 +25,15 @@ Optional date to override the checkout time of now .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 - 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 - 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( SupportsShouldProcess = $true, @@ -65,6 +65,8 @@ function Set-AssetOwner() [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters if ($Values['expected_checkin']) { diff --git a/SnipeitPS/Public/Set-Components.ps1 b/SnipeitPS/Public/Set-SnipeItComponents.ps1 similarity index 84% rename from SnipeitPS/Public/Set-Components.ps1 rename to SnipeitPS/Public/Set-SnipeItComponents.ps1 index 15eaf72..03da9ad 100644 --- a/SnipeitPS/Public/Set-Components.ps1 +++ b/SnipeitPS/Public/Set-SnipeItComponents.ps1 @@ -27,10 +27,10 @@ Date accessory was purchased Cost of item being purchased. .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 -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 An example @@ -38,7 +38,7 @@ An example .NOTES General notes #> -function Set-Component() +function Set-SnipeItComponent() { [CmdletBinding( SupportsShouldProcess = $true, @@ -69,6 +69,8 @@ function Set-Component() [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters if ($values['purchase_date']) { diff --git a/SnipeitPS/Public/Set-Info.ps1 b/SnipeitPS/Public/Set-SnipeItInfo.ps1 similarity index 81% rename from SnipeitPS/Public/Set-Info.ps1 rename to SnipeitPS/Public/Set-SnipeItInfo.ps1 index 79e348d..33fcf03 100644 --- a/SnipeitPS/Public/Set-Info.ps1 +++ b/SnipeitPS/Public/Set-SnipeItInfo.ps1 @@ -5,15 +5,15 @@ Set apikey and url user to connect Snipe-It system .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 - 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 - Set-Info -url $url -apiKey -Verbose + Set-SnipeItInfo -url $url -apiKey -Verbose #> -function Set-Info { +function Set-SnipeItInfo { [CmdletBinding()] [System.Diagnostics.CodeAnalysis.SuppressMessage('PSUseShouldProcessForStateChangingFunctions', '')] param ( @@ -23,7 +23,7 @@ function Set-Info { ) BEGIN { - + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name function Add-DefaultParameter { param( [Parameter(Mandatory = $true)] @@ -43,10 +43,11 @@ function Set-Info { # http://stackoverflow.com/questions/30427110/set-psdefaultparametersvalues-for-use-within-module-scope $PSDefaultParameterValues["${command}:${parameter}"] = $Value $global:PSDefaultParameterValues["${command}:${parameter}"] = $Value + } } - $moduleCommands = Get-Command -Module SnipeitPS + $moduleCommands = Get-Command -Module SnipeitPS -CommandType Function } PROCESS { diff --git a/SnipeitPS/Public/Set-License.ps1 b/SnipeitPS/Public/Set-SnipeItLicense.ps1 similarity index 88% rename from SnipeitPS/Public/Set-License.ps1 rename to SnipeitPS/Public/Set-SnipeItLicense.ps1 index 52d92b0..3e8dc5e 100644 --- a/SnipeitPS/Public/Set-License.ps1 +++ b/SnipeitPS/Public/Set-SnipeItLicense.ps1 @@ -60,17 +60,17 @@ Termination date for license. .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 - 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 - 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( SupportsShouldProcess = $true, ConfirmImpact = "Low" @@ -129,7 +129,9 @@ function Set-License() { [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']) { $values['expiration_date'] = $values['expiration_date'].ToString("yyyy-MM-dd") diff --git a/SnipeitPS/Public/Set-SnipeItLicenseSeat.ps1 b/SnipeitPS/Public/Set-SnipeItLicenseSeat.ps1 new file mode 100644 index 0000000..3f8c7e8 --- /dev/null +++ b/SnipeitPS/Public/Set-SnipeItLicenseSeat.ps1 @@ -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 +} diff --git a/SnipeitPS/Public/Set-SnipeitLocation.ps1 b/SnipeitPS/Public/Set-SnipeItLocation.ps1 similarity index 86% rename from SnipeitPS/Public/Set-SnipeitLocation.ps1 rename to SnipeitPS/Public/Set-SnipeItLocation.ps1 index e517d07..bc3b2f8 100644 --- a/SnipeitPS/Public/Set-SnipeitLocation.ps1 +++ b/SnipeitPS/Public/Set-SnipeItLocation.ps1 @@ -36,10 +36,10 @@ Parent location as id .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 - 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 Set-SnipeitLocation -id 123 -name "Some storage" -parent_id 100 @@ -82,6 +82,8 @@ function Set-SnipeitLocation() { [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $Body = $Values | ConvertTo-Json; diff --git a/SnipeitPS/Public/Set-Model.ps1 b/SnipeitPS/Public/Set-SnipeItModel.ps1 similarity index 81% rename from SnipeitPS/Public/Set-Model.ps1 rename to SnipeitPS/Public/Set-SnipeItModel.ps1 index 0020c1a..f2c7051 100644 --- a/SnipeitPS/Public/Set-Model.ps1 +++ b/SnipeitPS/Public/Set-SnipeItModel.ps1 @@ -24,16 +24,16 @@ Fieldset ID that the asset uses (Custom fields) .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 - 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 - 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( SupportsShouldProcess = $true, ConfirmImpact = "Medium" @@ -66,6 +66,8 @@ function Set-Model() { [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $Body = $Values | ConvertTo-Json; diff --git a/SnipeitPS/Public/Set-User.ps1 b/SnipeitPS/Public/Set-SnipeItUser.ps1 similarity index 82% rename from SnipeitPS/Public/Set-User.ps1 rename to SnipeitPS/Public/Set-SnipeItUser.ps1 index f609733..38738a9 100644 --- a/SnipeitPS/Public/Set-User.ps1 +++ b/SnipeitPS/Public/Set-SnipeItUser.ps1 @@ -48,19 +48,19 @@ Mark user as import from ldap .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 - 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 - 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 .NOTES General notes #> -function Set-User() { +function Set-SnipeItUser() { [CmdletBinding( SupportsShouldProcess = $true, @@ -104,6 +104,8 @@ function Set-User() { [string]$apiKey ) + Test-SnipeItAlias -invocationName $MyInvocation.InvocationName -commandName $MyInvocation.MyCommand.Name + $Values = . Get-ParameterValue $MyInvocation.MyCommand.Parameters $Body = $Values | ConvertTo-Json; diff --git a/SnipeitPS/Public/Update-SnipeItAlias.ps1 b/SnipeitPS/Public/Update-SnipeItAlias.ps1 new file mode 100644 index 0000000..7869b34 --- /dev/null +++ b/SnipeitPS/Public/Update-SnipeItAlias.ps1 @@ -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" + } + + + +} diff --git a/SnipeitPS/SnipeItPS.psd1 b/SnipeitPS/SnipeItPS.psd1 index 86c49ce..0f7a1e0 100644 Binary files a/SnipeitPS/SnipeItPS.psd1 and b/SnipeitPS/SnipeItPS.psd1 differ diff --git a/SnipeitPS/SnipeItPS.psm1 b/SnipeitPS/SnipeItPS.psm1 index 3450cae..e85ba63 100644 --- a/SnipeitPS/SnipeItPS.psm1 +++ b/SnipeitPS/SnipeItPS.psm1 @@ -1,3 +1,7 @@ +<# +.DESCRIPTION +Powershell API for SnipeIt Asset Management +#> $scriptRoot = $PSScriptRoot + '\Public' Get-ChildItem $scriptRoot *.ps1 | ForEach-Object { @@ -9,3 +13,44 @@ $scriptRoot = $PSScriptRoot + '\Private' Get-ChildItem $scriptRoot *.ps1 | ForEach-Object { 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 diff --git a/appveyor.yml b/appveyor.yml index b5df4ce..f0d02fd 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,7 +14,7 @@ environment: PSGalleryAPIKey: secure: UdM6qhf5B0G8liHhUrwWERCZr44iSqmg4jUq0lwlTjZs4KyeoiwnBzdej0phqIAm -version: 1.1.{build} +version: 1.2.{build} # Don't rebuild when I tag a release on GitHub skip_tags: true diff --git a/docs/Get-Accessory.md b/docs/Get-SnipeItAccessory.md similarity index 91% rename from docs/Get-Accessory.md rename to docs/Get-SnipeItAccessory.md index bba1853..259521f 100644 --- a/docs/Get-Accessory.md +++ b/docs/Get-SnipeItAccessory.md @@ -1,11 +1,11 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# Get-Accessory +# Get-SnipeItAccessory ## SYNOPSIS Gets a list of Snipe-it Accessories @@ -13,7 +13,7 @@ Gets a list of Snipe-it Accessories ## SYNTAX ``` -Get-Accessory [[-search] ] [[-company_id] ] [[-category_id] ] +Get-SnipeItAccessory [[-search] ] [[-company_id] ] [[-category_id] ] [[-manufacturer_id] ] [[-supplier_id] ] [[-sort] ] [[-order] ] [[-limit] ] [[-offset] ] [-all] [-url] [-apiKey] [] ``` @@ -25,12 +25,12 @@ Gets a list of Snipe-it Accessories ### EXAMPLE 1 ``` -Get-Accessory -search Keyboard +Get-SnipeItAccessory -search Keyboard ``` ### EXAMPLE 2 ``` -Get-Accessory -id 1 +Get-SnipeItAccessory -id 1 ``` ## PARAMETERS @@ -51,7 +51,7 @@ Accept wildcard characters: False ``` ### -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 @@ -203,7 +203,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/Get-Asset.md b/docs/Get-SnipeItAsset.md similarity index 90% rename from docs/Get-Asset.md rename to docs/Get-SnipeItAsset.md index c723fed..7828560 100644 --- a/docs/Get-Asset.md +++ b/docs/Get-SnipeItAsset.md @@ -1,11 +1,11 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# Get-Asset +# Get-SnipeItAsset ## SYNOPSIS 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 ``` -Get-Asset [[-search] ] [[-id] ] [[-asset_tag] ] [[-asset_serial] ] +Get-SnipeItAsset [[-search] ] [[-id] ] [[-asset_tag] ] [[-asset_serial] ] [[-order_number] ] [[-model_id] ] [[-category_id] ] [[-manufacturer_id] ] [[-company_id] ] [[-location_id] ] [[-depreciation_id] ] [[-requestable] ] [[-status] ] [[-status_id] ] [[-sort] ] [[-order] ] [[-limit] ] @@ -27,22 +27,22 @@ Get-Asset [[-search] ] [[-id] ] [[-asset_tag] ] [[-asset ### EXAMPLE 1 ``` -Get-Asset -url "https://assets.example.com"-token "token..." +Get-SnipeItAsset -url "https://assets.example.com"-token "token..." ``` ### 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 ``` -Get-Asset -search "myMachine"-url "https://assets.example.com"-token "token..." +Get-SnipeItAsset -search "myMachine"-url "https://assets.example.com"-token "token..." ``` ### 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 @@ -63,7 +63,7 @@ Accept wildcard characters: False ``` ### -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 @@ -156,13 +156,13 @@ Accept wildcard characters: False ID number of excact snipeit asset ```yaml -Type: String +Type: Int32 Parameter Sets: (All) Aliases: Required: False Position: 2 -Default value: None +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` @@ -350,7 +350,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/Get-AssetMaintenance.md b/docs/Get-SnipeItAssetMaintenance.md similarity index 83% rename from docs/Get-AssetMaintenance.md rename to docs/Get-SnipeItAssetMaintenance.md index 9a45aca..f2a4a63 100644 --- a/docs/Get-AssetMaintenance.md +++ b/docs/Get-SnipeItAssetMaintenance.md @@ -1,11 +1,11 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# Get-AssetMaintenance +# Get-SnipeItAssetMaintenance ## SYNOPSIS Lists Snipe-it Assets Maintenances @@ -13,7 +13,7 @@ Lists Snipe-it Assets Maintenances ## SYNTAX ``` -Get-AssetMaintenance [[-search] ] [[-asset_id] ] [[-sort] ] [[-order] ] +Get-SnipeItAssetMaintenance [[-search] ] [[-asset_id] ] [[-sort] ] [[-order] ] [[-limit] ] [-all] [[-offset] ] [-url] [-apiKey] [] ``` @@ -24,17 +24,17 @@ Get-AssetMaintenance [[-search] ] [[-asset_id] ] [[-sort] ] [[-id] ] [[-order] ] [[-limit] ] [[-offset] ] - [-all] [-url] [-apiKey] [] +Get-SnipeItCategory [[-search] ] [[-id] ] [[-order] ] [[-limit] ] + [[-offset] ] [-all] [-url] [-apiKey] [] ``` ## DESCRIPTION @@ -24,12 +24,12 @@ Get-Category [[-search] ] [[-id] ] [[-order] ] [[-limit] ### EXAMPLE 1 ``` -Get-Category -id 1 +Get-SnipeItCategory -id 1 ``` ### EXAMPLE 2 ``` -Get-Category -search "Laptop" +Get-SnipeItCategory -search "Laptop" ``` ## PARAMETERS @@ -50,7 +50,7 @@ Accept wildcard characters: False ``` ### -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 @@ -68,13 +68,13 @@ Accept wildcard characters: False A id of specific Category ```yaml -Type: String +Type: Int32 Parameter Sets: (All) Aliases: Required: False Position: 2 -Default value: None +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` @@ -142,7 +142,7 @@ Accept wildcard characters: False ``` ### -url -Url of Snipeit system, can be set using Set-Info command +Url of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/Get-Company.md b/docs/Get-SnipeItCompany.md similarity index 85% rename from docs/Get-Company.md rename to docs/Get-SnipeItCompany.md index 1ed64b8..e7f9d6b 100644 --- a/docs/Get-Company.md +++ b/docs/Get-SnipeItCompany.md @@ -1,11 +1,11 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# Get-Company +# Get-SnipeItCompany ## SYNOPSIS Gets a list of Snipe-it Companies @@ -13,8 +13,8 @@ Gets a list of Snipe-it Companies ## SYNTAX ``` -Get-Company [[-search] ] [[-id] ] [[-order] ] [[-limit] ] [[-offset] ] - [-all] [-url] [-apiKey] [] +Get-SnipeItCompany [[-search] ] [[-id] ] [[-order] ] [[-limit] ] + [[-offset] ] [-all] [-url] [-apiKey] [] ``` ## DESCRIPTION @@ -24,14 +24,14 @@ Get-Company [[-search] ] [[-id] ] [[-order] ] [[-limit] ### EXAMPLE 1 ``` -Get-Company +Get-SnipeItCompany ``` Gets all companies ### EXAMPLE 2 ``` -Get-Company -id 1 +Get-SnipeItCompany -id 1 ``` Gets specific company @@ -54,7 +54,7 @@ Accept wildcard characters: False ``` ### -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 @@ -72,13 +72,13 @@ Accept wildcard characters: False A id of specific Company ```yaml -Type: String +Type: Int32 Parameter Sets: (All) Aliases: Required: False Position: 2 -Default value: None +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` @@ -146,7 +146,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/Get-Component.md b/docs/Get-SnipeItComponent.md similarity index 90% rename from docs/Get-Component.md rename to docs/Get-SnipeItComponent.md index 16badb9..1e8405a 100644 --- a/docs/Get-Component.md +++ b/docs/Get-SnipeItComponent.md @@ -1,11 +1,11 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# Get-Component +# Get-SnipeItComponent ## SYNOPSIS Gets a list of Snipe-it Components @@ -13,7 +13,7 @@ Gets a list of Snipe-it Components ## SYNTAX ``` -Get-Component [[-search] ] [[-id] ] [[-category_id] ] [[-company_id] ] +Get-SnipeItComponent [[-search] ] [[-id] ] [[-category_id] ] [[-company_id] ] [[-location_id] ] [[-order] ] [[-sort] ] [[-limit] ] [[-offset] ] [-all] [-url] [-apiKey] [] ``` @@ -25,21 +25,21 @@ Get-Component [[-search] ] [[-id] ] [[-category_id] ] [[- ### EXAMPLE 1 ``` -Get-Component +Get-SnipeItComponent ``` Returns all components ### EXAMPLE 2 ``` -Get-Component -search display +Get-SnipeItComponent -search display ``` Returns search results containeing string display ### EXAMPLE 3 ``` -Get-Component -id +Get-SnipeItComponent -id ``` Returns specific component @@ -62,7 +62,7 @@ Accept wildcard characters: False ``` ### -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 @@ -110,13 +110,13 @@ Accept wildcard characters: False A id of specific Component ```yaml -Type: String +Type: Int32 Parameter Sets: (All) Aliases: Required: False Position: 2 -Default value: None +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` @@ -214,7 +214,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system,can be set using Set-Info command +URL of Snipeit system,can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/Get-Fieldset.md b/docs/Get-SnipeItCustomField.md similarity index 62% rename from docs/Get-Fieldset.md rename to docs/Get-SnipeItCustomField.md index 8f7a118..b5d284b 100644 --- a/docs/Get-Fieldset.md +++ b/docs/Get-SnipeItCustomField.md @@ -1,19 +1,19 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# Get-Fieldset +# Get-SnipeItCustomField ## SYNOPSIS -Gets a list of Snipe-it Fieldsets +Returns specific Snipe-IT custom field or a list of all custom field ## SYNTAX ``` -Get-Fieldset [-url] [-apiKey] [] +Get-SnipeItCustomField [[-id] ] [-url] [-apiKey] [] ``` ## DESCRIPTION @@ -23,18 +23,43 @@ Get-Fieldset [-url] [-apiKey] [] ### EXAMPLE 1 ``` -Get-Fieldset -url "https://assets.example.com" -token "token..." -``` - -### EXAMPLE 2 -``` -Get-Fieldset -url "https://assets.example.com" -token "token..." | Where-Object {$_.name -eq "Windows" } +Get-SnipeItCustomField -url "https://assets.example.com" -token "token..." ``` ## PARAMETERS ### -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 Type: String @@ -48,21 +73,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -url -URL of Snipeit system, can be set using Set-Info command - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -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). diff --git a/docs/Get-Department.md b/docs/Get-SnipeItDepartment.md similarity index 82% rename from docs/Get-Department.md rename to docs/Get-SnipeItDepartment.md index 7059601..1572f9f 100644 --- a/docs/Get-Department.md +++ b/docs/Get-SnipeItDepartment.md @@ -1,11 +1,11 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# Get-Department +# Get-SnipeItDepartment ## SYNOPSIS Gets a list of Snipe-it Departments @@ -13,8 +13,8 @@ Gets a list of Snipe-it Departments ## SYNTAX ``` -Get-Department [[-search] ] [[-id] ] [[-order] ] [[-limit] ] [[-offset] ] - [-all] [[-sort] ] [-url] [-apiKey] [] +Get-SnipeItDepartment [[-search] ] [[-id] ] [[-order] ] [[-limit] ] + [[-offset] ] [-all] [[-sort] ] [-url] [-apiKey] [] ``` ## DESCRIPTION @@ -24,17 +24,17 @@ Get-Department [[-search] ] [[-id] ] [[-order] ] [[-limi ### EXAMPLE 1 ``` -Get-Department -url "https://assets.example.com" -token "token..." +Get-SnipeItDepartment -url "https://assets.example.com" -token "token..." ``` ### EXAMPLE 2 ``` -Get-Department -search Department1 +Get-SnipeItDepartment -search Department1 ``` ### EXAMPLE 3 ``` -Get-Department -id 1 +Get-SnipeItDepartment -id 1 ``` ## PARAMETERS @@ -55,7 +55,7 @@ Accept wildcard characters: False ``` ### -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 @@ -73,13 +73,13 @@ Accept wildcard characters: False A id of specific Department ```yaml -Type: String +Type: Int32 Parameter Sets: (All) Aliases: Required: False Position: 2 -Default value: None +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` @@ -162,7 +162,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/Get-CustomField.md b/docs/Get-SnipeItFieldset.md similarity index 57% rename from docs/Get-CustomField.md rename to docs/Get-SnipeItFieldset.md index a62a30a..e5e17aa 100644 --- a/docs/Get-CustomField.md +++ b/docs/Get-SnipeItFieldset.md @@ -1,19 +1,19 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# Get-CustomField +# Get-SnipeItFieldset ## SYNOPSIS -Returns a list of all Snipe-IT custom fields +Returns a fieldset or list of Snipe-it Fieldsets ## SYNTAX ``` -Get-CustomField [-url] [-apiKey] [] +Get-SnipeItFieldset [[-id] ] [-url] [-apiKey] [] ``` ## DESCRIPTION @@ -23,13 +23,48 @@ Get-CustomField [-url] [-apiKey] [] ### 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 ### -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 Type: String @@ -43,21 +78,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -url -URL of Snipeit system, can be set using Set-Info command - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -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). diff --git a/docs/Get-SnipeItLicense.md b/docs/Get-SnipeItLicense.md new file mode 100644 index 0000000..7be41ae --- /dev/null +++ b/docs/Get-SnipeItLicense.md @@ -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] ] [[-id] ] [[-name] ] [[-company_id] ] + [[-product_key] ] [[-order_number] ] [[-purchase_order] ] [[-license_name] ] + [[-license_email] ] [[-manufacturer_id] ] [[-supplier_id] ] + [[-depreciation_id] ] [[-category_id] ] [[-order] ] [[-sort] ] + [[-limit] ] [[-offset] ] [-all] [-url] [-apiKey] [] +``` + +## 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 diff --git a/docs/Get-SnipeItLicenseSeat.md b/docs/Get-SnipeItLicenseSeat.md new file mode 100644 index 0000000..cc81450 --- /dev/null +++ b/docs/Get-SnipeItLicenseSeat.md @@ -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] [[-seat_id] ] [[-limit] ] [[-offset] ] [-all] + [-url] [-apiKey] [] +``` + +## 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 diff --git a/docs/Get-Manufacturer.md b/docs/Get-SnipeItManufacturer.md similarity index 87% rename from docs/Get-Manufacturer.md rename to docs/Get-SnipeItManufacturer.md index b1006bf..de28bf0 100644 --- a/docs/Get-Manufacturer.md +++ b/docs/Get-SnipeItManufacturer.md @@ -5,7 +5,7 @@ online version: schema: 2.0.0 --- -# Get-Manufacturer +# Get-SnipeItManufacturer ## SYNOPSIS # Gets a list of Snipe-it Manufacturers @@ -13,7 +13,7 @@ schema: 2.0.0 ## SYNTAX ``` -Get-Manufacturer [[-search] ] [[-id] ] [[-order] ] [[-limit] ] +Get-SnipeItManufacturer [[-search] ] [[-id] ] [[-order] ] [[-limit] ] [[-offset] ] [-all] [-url] [-apiKey] [] ``` @@ -24,14 +24,14 @@ Get-Manufacturer [[-search] ] [[-id] ] [[-order] ] [[-li ### EXAMPLE 1 ``` -Get-Manufacturer -search HP +Get-SnipeItManufacturer -search HP ``` Search all manufacturers for string HP ### EXAMPLE 2 ``` -Get-Manufacturer -id 3 +Get-SnipeItManufacturer -id 3 ``` Returns manufacturer with id 3 @@ -54,7 +54,7 @@ Accept wildcard characters: False ``` ### -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 @@ -72,13 +72,13 @@ Accept wildcard characters: False A id of specific Manufactuter ```yaml -Type: String +Type: Int32 Parameter Sets: (All) Aliases: Required: False Position: 2 -Default value: None +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` @@ -146,7 +146,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/Get-Model.md b/docs/Get-SnipeItModel.md similarity index 85% rename from docs/Get-Model.md rename to docs/Get-SnipeItModel.md index a3ad1ea..6c74880 100644 --- a/docs/Get-Model.md +++ b/docs/Get-SnipeItModel.md @@ -1,11 +1,11 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# Get-Model +# Get-SnipeItModel ## SYNOPSIS Gets a list of Snipe-it Models @@ -13,8 +13,8 @@ Gets a list of Snipe-it Models ## SYNTAX ``` -Get-Model [[-search] ] [[-id] ] [[-order] ] [[-limit] ] [[-offset] ] - [-all] [-url] [-apiKey] [] +Get-SnipeItModel [[-search] ] [[-id] ] [[-order] ] [[-limit] ] + [[-offset] ] [-all] [-url] [-apiKey] [] ``` ## DESCRIPTION @@ -24,12 +24,12 @@ Get-Model [[-search] ] [[-id] ] [[-order] ] [[-limit] ] [[-id] ] [[-order] ] [[-limit] ] [[-offset] ] - [-all] [-url] [-apiKey] [] +Get-SnipeItStatus [[-search] ] [[-id] ] [[-order] ] [[-limit] ] + [[-offset] ] [-all] [-url] [-apiKey] [] ``` ## DESCRIPTION @@ -24,12 +24,12 @@ Get-Status [[-search] ] [[-id] ] [[-order] ] [[-limit] < ### EXAMPLE 1 ``` -Get-Status -search "Ready to Deploy" +Get-SnipeItStatus -search "Ready to Deploy" ``` ### EXAMPLE 2 ``` -Get-Status -id 3 +Get-SnipeItStatus -id 3 ``` ## PARAMETERS @@ -50,7 +50,7 @@ Accept wildcard characters: False ``` ### -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 @@ -68,13 +68,13 @@ Accept wildcard characters: False A id of specific Status Label ```yaml -Type: String +Type: Int32 Parameter Sets: (All) Aliases: Required: False Position: 2 -Default value: None +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` @@ -142,7 +142,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/Get-Supplier.md b/docs/Get-SnipeItSupplier.md similarity index 84% rename from docs/Get-Supplier.md rename to docs/Get-SnipeItSupplier.md index 2996b85..0413493 100644 --- a/docs/Get-Supplier.md +++ b/docs/Get-SnipeItSupplier.md @@ -5,7 +5,7 @@ online version: schema: 2.0.0 --- -# Get-Supplier +# Get-SnipeItSupplier ## SYNOPSIS # Gets a list of Snipe-it Suppliers @@ -13,8 +13,8 @@ schema: 2.0.0 ## SYNTAX ``` -Get-Supplier [[-search] ] [[-id] ] [[-order] ] [[-limit] ] [[-offset] ] - [-all] [-url] [-apiKey] [] +Get-SnipeItSupplier [[-search] ] [[-id] ] [[-order] ] [[-limit] ] + [[-offset] ] [-all] [-url] [-apiKey] [] ``` ## DESCRIPTION @@ -24,12 +24,12 @@ Get-Supplier [[-search] ] [[-id] ] [[-order] ] [[-limit] ### EXAMPLE 1 ``` -Get-Supplier -search MySupplier +Get-SnipeItSupplier -search MySupplier ``` ### EXAMPLE 2 ``` -Get-Supplier -id 2 +Get-SnipeItSupplier -id 2 ``` ## PARAMETERS @@ -50,7 +50,7 @@ Accept wildcard characters: False ``` ### -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 @@ -68,13 +68,13 @@ Accept wildcard characters: False A id of specific Suplier ```yaml -Type: String +Type: Int32 Parameter Sets: (All) Aliases: Required: False Position: 2 -Default value: None +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` @@ -142,7 +142,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/Get-User.md b/docs/Get-SnipeItUser.md similarity index 91% rename from docs/Get-User.md rename to docs/Get-SnipeItUser.md index 61cf14e..7d643f4 100644 --- a/docs/Get-User.md +++ b/docs/Get-SnipeItUser.md @@ -5,7 +5,7 @@ online version: schema: 2.0.0 --- -# Get-User +# Get-SnipeItUser ## SYNOPSIS # Gets a list of Snipe-it Users @@ -13,7 +13,7 @@ schema: 2.0.0 ## SYNTAX ``` -Get-User [[-search] ] [[-id] ] [[-company_id] ] [[-location_id] ] +Get-SnipeItUser [[-search] ] [[-id] ] [[-company_id] ] [[-location_id] ] [[-group_id] ] [[-department_id] ] [[-username] ] [[-email] ] [[-order] ] [[-limit] ] [[-offset] ] [-all] [-url] [-apiKey] [] @@ -26,22 +26,22 @@ Get-User [[-search] ] [[-id] ] [[-company_id] ] [[-locati ### EXAMPLE 1 ``` -Get-User -search SomeSurname +Get-SnipeItUser -search SomeSurname ``` ### EXAMPLE 2 ``` -Get-User -id 3 +Get-SnipeItUser -id 3 ``` ### EXAMPLE 3 ``` -Get-User -username someuser +Get-SnipeItUser -username someuser ``` ### EXAMPLE 4 ``` -Get-User -email user@somedomain.com +Get-SnipeItUser -email user@somedomain.com ``` ## PARAMETERS @@ -62,7 +62,7 @@ Accept wildcard characters: False ``` ### -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 @@ -229,7 +229,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/Get-SnipeitLocation.md b/docs/Get-SnipeitLocation.md index f99db67..2c7ed5b 100644 --- a/docs/Get-SnipeitLocation.md +++ b/docs/Get-SnipeitLocation.md @@ -1,4 +1,4 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: @@ -13,7 +13,7 @@ Gets a list of Snipe-it Locations ## SYNTAX ``` -Get-SnipeitLocation [[-search] ] [[-id] ] [[-order] ] [[-limit] ] +Get-SnipeitLocation [[-search] ] [[-id] ] [[-order] ] [[-limit] ] [[-offset] ] [-all] [-url] [-apiKey] [] ``` @@ -24,12 +24,12 @@ Get-SnipeitLocation [[-search] ] [[-id] ] [[-order] ] [[ ### EXAMPLE 1 ``` -Get-Location -search Location1 +Get-SnipeItLocation -search Location1 ``` ### EXAMPLE 2 ``` -Get-Location -id 3 +Get-SnipeItLocation -id 3 ``` ## PARAMETERS @@ -50,7 +50,7 @@ Accept wildcard characters: False ``` ### -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 @@ -68,13 +68,13 @@ Accept wildcard characters: False A id of specific Location ```yaml -Type: String +Type: Int32 Parameter Sets: (All) Aliases: Required: False Position: 2 -Default value: None +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` @@ -142,7 +142,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfoeItInfo command ```yaml Type: String diff --git a/docs/New-Asset.md b/docs/New-SnipeItAsset.md similarity index 91% rename from docs/New-Asset.md rename to docs/New-SnipeItAsset.md index f06a49c..d4057f8 100644 --- a/docs/New-Asset.md +++ b/docs/New-SnipeItAsset.md @@ -1,11 +1,11 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# New-Asset +# New-SnipeItAsset ## SYNOPSIS Add a new Asset to Snipe-it asset system @@ -13,7 +13,7 @@ Add a new Asset to Snipe-it asset system ## SYNTAX ``` -New-Asset [-status_id] [-model_id] [[-name] ] [[-asset_tag] ] +New-SnipeItAsset [-status_id] [-model_id] [[-name] ] [[-asset_tag] ] [[-serial] ] [[-company_id] ] [[-order_number] ] [[-notes] ] [[-warranty_months] ] [[-purchase_cost] ] [[-purchase_date] ] [[-supplier_id] ] [[-rtd_location_id] ] [-url] [-apiKey] [[-customfields] ] [-WhatIf] @@ -27,21 +27,21 @@ Long description ### 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 ### 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 ### 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. @@ -49,7 +49,7 @@ Using customfields when creating asset. ## PARAMETERS ### -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 @@ -260,7 +260,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/New-AssetMaintenance.md b/docs/New-SnipeItAssetMaintenance.md similarity index 90% rename from docs/New-AssetMaintenance.md rename to docs/New-SnipeItAssetMaintenance.md index 72782c8..f49bac6 100644 --- a/docs/New-AssetMaintenance.md +++ b/docs/New-SnipeItAssetMaintenance.md @@ -1,11 +1,11 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# New-AssetMaintenance +# New-SnipeItAssetMaintenance ## SYNOPSIS 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 ``` -New-AssetMaintenance [-asset_id] [-supplier_id] [-asset_maintenance_type] +New-SnipeItAssetMaintenance [-asset_id] [-supplier_id] [-asset_maintenance_type] [-title] [-start_date] [[-completion_date] ] [[-is_warranty] ] [[-cost] ] [[-notes] ] [-url] [-apiKey] [-WhatIf] [-Confirm] [] @@ -26,13 +26,13 @@ Long description ### 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 ### -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 @@ -182,7 +182,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/New-Category.md b/docs/New-SnipeItCategory.md similarity index 85% rename from docs/New-Category.md rename to docs/New-SnipeItCategory.md index 140e5f6..2d058df 100644 --- a/docs/New-Category.md +++ b/docs/New-SnipeItCategory.md @@ -1,11 +1,11 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# New-Category +# New-SnipeItCategory ## SYNOPSIS Create a new Snipe-IT Category @@ -13,8 +13,8 @@ Create a new Snipe-IT Category ## SYNTAX ``` -New-Category [-name] [-category_type] [-url] [-apiKey] [-use_default_eula] - [-require_acceptance] [-checkin_email] [-WhatIf] [-Confirm] [] +New-SnipeItCategory [-name] [-category_type] [-url] [-apiKey] + [-use_default_eula] [-require_acceptance] [-checkin_email] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -24,13 +24,13 @@ New-Category [-name] [-category_type] [-url] [-apiKey ### 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 ### -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 Type: String @@ -105,7 +105,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/New-Component.md b/docs/New-SnipeItComponent.md similarity index 92% rename from docs/New-Component.md rename to docs/New-SnipeItComponent.md index a3d6a17..2292692 100644 --- a/docs/New-Component.md +++ b/docs/New-SnipeItComponent.md @@ -1,11 +1,11 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# New-Component +# New-SnipeItComponent ## SYNOPSIS Create a new component @@ -13,7 +13,7 @@ Create a new component ## SYNTAX ``` -New-Component [-name] [-category_id] [-qty] [[-company_id] ] +New-SnipeItComponent [-name] [-category_id] [-qty] [[-company_id] ] [[-location_id] ] [[-purchase_date] ] [[-purchase_cost] ] [-url] [-apiKey] [-WhatIf] [-Confirm] [] ``` @@ -31,7 +31,7 @@ An example ## PARAMETERS ### -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 Type: String @@ -151,7 +151,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/New-CustomField.md b/docs/New-SnipeItCustomField.md similarity index 88% rename from docs/New-CustomField.md rename to docs/New-SnipeItCustomField.md index fc035e2..b411e55 100644 --- a/docs/New-CustomField.md +++ b/docs/New-SnipeItCustomField.md @@ -1,11 +1,11 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# New-CustomField +# New-SnipeItCustomField ## SYNOPSIS 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 ``` -New-CustomField [-Name] [[-HelpText] ] [[-Element] ] [[-Format] ] +New-SnipeItCustomField [-Name] [[-HelpText] ] [[-Element] ] [[-Format] ] [[-field_encrypted] ] [[-CustomFormat] ] [-url] [-apiKey] [-WhatIf] [-Confirm] [] ``` @@ -25,13 +25,13 @@ Add a new Custom Field to Snipe-it asset system ### 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 ### -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 @@ -136,7 +136,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/New-Department.md b/docs/New-SnipeItDepartment.md similarity index 87% rename from docs/New-Department.md rename to docs/New-SnipeItDepartment.md index fdf1cf4..d582ff6 100644 --- a/docs/New-Department.md +++ b/docs/New-SnipeItDepartment.md @@ -1,11 +1,11 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# New-Department +# New-SnipeItDepartment ## SYNOPSIS Creates a department @@ -13,7 +13,7 @@ Creates a department ## SYNTAX ``` -New-Department [-name] [[-company_id] ] [[-location_id] ] [[-manager_id] ] +New-SnipeItDepartment [-name] [[-company_id] ] [[-location_id] ] [[-manager_id] ] [[-notes] ] [-url] [-apiKey] [-WhatIf] [-Confirm] [] ``` @@ -24,13 +24,13 @@ Creates a new department on Snipe-It system ### 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 ### -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 @@ -120,7 +120,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/New-License.md b/docs/New-SnipeItLicense.md similarity index 94% rename from docs/New-License.md rename to docs/New-SnipeItLicense.md index 5e8c316..8de15ba 100644 --- a/docs/New-License.md +++ b/docs/New-SnipeItLicense.md @@ -1,11 +1,11 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# New-License +# New-SnipeItLicense ## SYNOPSIS Creates a licence @@ -13,7 +13,7 @@ Creates a licence ## SYNTAX ``` -New-License [-name] [-seats] [[-category_id] ] [[-company_id] ] +New-SnipeItLicense [-name] [-seats] [[-category_id] ] [[-company_id] ] [[-expiration_date] ] [[-license_email] ] [[-license_name] ] [[-maintained] ] [[-manufacturer_id] ] [[-notes] ] [[-order_number] ] [[-purchase_cost] ] [[-purchase_date] ] [[-reassignable] ] [[-serial] ] @@ -28,13 +28,13 @@ Creates a new licence on Snipe-It system ### EXAMPLE 1 ``` -New-Licence -name "License" -seats 3 -company_id 1 +New-SnipeItLicence -name "License" -seats 3 -company_id 1 ``` ## PARAMETERS ### -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 @@ -304,7 +304,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/New-Location.md b/docs/New-SnipeItLocation.md similarity index 91% rename from docs/New-Location.md rename to docs/New-SnipeItLocation.md index 64ad41d..d2c35e9 100644 --- a/docs/New-Location.md +++ b/docs/New-SnipeItLocation.md @@ -1,11 +1,11 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# New-Location +# New-SnipeItLocation ## SYNOPSIS Add a new Location to Snipe-it asset system @@ -13,7 +13,7 @@ Add a new Location to Snipe-it asset system ## SYNTAX ``` -New-Location [-name] [[-address] ] [[-address2] ] [[-state] ] +New-SnipeItLocation [-name] [[-address] ] [[-address2] ] [[-state] ] [[-country] ] [[-zip] ] [[-parent_id] ] [[-manager_id] ] [[-ldap_ou] ] [-url] [-apiKey] [-WhatIf] [-Confirm] [] ``` @@ -25,7 +25,7 @@ Long description ### 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 @@ -61,7 +61,7 @@ Accept wildcard characters: False ``` ### -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 @@ -166,7 +166,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/New-Manufacturer.md b/docs/New-SnipeItManufacturer.md similarity index 84% rename from docs/New-Manufacturer.md rename to docs/New-SnipeItManufacturer.md index 5d61fbd..dc9236d 100644 --- a/docs/New-Manufacturer.md +++ b/docs/New-SnipeItManufacturer.md @@ -1,11 +1,11 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# New-Manufacturer +# New-SnipeItManufacturer ## SYNOPSIS Add a new Manufacturer to Snipe-it asset system @@ -13,7 +13,8 @@ Add a new Manufacturer to Snipe-it asset system ## SYNTAX ``` -New-Manufacturer [-Name] [-url] [-apiKey] [-WhatIf] [-Confirm] [] +New-SnipeItManufacturer [-Name] [-url] [-apiKey] [-WhatIf] [-Confirm] + [] ``` ## DESCRIPTION @@ -23,13 +24,13 @@ Long description ### EXAMPLE 1 ``` -New-Manufacturer -name "HP" +New-SnipeItManufacturer -name "HP" ``` ## PARAMETERS ### -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 @@ -59,7 +60,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/New-Model.md b/docs/New-SnipeItModel.md similarity index 89% rename from docs/New-Model.md rename to docs/New-SnipeItModel.md index 18e13d8..24d2ecc 100644 --- a/docs/New-Model.md +++ b/docs/New-SnipeItModel.md @@ -1,11 +1,11 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# New-Model +# New-SnipeItModel ## SYNOPSIS Add a new Model to Snipe-it asset system @@ -13,7 +13,7 @@ Add a new Model to Snipe-it asset system ## SYNTAX ``` -New-Model [-name] [[-model_number] ] [-category_id] [-manufacturer_id] +New-SnipeItModel [-name] [[-model_number] ] [-category_id] [-manufacturer_id] [[-eol] ] [-fieldset_id] [-url] [-apiKey] [-WhatIf] [-Confirm] [] ``` @@ -25,13 +25,13 @@ Long description ### 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 ### -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 @@ -136,7 +136,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/New-User.md b/docs/New-SnipeItUser.md similarity index 92% rename from docs/New-User.md rename to docs/New-SnipeItUser.md index 520d221..dd563e9 100644 --- a/docs/New-User.md +++ b/docs/New-SnipeItUser.md @@ -5,7 +5,7 @@ online version: schema: 2.0.0 --- -# New-User +# New-SnipeItUser ## SYNOPSIS Creates a new user @@ -13,7 +13,7 @@ Creates a new user ## SYNTAX ``` -New-User [-first_name] [-last_name] [-username] [[-password] ] +New-SnipeItUser [-first_name] [-last_name] [-username] [[-password] ] [[-activated] ] [[-notes] ] [[-jobtitle] ] [[-email] ] [[-phone] ] [[-company_id] ] [[-location_id] ] [[-department_id] ] [[-manager_id] ] [[-employee_num] ] [[-ldap_import] ] [-url] [-apiKey] [-WhatIf] [-Confirm] @@ -27,7 +27,7 @@ Creates a new user to Snipe-IT system ### 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 @@ -50,7 +50,7 @@ Accept wildcard characters: False ``` ### -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 Type: String @@ -130,7 +130,7 @@ Users first name ```yaml Type: String Parameter Sets: (All) -Aliases: firstName +Aliases: Required: True Position: 1 @@ -160,7 +160,7 @@ Users last name ```yaml Type: String Parameter Sets: (All) -Aliases: lastName +Aliases: Required: True Position: 2 @@ -175,7 +175,7 @@ Mark user as import from ldap ```yaml Type: Boolean Parameter Sets: (All) -Aliases: ldap_user +Aliases: Required: False Position: 15 @@ -260,7 +260,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/Remove-Asset.md b/docs/Remove-SnipeItAsset.md similarity index 79% rename from docs/Remove-Asset.md rename to docs/Remove-SnipeItAsset.md index 4e9c4fd..a79edcc 100644 --- a/docs/Remove-Asset.md +++ b/docs/Remove-SnipeItAsset.md @@ -1,35 +1,35 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# Remove-Asset +# Remove-SnipeItAsset ## SYNOPSIS -Removes Asset to Snipe-it asset system +Removes Asset from Snipe-it asset system ## SYNTAX ``` -Remove-Asset [-ID] [-URL] [-APIKey] [-WhatIf] [-Confirm] [] +Remove-SnipeItAsset [-ID] [-URL] [-APIKey] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION -Long description +Removes Asset from Snipe-it asset system ## EXAMPLES ### EXAMPLE 1 ``` -Remove-Asset -ID 44 -Verbose +Remove-SnipeItAsset -ID 44 -Verbose ``` ## PARAMETERS ### -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 Type: String @@ -47,19 +47,19 @@ Accept wildcard characters: False Unique ID For Asset to be removed ```yaml -Type: String +Type: Int32 Parameter Sets: (All) Aliases: Required: True Position: 1 -Default value: None +Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` ### -URL -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/Remove-User.md b/docs/Remove-SnipeItUser.md similarity index 83% rename from docs/Remove-User.md rename to docs/Remove-SnipeItUser.md index 5e28ac0..22d52a1 100644 --- a/docs/Remove-User.md +++ b/docs/Remove-SnipeItUser.md @@ -1,11 +1,11 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# Remove-User +# Remove-SnipeItUser ## SYNOPSIS Removes User from Snipe-it asset system @@ -13,7 +13,7 @@ Removes User from Snipe-it asset system ## SYNTAX ``` -Remove-User [-ID] [-URL] [-APIKey] [-WhatIf] [-Confirm] [] +Remove-SnipeItUser [-ID] [-URL] [-APIKey] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -23,13 +23,13 @@ Long description ### EXAMPLE 1 ``` -Remove-User -ID 44 -url $url -apiKey $secret -Verbose +Remove-SnipeItUser -ID 44 -url $url -apiKey $secret -Verbose ``` ## PARAMETERS ### -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 Type: String @@ -59,7 +59,7 @@ Accept wildcard characters: False ``` ### -URL -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/Set-Accessory.md b/docs/Set-SnipeItAccessory.md similarity index 93% rename from docs/Set-Accessory.md rename to docs/Set-SnipeItAccessory.md index 1a6353e..3b10b76 100644 --- a/docs/Set-Accessory.md +++ b/docs/Set-SnipeItAccessory.md @@ -1,11 +1,11 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# Set-Accessory +# Set-SnipeItAccessory ## SYNOPSIS Updates accessory on Snipe-It system @@ -13,7 +13,7 @@ Updates accessory on Snipe-It system ## SYNTAX ``` -Set-Accessory [-id] [[-name] ] [[-qty] ] [[-category_id] ] +Set-SnipeItAccessory [-id] [[-name] ] [[-qty] ] [[-category_id] ] [[-company_id] ] [[-manufacturer_id] ] [[-order_number] ] [[-purchase_cost] ] [[-purchase_date] ] [[-min_qty] ] [[-supplier_id] ] [-url] [-apiKey] [-WhatIf] [-Confirm] [] @@ -26,13 +26,13 @@ Updates accessory on Snipe-It system ### EXAMPLE 1 ``` -Set-Accessory -id 1 -qty 3 +Set-SnipeItAccessory -id 1 -qty 3 ``` ## PARAMETERS ### -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 Type: String @@ -212,7 +212,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfoeItInfo command ```yaml Type: String diff --git a/docs/Set-Asset.md b/docs/Set-SnipeItAsset.md similarity index 92% rename from docs/Set-Asset.md rename to docs/Set-SnipeItAsset.md index 056d650..d199e77 100644 --- a/docs/Set-Asset.md +++ b/docs/Set-SnipeItAsset.md @@ -1,11 +1,11 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# Set-Asset +# Set-SnipeItAsset ## SYNOPSIS 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 ``` -Set-Asset [-id] [[-Name] ] [[-Status_id] ] [[-Model_id] ] +Set-SnipeItAsset [-id] [[-Name] ] [[-Status_id] ] [[-Model_id] ] [[-last_checkout] ] [[-assigned_to] ] [[-company_id] ] [[-serial] ] [[-order_number] ] [[-warranty_months] ] [[-purchase_cost] ] [[-purchase_date] ] [[-requestable] ] [[-archived] ] [[-rtd_location_id] ] @@ -27,18 +27,18 @@ Long description ### 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 ``` -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 ### -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 Type: String @@ -279,7 +279,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfoeItInfo command ```yaml Type: String diff --git a/docs/Set-AssetOwner.md b/docs/Set-SnipeItAssetOwner.md similarity index 90% rename from docs/Set-AssetOwner.md rename to docs/Set-SnipeItAssetOwner.md index a67e54a..3b87adb 100644 --- a/docs/Set-AssetOwner.md +++ b/docs/Set-SnipeItAssetOwner.md @@ -1,11 +1,11 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# Set-AssetOwner +# Set-SnipeItAssetOwner ## SYNOPSIS Checkout asset @@ -13,7 +13,7 @@ Checkout asset ## SYNTAX ``` -Set-AssetOwner [-id] [-assigned_id] [[-checkout_to_type] ] [[-name] ] +Set-SnipeItAssetOwner [-id] [-assigned_id] [[-checkout_to_type] ] [[-name] ] [[-note] ] [[-expected_checkin] ] [[-checkout_at] ] [-url] [-apiKey] [-WhatIf] [-Confirm] [] ``` @@ -25,13 +25,13 @@ Checkout asset to user/localtion/asset ### 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 ### -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 Type: String @@ -154,7 +154,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/Set-Component.md b/docs/Set-SnipeItComponent.md similarity index 92% rename from docs/Set-Component.md rename to docs/Set-SnipeItComponent.md index 21ec356..13aeb56 100644 --- a/docs/Set-Component.md +++ b/docs/Set-SnipeItComponent.md @@ -1,11 +1,11 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# Set-Component +# Set-SnipeItComponent ## SYNOPSIS Updates component @@ -13,7 +13,7 @@ Updates component ## SYNTAX ``` -Set-Component [-id] [-qty] [[-name] ] [[-company_id] ] +Set-SnipeItComponent [-id] [-qty] [[-name] ] [[-company_id] ] [[-location_id] ] [[-purchase_date] ] [[-purchase_cost] ] [-url] [-apiKey] [-WhatIf] [-Confirm] [] ``` @@ -31,7 +31,7 @@ An example ## PARAMETERS ### -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 Type: String @@ -151,7 +151,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/Set-Info.md b/docs/Set-SnipeItInfo.md similarity index 78% rename from docs/Set-Info.md rename to docs/Set-SnipeItInfo.md index 514c5dd..5af19dd 100644 --- a/docs/Set-Info.md +++ b/docs/Set-SnipeItInfo.md @@ -1,11 +1,11 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# Set-Info +# Set-SnipeItInfo ## SYNOPSIS Sets authetication information @@ -13,7 +13,7 @@ Sets authetication information ## SYNTAX ``` -Set-Info [[-url] ] [[-apiKey] ] [] +Set-SnipeItInfo [[-url] ] [[-apiKey] ] [] ``` ## DESCRIPTION @@ -23,13 +23,13 @@ Set apikey and url user to connect Snipe-It system ### EXAMPLE 1 ``` -Set-Info -url $url -apiKey -Verbose +Set-SnipeItInfo -url $url -apiKey -Verbose ``` ## PARAMETERS ### -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 Type: String @@ -44,7 +44,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: Uri diff --git a/docs/Set-License.md b/docs/Set-SnipeItLicense.md similarity index 94% rename from docs/Set-License.md rename to docs/Set-SnipeItLicense.md index 95fc2a2..8dfa8cc 100644 --- a/docs/Set-License.md +++ b/docs/Set-SnipeItLicense.md @@ -1,11 +1,11 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# Set-License +# Set-SnipeItLicense ## SYNOPSIS Updates a licence @@ -13,7 +13,7 @@ Updates a licence ## SYNTAX ``` -Set-License [-id] [[-name] ] [[-seats] ] [[-category_id] ] +Set-SnipeItLicense [-id] [[-name] ] [[-seats] ] [[-category_id] ] [[-company_id] ] [[-expiration_date] ] [[-license_email] ] [[-license_name] ] [[-maintained] ] [[-manufacturer_id] ] [[-notes] ] [[-order_number] ] [[-purchase_cost] ] [[-purchase_date] ] @@ -28,13 +28,13 @@ Updates licence on Snipe-It system ### EXAMPLE 1 ``` -Set-Licence -name "License" -seats 3 -company_id 1 +Set-SnipeItLicence -name "License" -seats 3 -company_id 1 ``` ## PARAMETERS ### -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 @@ -319,7 +319,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/Set-SnipeItLicenseSeat.md b/docs/Set-SnipeItLicenseSeat.md new file mode 100644 index 0000000..0bbca1a --- /dev/null +++ b/docs/Set-SnipeItLicenseSeat.md @@ -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] [-seat_id] [[-assigned_id] ] [[-asset_id] ] + [[-note] ] [-url] [-apiKey] [-WhatIf] [-Confirm] [] +``` + +## 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 diff --git a/docs/Set-Model.md b/docs/Set-SnipeItModel.md similarity index 90% rename from docs/Set-Model.md rename to docs/Set-SnipeItModel.md index 2e9df08..816f4e0 100644 --- a/docs/Set-Model.md +++ b/docs/Set-SnipeItModel.md @@ -1,11 +1,11 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# Set-Model +# Set-SnipeItModel ## SYNOPSIS Updates Model on Snipe-it asset system @@ -13,7 +13,7 @@ Updates Model on Snipe-it asset system ## SYNTAX ``` -Set-Model [-id] [[-name] ] [[-model_number] ] [[-category_id] ] +Set-SnipeItModel [-id] [[-name] ] [[-model_number] ] [[-category_id] ] [[-manufacturer_id] ] [[-eol] ] [[-custom_fieldset_id] ] [-url] [-apiKey] [-WhatIf] [-Confirm] [] ``` @@ -25,13 +25,13 @@ Updates Model on Snipe-it asset system ### 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 ### -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 @@ -151,7 +151,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/Set-User.md b/docs/Set-SnipeItUser.md similarity index 92% rename from docs/Set-User.md rename to docs/Set-SnipeItUser.md index edc4d23..1b2f9e1 100644 --- a/docs/Set-User.md +++ b/docs/Set-SnipeItUser.md @@ -1,11 +1,11 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: schema: 2.0.0 --- -# Set-User +# Set-SnipeItUser ## SYNOPSIS Creates a new user @@ -13,7 +13,7 @@ Creates a new user ## SYNTAX ``` -Set-User [-id] [[-first_name] ] [[-last_name] ] [[-userName] ] +Set-SnipeItUser [-id] [[-first_name] ] [[-last_name] ] [[-userName] ] [[-jobtitle] ] [[-email] ] [[-phone] ] [[-company_id] ] [[-location_id] ] [[-department_id] ] [[-manager_id] ] [[-employee_num] ] [[-activated] ] [[-notes] ] [-url] [-apiKey] [-WhatIf] [-Confirm] @@ -27,7 +27,7 @@ Creates a new user to Snipe-IT system ### 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 @@ -50,7 +50,7 @@ Accept wildcard characters: False ``` ### -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 Type: String @@ -245,7 +245,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/Set-SnipeitLocation.md b/docs/Set-SnipeitLocation.md index b06b2f4..8c9a0da 100644 --- a/docs/Set-SnipeitLocation.md +++ b/docs/Set-SnipeitLocation.md @@ -1,4 +1,4 @@ ---- +--- external help file: SnipeItPS-help.xml Module Name: SnipeitPS online version: @@ -61,7 +61,7 @@ Accept wildcard characters: False ``` ### -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 @@ -181,7 +181,7 @@ Accept wildcard characters: False ``` ### -url -URL of Snipeit system, can be set using Set-Info command +URL of Snipeit system, can be set using Set-SnipeItInfo command ```yaml Type: String diff --git a/docs/SnipeItPS.md b/docs/SnipeItPS.md index aa150e7..4b03e7d 100644 --- a/docs/SnipeItPS.md +++ b/docs/SnipeItPS.md @@ -1,9 +1,9 @@ --- Module Name: SnipeitPS -Module Guid: {{ Update Module Guid }} +Module Guid: f86f4db4-1cb1-45c4-b7bf-6762531bfdeb Download Help Link: {{ Update Download Link }} -Help Version: {{ Update Help Version }} -Locale: {{ Update Locale }} +Help Version: {{ Please enter version of help manually (X.X.X.X) format }} +Locale: en-US --- # SnipeitPS Module @@ -11,105 +11,117 @@ Locale: {{ Update Locale }} {{ Fill in the Description }} ## SnipeitPS Cmdlets -### [Get-Accessory](Get-Accessory.md) +### [Get-SnipeItAccessory](Get-SnipeItAccessory.md) 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 -### [Get-AssetMaintenance](Get-AssetMaintenance.md) +### [Get-SnipeItAssetMaintenance](Get-SnipeItAssetMaintenance.md) Lists Snipe-it Assets Maintenances -### [Get-Category](Get-Category.md) +### [Get-SnipeItCategory](Get-SnipeItCategory.md) Gets a list of Snipe-it Categories -### [Get-Company](Get-Company.md) +### [Get-SnipeItCompany](Get-SnipeItCompany.md) Gets a list of Snipe-it Companies -### [Get-Component](Get-Component.md) +### [Get-SnipeItComponent](Get-SnipeItComponent.md) Gets a list of Snipe-it Components -### [Get-CustomField](Get-CustomField.md) -Returns a list of all Snipe-IT custom fields +### [Get-SnipeItCustomField](Get-SnipeItCustomField.md) +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 -### [Get-Fieldset](Get-Fieldset.md) -Gets a list of Snipe-it Fieldsets +### [Get-SnipeItFieldset](Get-SnipeItFieldset.md) +Returns a fieldset or list of Snipe-it Fieldsets -### [Get-Model](Get-Model.md) -Gets a list of Snipe-it Models +### [Get-SnipeItLicense](Get-SnipeItLicense.md) +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) 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 -### [New-Asset](New-Asset.md) +### [New-SnipeItAsset](New-SnipeItAsset.md) 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 -### [New-Category](New-Category.md) +### [New-SnipeItCategory](New-SnipeItCategory.md) Create a new Snipe-IT Category -### [New-Component](New-Component.md) +### [New-SnipeItComponent](New-SnipeItComponent.md) Create a new component -### [New-CustomField](New-CustomField.md) +### [New-SnipeItCustomField](New-SnipeItCustomField.md) Add a new Custom Field to Snipe-it asset system -### [New-Department](New-Department.md) +### [New-SnipeItDepartment](New-SnipeItDepartment.md) Creates a department -### [New-License](New-License.md) +### [New-SnipeItLicense](New-SnipeItLicense.md) Creates a licence -### [New-Location](New-Location.md) +### [New-SnipeItLocation](New-SnipeItLocation.md) 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 -### [New-Model](New-Model.md) +### [New-SnipeItModel](New-SnipeItModel.md) Add a new Model to Snipe-it asset system -### [New-User](New-User.md) +### [New-SnipeItUser](New-SnipeItUser.md) Creates a new user -### [Remove-Asset](Remove-Asset.md) -Removes Asset to Snipe-it asset system +### [Remove-SnipeItAsset](Remove-SnipeItAsset.md) +Removes Asset from Snipe-it asset system -### [Remove-User](Remove-User.md) +### [Remove-SnipeItUser](Remove-SnipeItUser.md) Removes User from Snipe-it asset system -### [Set-Accessory](Set-Accessory.md) +### [Set-SnipeItAccessory](Set-SnipeItAccessory.md) 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 -### [Set-AssetOwner](Set-AssetOwner.md) +### [Set-SnipeItAssetOwner](Set-SnipeItAssetOwner.md) Checkout asset -### [Set-Component](Set-Component.md) +### [Set-SnipeItComponent](Set-SnipeItComponent.md) Updates component -### [Set-Info](Set-Info.md) +### [Set-SnipeItInfo](Set-SnipeItInfo.md) Sets authetication information -### [Set-License](Set-License.md) +### [Set-SnipeItLicense](Set-SnipeItLicense.md) Updates a licence -### [Set-Model](Set-Model.md) -Updates Model on Snipe-it asset system +### [Set-SnipeItLicenseSeat](Set-SnipeItLicenseSeat.md) +Set license seat or checkout license seat ### [Set-SnipeitLocation](Set-SnipeitLocation.md) 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 +### [Update-SnipeItAlias](Update-SnipeItAlias.md) +{{ Fill in the Synopsis }} + diff --git a/docs/Update-SnipeItAlias.md b/docs/Update-SnipeItAlias.md new file mode 100644 index 0000000..607bdd4 --- /dev/null +++ b/docs/Update-SnipeItAlias.md @@ -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] [-WhatIf] [-Confirm] [] +``` + +## 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