-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help getting script to function #21
Comments
If your run it without the where-object does it return anything? |
I've tried without the where-object and I get this error message:
Expressions are only allowed as the first element of a pipeline. I ran the whole command with verbose and this is what i get: VERBOSE: [ConvertTo-GetParameter] Making HTTP get parameter string out of a hashtable |
The log suggests it cannot connect to the server |
That's strange, i've tried the IP address and hostname and I get the same error message. I've also turned off the firewall on Snipe-IT server. I'm missing something. Any suggestions? |
@dilpatel45 are you still having issues with this? if so can you try running Get-Asset -url "https://name.org" -apikey "keystringinhere" -verbose |
@snazy2000 yes, i'm still having issues. Is there something in snipe I need to change or alter or verify? PS C:\Windows\system32> Get-Asset -url "https://snipe.domain.org" -apikey "KEY(actual key)" -verbose VERBOSE: [ConvertTo-GetParameter] Making HTTP get parameter string out of a hashtable |
Can you access the url from the machine your running the script? Do you have anything on your network that blocks powershell making requests like your AV or firewall. Is the key 100% correct? May be worth trying to access it via application like postman to make sure you can access the API etc |
Yes, I've verified i can resolve the hostname. I've even tried turning off the firewall internally for testing. Same issue. Yes, i've generated the key multiple times but same error message. I'll check with postman and update again. |
Got it working now, thanks. I was using a Self-Signed certificate to access snipe. I found this command online to bypass and allow self-signed certificates:
Source: https://stackoverflow.com/questions/36456104/invoke-restmethod-ignore-self-signed-certs |
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.
The text was updated successfully, but these errors were encountered: