mirror of
https://github.com/snazy2000/SnipeitPS.git
synced 2025-12-13 01:42:29 +00:00
Merge pull request #219 from PetriAsi/fix/content-encoding#218
Fix/content encoding #218 introduced on 1.9 release
This commit is contained in:
commit
44fb65ca60
3 changed files with 35 additions and 3 deletions
18
CHANGELOG.md
18
CHANGELOG.md
|
|
@ -5,6 +5,24 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](http://keepachangelog.com/),
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
# [v.1.10.x] - 2021-09-03
|
||||
|
||||
## New secure ways to connect Snipe it
|
||||
|
||||
### -secureApiKey allow pass apiKey as SecureString
|
||||
Connect-SnipeitPS -URL 'https://asset.example.com' -secureApiKey 'tokenKey'
|
||||
|
||||
### 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)
|
||||
|
||||
## Fix for content encoding in invoke-snipeitmethod
|
||||
Version 1.9 introduced bug that converted non ascii characters to ascii
|
||||
during request.
|
||||
|
||||
# [v.1.9.x] - 2021-07-14
|
||||
|
||||
## Image uploads
|
||||
|
|
|
|||
18
README.md
18
README.md
|
|
@ -19,9 +19,23 @@ Install-Module SnipeitPS
|
|||
# Check for updates occasionally:
|
||||
Update-Module SnipeitPS
|
||||
|
||||
# To use each session:
|
||||
# import module to session:
|
||||
Import-Module SnipeitPS
|
||||
Set-SnipeitInfo -URL 'https://asset.example.com' -apiKey 'tokenKey'
|
||||
|
||||
# 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
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ function Invoke-SnipeitMethod {
|
|||
}
|
||||
|
||||
if ($Body -and $splatParameters.Keys -notcontains 'Form') {
|
||||
$splatParameters["Body"] = $Body | Convertto-Json
|
||||
$splatParameters["Body"] = [System.Text.Encoding]::UTF8.GetBytes(($Body | Convertto-Json))
|
||||
}
|
||||
|
||||
$script:PSDefaultParameterValues = $global:PSDefaultParameterValues
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue