Git Product home page Git Product logo

snipeitps's Introduction

GitHub release Build status PowerShell Gallery License


Want to say thanks?

paypal

Instructions

Installation

Install SnipeitPS from the PowerShell Gallery Install-Module requires PowerShellGet (included in PS v5, or download for v3/v4 via the gallery link)

# One time only install: (requires an admin PowerShell window)
Install-Module SnipeitPS

# Check for updates occasionally:
Update-Module SnipeitPS

# import module to session:
Import-Module SnipeitPS

# Set connection
Connect-SnipeitPS -URL 'https://asset.example.com' -apiKey 'tokenKey'

# Or set connection with safely saved credentials, first save credentials
$SnipeCred =Get-Credential -message "Use url as username and apikey as password"
$SnipeCred | Export-CliXml snipecred.xml

# ..then use your saved credentials like
Connect-SnipeitPS -siteCred (Import-CliXml snipecred.xml)

# OR use -secureApiKey that allow pass apiKey as SecureString
# if you are usin Microsoft.PowerShell.SecretManagement or like
Connect-SnipeitPS -URL 'https://asset.example.com' -secureApiKey 'tokenKey'

Usage

# Review the help at any time!
Get-Help about_SnipeitPS
Get-Command -Module SnipeitPS
Get-Help Get-SnipeitAsset -Full   # or any other command

Reporting bugs and issues

Please use -Verbose switch with command you have problem with. Then create ticket here with all -Verbose output

snipeitps's People

Contributors

chaosjester avatar gvoynov avatar k9barry avatar mattcarras avatar mrcarter2959 avatar nortech-harry avatar petriasi avatar russelllevasseur avatar shcgitpf avatar snazy2000 avatar square252 avatar xlejakx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

snipeitps's Issues

-search parameter does not work on PowerShell Core 7.0

It just returns all assets to the limit no matter what is entered into -search parameter for all functions including Get-Asset and Get-AssetMaintenance.

Expect it's due to a chance in functionality around this line:

$SearchParameter = . Get-ParameterValue

Can't assing asset to asset

Hello, I can't make Set-AssetOwner work assigning Asset to another asset. Every time I try I get this error, with every asset. It's a bad understanding or not working?

Error

Thanks in advance.

Regards,
Juan Pablo

Timeline for Pull Request

Is there a timeline for when Pull Requests get merged into the normal code base? Or is there a way to add a function into the module locally.

I went through the 1.0.57 on my machine and edited all the files to include the Delete-Asset.ps1 function but it then broke my installation and wouldn't import any cmdlet's. My current work around is to include the Private Scripts in my scripts since the Remove-Asset.ps1 references them as i wrote it reflecting your code

Thanks! :)

New-AssetMaintenance: the is warranty must be true or false

When attempting to add new asset maintenance:
New-AssetMaintenance -asset_id $assetID -supplier_id $supplierID -asset_maintenance_type "Maintenance" -title $maintTitle -startDate $Today -completionDate $Today

Receiving

Invoke-SnipeitMethod : 
is_warranty                             
-----------                             
{The is warranty must be true or false.}
At C:\Program Files\WindowsPowerShell\Modules\SnipeitPS\1.0.42\public\New-AssetMaintenance.ps1:97 char:19
+         $result = Invoke-SnipeitMethod @Parameters
+                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-SnipeitMethod

when adding -is_warranty false or true

New-AssetMaintenance : Cannot process argument transformation on parameter 'cost'. Cannot convert value "false" to type "System.Decimal". Error: "Input string was not in a correct format."
At line:1 char:177
+ ... aintTitle -startDate $Today -completionDate $Today -is_warranty false
+                                                                     ~~~~~
    + CategoryInfo          : InvalidData: (:) [New-AssetMaintenance], ParameterBindingArgumentTransformationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,New-AssetMaintenance

No function Remove-AssetMaintenances

SnipeIT API supports deleting an Asset Maintenance but a function does not exist for this.

I've created one and raised a PR, raising an issue for completeness (in the wrong order - n00b)

Namespacing cmdlets

Any issue with renaming all of the cmdlets to verb-SnipeITnoun? That will handle the conflicts and follow MS best practices. If not, I am fine putting in a pull request for that.

Raise Limit to reasonable count

Hey,
as I am writing i found out that parts of my script did not work because of this issue.

This shouldn't be 50 its way to low.

Two approaches: Make it default to query all or change it to a reasonable number like 2000.

Get-User Search Breaks With Plus Sign

Get-User -search "[email protected]" appears to not work at all, as it doesn't return any results when the email address exists in the system. I think the + sign is breaking the search.

Here's the verbose output:
VERBOSE: [ConvertTo-GetParameter] Making HTTP get parameter string out of a hashtable
VERBOSE: [Invoke-SnipeitMethod] Invoking method Get to URI https://domain.snipe-it.io/api/v1/users?offset=0&[email protected]&sort=&limit=50&order=desc
VERBOSE: GET https://domain.snipe-it.io/api/v1/users?offset=0&[email protected]&sort=&limit=50&order=desc with 0-byte payload
VERBOSE: received -1-byte response of content type application/json
VERBOSE: [Invoke-SnipeitMethod] Status code: 200
VERBOSE: {"total":0,"rows":[]}
VERBOSE: [Invoke-SnipeitMethod] Function ended

Set-Asset Doesn't Work

Set-Asset was having an issue applying any changes. I've added the corrected code that worked for me.

`<#
.SYNOPSIS
Update a Asset in the Snipe-it asset system

.DESCRIPTION
Long description

.PARAMETER id
ID of the Asset

.PARAMETER Name
Name of the Asset

.PARAMETER Status_id
Status ID of the asset, this can be got using Get-Status

.PARAMETER Model_id
Model ID of the asset, this can be got using Get-Model

.PARAMETER url
URL of Snipeit system, can be set using Set-Info command

.PARAMETER apiKey
Users API Key for Snipeit, can be set using Set-Info command

.PARAMETER customfields
Hastable of custom fields and extra fields that need passing through to Snipeit

.EXAMPLE
Set-Asset -id 1 -status_id 1 -model_id 1 -name "Machine1"

.EXAMPLE
Set-Asset -id 1 -status_id 1 -model_id 1 -name "Machine1" -CustomValues = @{ "_snipeit_os_5 = "Windows 10 Pro" }

#>

function Set-Asset()
{
[CmdletBinding(
SupportsShouldProcess = $true,
ConfirmImpact = "Medium"
)]

Param(
    [parameter(mandatory = $true)]
    [int]$id,

    [string]$Name,

    [int]$Status_id,

    [int]$Model_id,

    [parameter(mandatory = $true)]
    [string]$url,

    [parameter(mandatory = $true)]
    [string]$apiKey,

    [hashtable] $customfields
)

$Values = @{
    "name"      = $Name
    "status_id" = $status_id
    "model_id"  = $model_id
	"id"        = $id
}

if ($customfields)
{
    $Values += $customfields
}

$Body = $Values | ConvertTo-Json;
write-host $Body
$Parameters = @{
    Uri    = "$url/api/v1/hardware/$id"
    Method = 'PATCH'
    Body   = $Body
    Token  = $apiKey
}

If ($PSCmdlet.ShouldProcess("ShouldProcess?"))
{
    $result = Invoke-SnipeitMethod @Parameters
}

$result

}
`

Help getting script to function

Hello everyone, I am have difficulties getting the script to generate any output. This is what im trying
Get-Asset -url "https://name.org" -apikey "keystringinhere" | Where-Object {$_.name -eq "nameofdevice" }

The output shows nothing.

Rename folders to make the Module compatible with Powershell Core

Hello and thanks for the great work!

I was trying to use the module with PSCore on both Macos and Linux, and an issue exists in both. The module folder needs to be renamed from SnipeitPS to SnipeItPS, and the Public and Private folders to public and private, respectively, for the module to successfully load.

That's obviously because *nix systems are case sensitive.

After that, it seems to be smooth sailing for everything. Please implement the change, it seems very simple and it would make the module compatible with everything that Powershell Core runs on, which would be great!

checkin/checkout licenses

Hey there,
I'm trying some automation and assign licenses based on an active directory groups. Is there any possibility to checkin/checkout licenses to users using SnipePS? Can I somehow get the users who currently have a seat checked-out? In Snipe web frontend this can be seen on the Seats tab in license view.
Any idea if and how to achieve this? Let me know if you have any questions.
Thanks

Put vs Patch for Set-Asset

I'll work on contributing, but I wanted to mention some behaviors that I've seen when using the Put instead of Patch for set-asset. I created my own version of set-asset to introduce all the other parameters I needed. I also created what I called an Update-asset function that uses Patch.

When using Put to change information for an asset the location for that asset no longer reflects the assigned users location, but instead the default rtd location. Checking the asset back in and back out resolves this, or logging into the site and editing/saving the user (no change required).

When using Patch instead the location information is retained. In my case I only added warranty months and purchase date to the attributes so I could automate the Dell warranty import.

I'm going to try to amend the Set-Asset to use Patch instead of Put and add all current parameters for the Patch API to see if that works consistently.

set-component not working

Trying to increase quantity of a component, and there is no set-component function found. When I do a get-command -module snipeitps, I get the following:

`CommandType Name Version Source


Function Get-Accessory 1.0.70 snipeitps
Function Get-Asset 1.0.70 snipeitps
Function Get-AssetMaintenance 1.0.70 snipeitps
Function Get-Category 1.0.70 snipeitps
Function Get-Company 1.0.70 snipeitps
Function Get-Component 1.0.70 snipeitps
Function Get-CustomField 1.0.70 snipeitps
Function Get-Department 1.0.70 snipeitps
Function Get-Fieldset 1.0.70 snipeitps
Function Get-License 1.0.70 snipeitps
Function Get-Manufacturer 1.0.70 snipeitps
Function Get-Model 1.0.70 snipeitps
Function Get-SnipeitLocation 1.0.70 snipeitps
Function Get-Status 1.0.70 snipeitps
Function Get-Supplier 1.0.70 snipeitps
Function Get-User 1.0.70 snipeitps
Function New-Accessory 1.0.70 snipeitps
Function New-Asset 1.0.70 snipeitps
Function New-AssetMaintenance 1.0.70 snipeitps
Function New-Audit 1.0.70 snipeitps
Function New-Company 1.0.70 snipeitps
Function New-Component 1.0.70 snipeitps
Function New-CustomField 1.0.70 snipeitps
Function New-Department 1.0.70 snipeitps
Function New-License 1.0.70 snipeitps
Function New-Location 1.0.70 snipeitps
Function New-Manufacturer 1.0.70 snipeitps
Function New-Model 1.0.70 snipeitps
Function New-User 1.0.70 snipeitps
Function Remove-Asset 1.0.70 snipeitps
Function Reset-AssetOwner 1.0.70 snipeitps
Function Set-Accessory 1.0.70 snipeitps
Function Set-Asset 1.0.70 snipeitps
Function Set-AssetOwner 1.0.70 snipeitps
Function Set-Info 1.0.70 snipeitps
Function Set-License 1.0.70 snipeitps
Function Set-Model 1.0.70 snipeitps
Function Set-User 1.0.70 snipeitps`

Asset property not truncated/parsed

The results from a Get-Asset include additional text in the properties.

Example:
Running Get-Asset -limit 1 | Select-Object -Property model returns with the output of

model

@{id=41; name=WT4090}

The output expected in my case would just be

WT4090

Checkin

Hello,

I believe there's no way to checkin assets after these has been checked out using the set-assetowner. I've attempted to checkin by setting a null assetowner but that doesnt appear to work, and a few other things...

Is there a lacking cmdlet here or documentation? I cannot find a way.

Mac Powershell compatibility?

I installed the module on my powershell instance without any issues, but no commands work. I get the same error message regardless of what command I try to run:

PS /Users/jussi> Get-Asset ConvertFrom-Json: /Users/jussi/.local/share/powershell/Modules/SnipeitPS/1.0.70/Private/Invoke-SnipeitMethod.ps1:88 Line | 88 | … $response = ConvertFrom-Json -InputObject $webResponse.Content | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Conversion from JSON failed with error: Unexpected character encountered | while parsing value: S. Path '', line 0, position 0.

Is there something wrong with my setup, or is it just incompatibility with the mac powershell environment?

Better error handling in Invoke-SnipeitMethod

As issues #84 , #55 and probably other are shown, error handling in Invoke-SnipeitMethod does not work correctly.
If webrequest is failing because of invalid certificate, connection errror or so, user need to see meaningful error message.

New-SnipeItAccessory and Set-SnipeItAccessoryOwner

Would love if there was a New-Accessory command as well as the accompanied Set-AccessoryOwner like there are for assets.

The built in Web Importer for snipe-it doesn't allow for checking accessories out to users, but I may be able to write a powershell script to iterate through a CSV if this functionality existed in SnipeitPS.

Unmaintained Module

Hello @snazy2000, looks like this module is falling behind on maintenance - could you consider adding me as a contributor/passing the module on for someone else to maintain?

Password Confirmation does not match

When attempting to create new users:
New-User -firstName $Firstname -lastName $Lastname -userName $Username -email $Email -location_id $Location -apiKey $ApiKEY -url $ApiURL -password $Password

It returns with:

`Invoke-SnipeitMethod :
password
--------
{The password confirmation does not match.}
At C:\Program Files\WindowsPowerShell\Modules\SnipeitPS\1.0.54\Public\New-User.ps1:141 char:19
+         $result = Invoke-SnipeitMethod @Parameters
+                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-SnipeitMethod`

I can't find a passable parameter, or the script isn't passing the password field correctly.

Set-Model cmdlet

Hi and thanks for the module!

I miss the Set-Model cmdlet.
For example, I have about 50 new model types, for each I need to add custom fieldset.
I can check it with the Get-Model cmdlet, but no way of editing it.

Here's the example I see in my infrastucture:

name              : HP USB GbE Ethernet Adapter
manufacturer      : @{id=4; name=HP}
category          : @{id=149; name=Dock}
fieldset          : @{id=3; name=reserveip}

Set-AssetOwner issue

Hello everyone, when I try to set the asset owner I get a message stating the assigned asset and 6504 must be different.

Set-AssetOwner -url 'https://snipe.maderacoe.org' -apikey $apikey -id '6502' -checkout_to_type "asset" -assigned_id '6504'

Invoke-SnipeitMethod :
assigned_asset
--------------
{The assigned asset and 6504 must be different.}
At C:\Program Files\WindowsPowerShell\Modules\SnipeitPS\1.0.70\Public\Set-AssetOwner.ps1:48 char:19
+         $result = Invoke-SnipeitMethod @Parameters
+                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-SnipeitMethod

Both the ID and the Assigned to ID are different. I'm not sure why it's still flagging it. Please advise.

set-user doesn't seem to work

I'm pretty new to use this and completely could be making a mistake. But when I try to use the set-user command, it doesn't seem to make any changes.

My assumption is the "-id" field is the ID of the user you want to edit, in this case, its 2277.
Example:
Set-User -id 2277 -jobtitle Test -url http://localhost:85 -apikey ##########

After I input that, I get no output or error.

When I goto check, the job title has not changed. I've test this with other users/attributes and same issue.

New-AssetMaintenance the start date field is required

Believe this is related to parameter being $startdate and $values[start_date] in New-AssetMaintenance, but wasn't sure which one needs to be changed to ensure that Invoke_SnipeitMethod worked correctly.
New-AssetMaintenance -asset_id $assetID -supplier_id $supplierID -asset_maintenance_type "Maintenance" -title $maintTitle -start_date $Today -completionDate $Today

Invoke-SnipeitMethod : 
start_date                         
----------                         
{The start date field is required.}

SnipeIT v4.6.15 - build 4011 (master)
SnipeitPS 1.0.48

Set-Asset with customfield

Hey,
I'm trying to update the SnipeIT with some CVS file content and got to the point where I have to update a custom_field.

Docu sais:

PS C:\scripts\windows> Get-Command -Module SnipeitPS
...
Function        Set-Asset                                          1.0.57     SnipeitPS
...
Get-Help Set-Asset -Full
...
-------------------------- EXAMPLE 2 --------------------------
    
    PS C:\>Set-Asset -id 1 -status_id 1 -model_id 1 -name "Machine1" -CustomValues = @{ "_snipeit_os_5 = "Windows 10 Pro" }

Seems like -CustomValues is outdated as I found -customfields referenced in another ticket.
But I'm somehow not able to create a proper hashtable to push my customfield.

PS C:\scripts\windows> Set-Asset -id 772 -customfields = @{ '_snipeit_accounting_id_8' = '410475' }
Set-Asset : Cannot process argument transformation on parameter 'customfields'. Cannot convert the "=" value of type "System.String" to type "System.Collections.Hashtable".
At line:1 char:33
+ Set-Asset -id 772 -customfields = @{ '_snipeit_accounting_id_8' = '41 ...
+                                 ~
    + CategoryInfo          : InvalidData: (:) [Set-Asset], ParameterBindingArgumentTransformationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Set-Asset

Would be great if someone has some recommendations.
Thanks much

Edit 1:
After removing the = assignment from the hashtable a was able to proceed but failing again, as I have to add model_id & status_id mandatory. Even though the CSV is based on a Snipe Export, this data is quite difficult to compute.

New-Model works, New-Asset does not

Creating a new model works:

New-Model -name "Latitude E6540" -manufacturer_id 1 -category_id 2 -fieldset_id 0

category_id : 2
fieldset_id :
name : Latitude E6540
manufacturer_id : 1
updated_at : 2019-11-20 12:10:18
created_at : 2019-11-20 12:10:18
id : 5

But when i try to add a new asset, nothing happens:

New-Asset -status_id 2 -model_id 5 -name "DE001LA0002"

No error, no message.

New-User without success?

New-User -firstName "Peter" -userName "Test" -password "Test123454566" -LastName "Meier"

Does not return an error or anything, but does not work. Have the same problem, when i try to do it in C#, so i think this is a change from Snipeit?

PS C:\Users\014nr9999> New-User
Cmdlet New-User an der Befehlspipelineposition 1
Geben Sie Werte für die folgenden Parameter an:
firstName: A
lastName: B
userName: D

no success ...

Quick question regarding passing custom fields

Hey @snazy2000

I have a dumb, but hopefully easy question. I''m struggling using New-Asset with custom fields.

Let's say I have a custom fieldset with 1 custom field, called MAC_Address. I want to create a new-asset with this custom field.That fieldset is already associated with the value I have in $modeldatabaseID. I have a standard MAC address value formatted like this: xx:xx:xx:xx:xx:xx stored in $EthernetMAC. Based on the documentation I should be able to include custom fields using the -customfields parameter with a hash table. I'm doing so in this manner:

New-Asset -Name "Name" -Model_id $modeldatabaseid -Status_id 5 -customfields @{"serial" = "1234"; "MAC_Address" = "$EthernetMAC"}

The asset is created, and everything is correct, including the serial, but the MAC_Address field is empty.

Thoughts on what might be occurring?

Get-User search results include all users that have user as a manager as well

When I run Get-User -search msmith I would expect the result to be msmith's details from Snipe. What I am actually getting is that user's details as well as all other users' details that also have msmith as a manager. Is there a way to limit the search to just a particular field in Snipe's user details?
Example: Get-User -search msmith -searchfield username

Set-Model fails: Copy-Parameters not found

The Set-Model module fails to run, as it cannot find the function Copy-Parameters.
Looking at the source, I can't find this function in PowerShell or SnipeitPS either.

Perhaps a missing dependency? Or a missing file in the Private functions?

Error:

Copy-Parameters : The term 'Copy-Parameters' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is cor
rect and try again.
At C:\Program Files\WindowsPowerShell\Modules\SnipeitPS\1.0.57\Public\Set-Model.ps1:34 char:15
+     $Values = Copy-Parameters -InputObject $PSBoundParameters
+               ~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Copy-Parameters:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Conflict with existing Get-Location

Steven,
I tried to 'Install-Module SnipeitPS' on a PS 5.1 Windows Server 2012 R2, but PS complained that Get-Location already exists.
It is already part of this: Microsoft.PowerShell.Management.
How can I get around this?

Token Authorization

I have followed the steps to get a API Token, however when i use the Set-Info or use the parameters for -url -apikey, I get:

$snipeUser = Get-User -search "username" -url $url -apiKey $apikey -Verbose
VERBOSE: [ConvertTo-GetParameter] Making HTTP get parameter string out of a hashtable
VERBOSE: [Invoke-SnipeitMethod] Invoking method Get to URI http://snipeit/api/v1/users?search=username&limit=50&order=desc
VERBOSE: GET http://snipeit/api/v1/users?search=username&limit=50&order=desc with 0-byte payload
VERBOSE: [Invoke-SnipeitMethod] Failed to get an answer from the server
VERBOSE: [Invoke-SnipeitMethod] Status code: Unauthorized
Invoke-SnipeitMethod : [Invoke-SnipeitMethod] You are not Authorized to access the resource, check your token is correct
At C:\Program Files\WindowsPowerShell\Modules\SnipeitPS\1.0.70\Public\Get-User.ps1:53 char:15

  • $result = Invoke-SnipeitMethod @Parameters
    
  •           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-SnipeitMethod

I have re-made the multiple times on the Administrators account (SuperUsers). Still no tomatoes...

New-User Required Field

When attempting to created a new user, I'm getting the following error. I looked in New-Users.ps1 and there doesn't appear to be a passable password parameter.

Invoke-SnipeitMethod : 
password                         
--------                         
{The password field is required.}
At C:\Users\Ryan Pesta\Documents\WindowsPowerShell\Modules\SnipeitPS\1.0.38\public\New-User.ps1:139 char:19
+         $result = Invoke-SnipeitMethod @Parameters
+                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-SnipeitMethod

Invalid JSON primitive: .

SnipeitPS has been working fine until recently and I keep getting the following error. I'm hoping I'm just doing something wrong. I used postman to test the API and it seems to be working fine, it is just the Powershell module that is having the issue.

BTW: I also tried reverting to 1.0.57 and have the same error.

ConvertFrom-Json : Invalid JSON primitive: .
At C:\Program Files\WindowsPowerShell\Modules\SnipeitPS\1.0.76\Private\Invoke-SnipeitMethod.ps1:88 char:29

  • ... $response = ConvertFrom-Json -InputObject $webResponse.Content
  •                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [ConvertFrom-Json], ArgumentException
    • FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.ConvertFromJsonCommand

Get-User | empty results after few searches in loop

Hi,

trying to use the "Get-User" command for a "foreach loop".

It successfully searches for the first 120 users, but then just returns blank.

Also if I search for all users with -Limit "9999" it only returns the maximum amount of "500" users.

Any ideas on this topic?

Thanks in advance!

Missing Functions?

When i run the Get-Command -Module SnipeitPS, this is all the available functions:

CommandType Name Version S


Function New-User 1.0.76 S
Function Remove-Asset 1.0.76 S
Function Reset-AssetOwner 1.0.76 S
Function Set-Accessory 1.0.76 S
Function Set-Asset 1.0.76 S
Function Set-AssetOwner 1.0.76 S
Function Set-Info 1.0.76 S
Function Set-License 1.0.76 S
Function Set-Model 1.0.76 S
Function Set-User 1.0.76 S

Have things not been finished on this module?

Bug: custom field with special character not working

Hey Devs,
I created a custom field for laptops called "screen width" and made it a LISTBOX with format ANY. Then I added items per row like:

14"
15"
16"
19"

when editing an asset, I can choose from the select box and can see that the value is properly saved. The database field contains the correct value. e.g. 14"
When now editing the asset again, the value is not loaded and the select field remains empty. On saving the asset the value is lost and NULL written to the asset table.
I have to always add the screen width manually again.

I renamed the custom field from 14" to 14 inch and all works fine. Seems like there is not enough character encoding for custom fields.
Let me know if you need more info.
Thanks much.

Token?

Hi,

I like your Project. It looks very nice.
I want to use it but I cant find the right tokenkey.

I tried my application token of snipeits .env. Furthermore I tried creating an snipe key by using following command: php artisan passport:client

Can you please help me.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.