From a27f20f0cdfe5240e96ca4c6cf1a78d81f5f480d Mon Sep 17 00:00:00 2001 From: Petri Asikainen Date: Wed, 9 Jun 2021 21:08:18 +0300 Subject: [PATCH 1/2] updated docs --- SnipeitPS/Public/Get-SnipeitManufacturer.ps1 | 45 ++++++++++---------- SnipeitPS/Public/Get-SnipeitSupplier.ps1 | 1 - SnipeitPS/Public/Set-SnipeitUser.ps1 | 2 +- SnipeitPS/Public/Update-SnipeitAlias.ps1 | 3 +- docs/Set-SnipeitUser.md | 2 +- docs/SnipeitPS.md | 2 +- docs/Update-SnipeitAlias.md | 20 ++++----- docs/about_SnipeitPS.md | 43 +++++++++++++++++++ 8 files changed, 78 insertions(+), 40 deletions(-) create mode 100644 docs/about_SnipeitPS.md diff --git a/SnipeitPS/Public/Get-SnipeitManufacturer.ps1 b/SnipeitPS/Public/Get-SnipeitManufacturer.ps1 index 0fe3e24..1cb3ea3 100644 --- a/SnipeitPS/Public/Get-SnipeitManufacturer.ps1 +++ b/SnipeitPS/Public/Get-SnipeitManufacturer.ps1 @@ -1,38 +1,37 @@ <# -.SYNOPSIS -# Gets a list of Snipe-it Manufacturers + .SYNOPSIS + # Gets a list of Snipe-it Manufacturers -.PARAMETER search -A text string to search the Manufactures data + .PARAMETER search + A text string to search the Manufactures data -.PARAMETER id -A id of specific Manufactuter + .PARAMETER id + A id of specific Manufactuter -.PARAMETER limit -Specify the number of results you wish to return. Defaults to 50. Defines batch size for -all + .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 offset + Offset to use -.PARAMETER all -A return all results, works with -offset and other parameters + .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 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 + .PARAMETER apiKey + Users API Key for Snipeit, can be set using Set-SnipeitInfo command -.EXAMPLE -Get-SnipeitManufacturer -search HP -Search all manufacturers for string HP + .EXAMPLE + Get-SnipeitManufacturer -search HP + Search all manufacturers for string HP -.EXAMPLE -Get-SnipeitManufacturer -id 3 -Returns manufacturer with id 3 + .EXAMPLE + Get-SnipeitManufacturer -id 3 + Returns manufacturer with id 3 #> - function Get-SnipeitManufacturer() { Param( diff --git a/SnipeitPS/Public/Get-SnipeitSupplier.ps1 b/SnipeitPS/Public/Get-SnipeitSupplier.ps1 index 9c8b6bd..39797cc 100644 --- a/SnipeitPS/Public/Get-SnipeitSupplier.ps1 +++ b/SnipeitPS/Public/Get-SnipeitSupplier.ps1 @@ -30,7 +30,6 @@ Get-SnipeitSupplier -search MySupplier Get-SnipeitSupplier -id 2 #> - function Get-SnipeitSupplier() { Param( diff --git a/SnipeitPS/Public/Set-SnipeitUser.ps1 b/SnipeitPS/Public/Set-SnipeitUser.ps1 index 755ae82..e4cebd7 100644 --- a/SnipeitPS/Public/Set-SnipeitUser.ps1 +++ b/SnipeitPS/Public/Set-SnipeitUser.ps1 @@ -17,7 +17,7 @@ .PARAMETER username Username for user - .PARAMETER active + .PARAMETER activated Can user log in to snipe-it? .PARAMETER notes diff --git a/SnipeitPS/Public/Update-SnipeitAlias.ps1 b/SnipeitPS/Public/Update-SnipeitAlias.ps1 index 9d9157a..8ba3323 100644 --- a/SnipeitPS/Public/Update-SnipeitAlias.ps1 +++ b/SnipeitPS/Public/Update-SnipeitAlias.ps1 @@ -10,12 +10,11 @@ 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( diff --git a/docs/Set-SnipeitUser.md b/docs/Set-SnipeitUser.md index d3c09f9..4d5faa0 100644 --- a/docs/Set-SnipeitUser.md +++ b/docs/Set-SnipeitUser.md @@ -34,7 +34,7 @@ Updates user with id 3 ## PARAMETERS ### -activated -{{ Fill activated Description }} +Can user log in to snipe-it? ```yaml Type: Boolean diff --git a/docs/SnipeitPS.md b/docs/SnipeitPS.md index 5aa9bc6..c54370c 100644 --- a/docs/SnipeitPS.md +++ b/docs/SnipeitPS.md @@ -135,5 +135,5 @@ Updates Model on Snipe-it asset system Creates a new user ### [Update-SnipeitAlias](Update-SnipeitAlias.md) -{{ Fill in the Synopsis }} +Replaces old SnipeitPS commands with new ones diff --git a/docs/Update-SnipeitAlias.md b/docs/Update-SnipeitAlias.md index 19e0d46..1dd3141 100644 --- a/docs/Update-SnipeitAlias.md +++ b/docs/Update-SnipeitAlias.md @@ -8,7 +8,7 @@ schema: 2.0.0 # Update-SnipeitAlias ## SYNOPSIS -{{ Fill in the Synopsis }} +Replaces old SnipeitPS commands with new ones ## SYNTAX @@ -17,21 +17,22 @@ Update-SnipeitAlias [-String] [-WhatIf] [-Confirm] [ {{ Add example code here }} +### EXAMPLE 1 +``` +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 ### -String -{{ Fill String Description }} +Input string ```yaml Type: String[] @@ -39,7 +40,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 0 +Position: 1 Default value: None Accept pipeline input: True (ByValue) Accept wildcard characters: False @@ -81,11 +82,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### System.String[] - ## OUTPUTS -### System.Object ## NOTES ## RELATED LINKS diff --git a/docs/about_SnipeitPS.md b/docs/about_SnipeitPS.md new file mode 100644 index 0000000..6745878 --- /dev/null +++ b/docs/about_SnipeitPS.md @@ -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 + +# NOTE + + +# TROUBLESHOOTING NOTE +{{ Troubleshooting Placeholder - Warns users of bugs}} + +{{ Explains behavior that is likely to change with fixes }} + +# SEE ALSO +{{ See also placeholder }} + +{{ You can also list related articles, blogs, and video URLs. }} + +# KEYWORDS +{{List alternate names or titles for this topic that readers might use.}} + +- {{ Keyword Placeholder }} +- {{ Keyword Placeholder }} +- {{ Keyword Placeholder }} +- {{ Keyword Placeholder }} From 843f10bbb46a0b13362d0a3a21aa65f92f6c8ff8 Mon Sep 17 00:00:00 2001 From: Petri Asikainen Date: Wed, 9 Jun 2021 21:12:30 +0300 Subject: [PATCH 2/2] updated docs --- docs/about_SnipeitPS.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/about_SnipeitPS.md b/docs/about_SnipeitPS.md index 6745878..fcb3f69 100644 --- a/docs/about_SnipeitPS.md +++ b/docs/about_SnipeitPS.md @@ -8,11 +8,11 @@ Powershell API Wrapper for Snipe-it. Collection of tools that makes interacting with Snipe-it api more pleasant. # EXAMPLES -Prepare connection Snipe-It with +Prepare connection Snipe-It with: Set-SnipeitInfo -url https://your.site -apikey YourVeryLongApiKey.... -To search assets use +To search assets use: Get-SnipeitAsset -search needle @@ -21,23 +21,23 @@ set notes for every asset that have model_id 123. Get-SnipeitAsset -model_id 123 -all | Set-SnipeitAsset -# NOTE +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 -{{ Troubleshooting Placeholder - Warns users of bugs}} - -{{ Explains behavior that is likely to change with fixes }} +Check your api key and certificate on server first. # SEE ALSO -{{ See also placeholder }} -{{ You can also list related articles, blogs, and video URLs. }} +Report any issues to: +[GitHub project page](https://github.com/snazy2000/SnipeitPS/issues) # KEYWORDS -{{List alternate names or titles for this topic that readers might use.}} -- {{ Keyword Placeholder }} -- {{ Keyword Placeholder }} -- {{ Keyword Placeholder }} -- {{ Keyword Placeholder }} +- Snipe-It +- asset management