mirror of
https://github.com/snazy2000/SnipeitPS.git
synced 2025-12-13 18:02:30 +00:00
Merge pull request #149 from PetriAsi/update/readme
updated docs, adding about_snipeit
This commit is contained in:
commit
6ef20bd333
8 changed files with 78 additions and 40 deletions
|
|
@ -1,38 +1,37 @@
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
# Gets a list of Snipe-it Manufacturers
|
# Gets a list of Snipe-it Manufacturers
|
||||||
|
|
||||||
.PARAMETER search
|
.PARAMETER search
|
||||||
A text string to search the Manufactures data
|
A text string to search the Manufactures data
|
||||||
|
|
||||||
.PARAMETER id
|
.PARAMETER id
|
||||||
A id of specific Manufactuter
|
A id of specific Manufactuter
|
||||||
|
|
||||||
.PARAMETER limit
|
.PARAMETER limit
|
||||||
Specify the number of results you wish to return. Defaults to 50. Defines batch size for -all
|
Specify the number of results you wish to return. Defaults to 50. Defines batch size for -all
|
||||||
|
|
||||||
.PARAMETER offset
|
.PARAMETER offset
|
||||||
Offset to use
|
Offset to use
|
||||||
|
|
||||||
.PARAMETER all
|
.PARAMETER all
|
||||||
A return all results, works with -offset and other parameters
|
A return all results, works with -offset and other parameters
|
||||||
|
|
||||||
.PARAMETER url
|
.PARAMETER url
|
||||||
URL of Snipeit system, can be set using Set-SnipeitInfo command
|
URL of Snipeit system, can be set using Set-SnipeitInfo command
|
||||||
|
|
||||||
.PARAMETER apiKey
|
.PARAMETER apiKey
|
||||||
Users API Key for Snipeit, can be set using Set-SnipeitInfo command
|
Users API Key for Snipeit, can be set using Set-SnipeitInfo command
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
Get-SnipeitManufacturer -search HP
|
Get-SnipeitManufacturer -search HP
|
||||||
Search all manufacturers for string HP
|
Search all manufacturers for string HP
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
Get-SnipeitManufacturer -id 3
|
Get-SnipeitManufacturer -id 3
|
||||||
Returns manufacturer with id 3
|
Returns manufacturer with id 3
|
||||||
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
function Get-SnipeitManufacturer()
|
function Get-SnipeitManufacturer()
|
||||||
{
|
{
|
||||||
Param(
|
Param(
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@ Get-SnipeitSupplier -search MySupplier
|
||||||
Get-SnipeitSupplier -id 2
|
Get-SnipeitSupplier -id 2
|
||||||
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
function Get-SnipeitSupplier()
|
function Get-SnipeitSupplier()
|
||||||
{
|
{
|
||||||
Param(
|
Param(
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
.PARAMETER username
|
.PARAMETER username
|
||||||
Username for user
|
Username for user
|
||||||
|
|
||||||
.PARAMETER active
|
.PARAMETER activated
|
||||||
Can user log in to snipe-it?
|
Can user log in to snipe-it?
|
||||||
|
|
||||||
.PARAMETER notes
|
.PARAMETER notes
|
||||||
|
|
|
||||||
|
|
@ -10,12 +10,11 @@ Input string
|
||||||
|
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
Get-Content [your-script.ps1] | Update-SnipeitAlias | Out-File [new-script-name.ps1]
|
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"
|
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.
|
After testing new file you can replace old file with new.
|
||||||
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
|
|
||||||
function Update-SnipeitAlias()
|
function Update-SnipeitAlias()
|
||||||
{
|
{
|
||||||
[CmdletBinding(
|
[CmdletBinding(
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ Updates user with id 3
|
||||||
## PARAMETERS
|
## PARAMETERS
|
||||||
|
|
||||||
### -activated
|
### -activated
|
||||||
{{ Fill activated Description }}
|
Can user log in to snipe-it?
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
Type: Boolean
|
Type: Boolean
|
||||||
|
|
|
||||||
|
|
@ -135,5 +135,5 @@ Updates Model on Snipe-it asset system
|
||||||
Creates a new user
|
Creates a new user
|
||||||
|
|
||||||
### [Update-SnipeitAlias](Update-SnipeitAlias.md)
|
### [Update-SnipeitAlias](Update-SnipeitAlias.md)
|
||||||
{{ Fill in the Synopsis }}
|
Replaces old SnipeitPS commands with new ones
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ schema: 2.0.0
|
||||||
# Update-SnipeitAlias
|
# Update-SnipeitAlias
|
||||||
|
|
||||||
## SYNOPSIS
|
## SYNOPSIS
|
||||||
{{ Fill in the Synopsis }}
|
Replaces old SnipeitPS commands with new ones
|
||||||
|
|
||||||
## SYNTAX
|
## SYNTAX
|
||||||
|
|
||||||
|
|
@ -17,21 +17,22 @@ Update-SnipeitAlias [-String] <String[]> [-WhatIf] [-Confirm] [<CommonParameters
|
||||||
```
|
```
|
||||||
|
|
||||||
## DESCRIPTION
|
## DESCRIPTION
|
||||||
{{ Fill in the Description }}
|
Replaces old SnipeitPS commands with new ones
|
||||||
|
|
||||||
## EXAMPLES
|
## EXAMPLES
|
||||||
|
|
||||||
### Example 1
|
### EXAMPLE 1
|
||||||
```powershell
|
```
|
||||||
PS C:\> {{ Add example code here }}
|
Get-Content [your-script.ps1] | Update-SnipeitAlias | Out-File [new-script-name.ps1]
|
||||||
```
|
```
|
||||||
|
|
||||||
{{ Add example description here }}
|
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.
|
||||||
|
|
||||||
## PARAMETERS
|
## PARAMETERS
|
||||||
|
|
||||||
### -String
|
### -String
|
||||||
{{ Fill String Description }}
|
Input string
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
Type: String[]
|
Type: String[]
|
||||||
|
|
@ -39,7 +40,7 @@ Parameter Sets: (All)
|
||||||
Aliases:
|
Aliases:
|
||||||
|
|
||||||
Required: True
|
Required: True
|
||||||
Position: 0
|
Position: 1
|
||||||
Default value: None
|
Default value: None
|
||||||
Accept pipeline input: True (ByValue)
|
Accept pipeline input: True (ByValue)
|
||||||
Accept wildcard characters: False
|
Accept wildcard characters: False
|
||||||
|
|
@ -81,11 +82,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
|
||||||
|
|
||||||
## INPUTS
|
## INPUTS
|
||||||
|
|
||||||
### System.String[]
|
|
||||||
|
|
||||||
## OUTPUTS
|
## OUTPUTS
|
||||||
|
|
||||||
### System.Object
|
|
||||||
## NOTES
|
## NOTES
|
||||||
|
|
||||||
## RELATED LINKS
|
## RELATED LINKS
|
||||||
|
|
|
||||||
43
docs/about_SnipeitPS.md
Normal file
43
docs/about_SnipeitPS.md
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
# About SnipeitPS
|
||||||
|
## about_SnipeitPS
|
||||||
|
|
||||||
|
# SHORT DESCRIPTION
|
||||||
|
Powershell API Wrapper for Snipe-it.
|
||||||
|
|
||||||
|
# LONG DESCRIPTION
|
||||||
|
Collection of tools that makes interacting with Snipe-it api more pleasant.
|
||||||
|
|
||||||
|
# EXAMPLES
|
||||||
|
Prepare connection Snipe-It with:
|
||||||
|
|
||||||
|
Set-SnipeitInfo -url https://your.site -apikey YourVeryLongApiKey....
|
||||||
|
|
||||||
|
To search assets use:
|
||||||
|
|
||||||
|
Get-SnipeitAsset -search needle
|
||||||
|
|
||||||
|
Piping get and new commands results to set commands is supported. Followirg will
|
||||||
|
set notes for every asset that have model_id 123.
|
||||||
|
|
||||||
|
Get-SnipeitAsset -model_id 123 -all | Set-SnipeitAsset
|
||||||
|
|
||||||
|
You can get specific items with -id prameter like
|
||||||
|
|
||||||
|
Get-SnipeitModel -id 123
|
||||||
|
|
||||||
|
# NOTE
|
||||||
|
Most of commands are using same parameters as in Snipe It api,
|
||||||
|
but it's always good idea check syntax with Get-Help
|
||||||
|
|
||||||
|
# TROUBLESHOOTING NOTE
|
||||||
|
Check your api key and certificate on server first.
|
||||||
|
|
||||||
|
# SEE ALSO
|
||||||
|
|
||||||
|
Report any issues to:
|
||||||
|
[GitHub project page](https://github.com/snazy2000/SnipeitPS/issues)
|
||||||
|
|
||||||
|
# KEYWORDS
|
||||||
|
|
||||||
|
- Snipe-It
|
||||||
|
- asset management
|
||||||
Loading…
Add table
Reference in a new issue