mirror of
https://github.com/snazy2000/SnipeitPS.git
synced 2025-12-15 02:35:47 +00:00
Fix broken get parameters
This commit is contained in:
parent
923838e15f
commit
88a94115b1
2 changed files with 3 additions and 3 deletions
|
|
@ -71,7 +71,7 @@ function Invoke-SnipeitMethod {
|
||||||
# This can be done using $Body, maybe some day - PetriAsi
|
# This can be done using $Body, maybe some day - PetriAsi
|
||||||
if ($GetParameters -and ($apiUri -notlike "*\?*")){
|
if ($GetParameters -and ($apiUri -notlike "*\?*")){
|
||||||
Write-Debug "Using `$GetParameters: $($GetParameters | Out-String)"
|
Write-Debug "Using `$GetParameters: $($GetParameters | Out-String)"
|
||||||
[string]$URI += (ConvertTo-GetParameter $GetParameters)
|
[string]$apiUri = $apiUri + (ConvertTo-GetParameter $GetParameters)
|
||||||
# Prevent recursive appends
|
# Prevent recursive appends
|
||||||
$GetParameters = $null
|
$GetParameters = $null
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,12 +68,12 @@ function Connect-SnipeitPS {
|
||||||
PROCESS {
|
PROCESS {
|
||||||
switch ($PsCmdlet.ParameterSetName) {
|
switch ($PsCmdlet.ParameterSetName) {
|
||||||
'Connect with url and apikey' {
|
'Connect with url and apikey' {
|
||||||
$SnipeitPSSession.url = $url.TrimEnd('/')
|
$SnipeitPSSession.url = $url.AbsoluteUri.TrimEnd('/')
|
||||||
$SnipeitPSSession.apiKey = ConvertTo-SecureString -AsPlainText -String $apiKey
|
$SnipeitPSSession.apiKey = ConvertTo-SecureString -AsPlainText -String $apiKey
|
||||||
}
|
}
|
||||||
|
|
||||||
'Connect with url and secure apikey' {
|
'Connect with url and secure apikey' {
|
||||||
$SnipeitPSSession.url = $url.TrimEnd('/')
|
$SnipeitPSSession.url = $url.AbsoluteUri.TrimEnd('/')
|
||||||
$SnipeitPSSession.apiKey = $secureApiKey
|
$SnipeitPSSession.apiKey = $secureApiKey
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue